pub struct UdpBuilder { /* private fields */ }
Expand description

An “in progress” UDP socket which has not yet been connected.

Allows configuration of a socket before the socket is connected.

Implementations

Constructs a new UdpBuilder with the AF_INET domain, the SOCK_DGRAM type, and with a protocol argument of 0.

Note that passing other kinds of flags or arguments can be done through the FromRaw{Fd,Socket} implementation.

Constructs a new UdpBuilder with the AF_INET6 domain, the SOCK_DGRAM type, and with a protocol argument of 0.

Note that passing other kinds of flags or arguments can be done through the FromRaw{Fd,Socket} implementation.

Binds this socket to the specified address.

This function directly corresponds to the bind(2) function on Windows and Unix.

Sets the value for the IP_TTL option on this socket.

This is the same as TcpStreamExt::set_ttl.

Sets the value for the IPV6_V6ONLY option on this socket.

This is the same as TcpStream::only_v6.

Set value for the SO_REUSEADDR option on this socket.

This is the same as TcpBuilder::reuse_address.

Check the SO_REUSEADDR option on this socket.

Get the value of the SO_ERROR option on this socket.

This will retrieve the stored error in the underlying socket, clearing the field in the process. This can be useful for checking errors between calls.

Trait Implementations

Extracts the raw socket. Read more
Formats the value using the given formatter. Read more
Constructs a new I/O object from the specified raw socket. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.