7
7
//! themselves UDP and --> may pretend to have performed some form of network address
8
8
//! translation, and present invalid addresses as the local address.
9
9
//!
10
- //! * Implementing [`UdpStack::Bound`] and [`UdpStack::Unbound`] unconnected sockets separately
11
- //! allows discarding the local addresses in the bound case. With LTO enabled, all the overhead
12
- //! compared with a third trait variant between [ConnectedUdp] and [UnconnectedUdp] (in which the
13
- //! local address is static but the remote address is flexible) should optimized out.
14
- //! Implementing `Bound` and `Unbound` with the same type is expected to be a common choice.
10
+ //! * Implementing [`UdpStack::UniquelyBound`] and [`UdpStack::MultiplyBound`] unconnected sockets
11
+ //! separately allows discarding the local addresses in the bound case. With LTO enabled, all the
12
+ //! overhead compared with a third trait variant between [ConnectedUdp] and [UnconnectedUdp] (in
13
+ //! which the local address is static but the remote address is flexible) should optimized out.
14
+ //! Implementing `UniquelyBound` and `MultiplyBound` with the same type is expected to be a
15
+ //! common choice.
15
16
16
17
use core:: future:: Future ;
17
18
use no_std_net:: SocketAddr ;
@@ -141,11 +142,11 @@ pub trait UdpStack {
141
142
where
142
143
Self : ' m ;
143
144
/// Eventual socket return type of the [`.bind_single()`] method
144
- type Bound < ' m > : UnconnectedUdp
145
+ type UniquelyBound < ' m > : UnconnectedUdp
145
146
where
146
147
Self : ' m ;
147
148
/// Eventual return type of the [`.bind_multiple()`] method
148
- type Unbound < ' m > : UnconnectedUdp
149
+ type MultiplyBound < ' m > : UnconnectedUdp
149
150
where
150
151
Self : ' m ;
151
152
@@ -196,8 +197,9 @@ pub trait UdpStack {
196
197
/// other protocols for advertising purposes.
197
198
fn bind_single ( & self , local : SocketAddr ) -> Self :: BindSingleFuture < ' _ > ;
198
199
/// Future return type of the [`.bind_single()`] method
199
- type BindSingleFuture < ' a > : Future < Output = Result < ( SocketAddr , Self :: Bound < ' a > ) , Self :: Error > >
200
- where
200
+ type BindSingleFuture < ' a > : Future <
201
+ Output = Result < ( SocketAddr , Self :: UniquelyBound < ' a > ) , Self :: Error > ,
202
+ > where
201
203
Self : ' a ;
202
204
203
205
/// Create a socket that has no single fixed local address.
@@ -224,7 +226,7 @@ pub trait UdpStack {
224
226
/// interface and IP address unspecified.
225
227
fn bind_multiple ( & self , local : SocketAddr ) -> Self :: BindMultipleFuture < ' _ > ;
226
228
/// Future return type of the [`.bind_multiple()`] method
227
- type BindMultipleFuture < ' a > : Future < Output = Result < Self :: Unbound < ' a > , Self :: Error > >
229
+ type BindMultipleFuture < ' a > : Future < Output = Result < Self :: MultiplyBound < ' a > , Self :: Error > >
228
230
where
229
231
Self : ' a ;
230
232
}
0 commit comments