Trait cap_net_ext::UdpSocketExt
source · pub trait UdpSocketExt: Sealed + Sized {
// Required method
fn new(address_family: AddressFamily, blocking: Blocking) -> Result<Self>;
}
Expand description
A trait for extending UdpSocket
types.
Required Methods§
sourcefn new(address_family: AddressFamily, blocking: Blocking) -> Result<Self>
fn new(address_family: AddressFamily, blocking: Blocking) -> Result<Self>
Creates a new UdpSocket
with the given address family.
The created socket is initially not bound or connected to any address.
Use PoolExt::bind_existing_udp_socket
to bind it, or
PoolExt::connect_existing_udp_socket
to initiate a connection.
This is similar to Pool::bind_udp_socket
in that it creates a UDP
socket, however it does not perform the bind
. And, it has a
blocking
argument to select blocking or non-blocking mode for the
created socket.
And it’s similar to Pool::connect_udp_socket
in that it creates a
UDP socket, however it does not perform the connect
step. And, it has
a blocking
argument to select blocking or non-blocking mode for the
created socket.
Object Safety§
This trait is not object safe.