pub trait UdpSocketProvider {
type Sock: Socket<SocketAddr>;
// Required method
async fn bind_new_udp_socket(
&self,
bound_addr: SocketAddr,
) -> 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§
Sourceasync fn bind_new_udp_socket(
&self,
bound_addr: SocketAddr,
) -> Result<Self::Sock, SocketError>
async fn bind_new_udp_socket( &self, bound_addr: SocketAddr, ) -> 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.