pub trait UdpSocketProvider {
type Sock: Socket<SocketAddr>;
// Required method
fn bind_new_udp_socket(
&self,
bound_addr: SocketAddr,
) -> impl Future<Output = Result<Self::Sock, SocketError>>;
}Expand description
Provides access to UDP sockets.
Required Associated Types§
Sourcetype Sock: Socket<SocketAddr>
type Sock: Socket<SocketAddr>
The type of sockets provided by this UdpSocketProvider.
Required Methods§
Sourcefn bind_new_udp_socket(
&self,
bound_addr: SocketAddr,
) -> impl Future<Output = Result<Self::Sock, SocketError>>
fn bind_new_udp_socket( &self, bound_addr: SocketAddr, ) -> impl Future<Output = Result<Self::Sock, SocketError>>
Gets a UDP socket bound to the given address. The UDP socket should be allowed to send broadcast packets.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.