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

The address of a socket.

SockAddrs may be constructed directly to and from the standard library SocketAddr, SocketAddrV4, and SocketAddrV6 types.

Implementations

Constructs a SockAddr from its raw components.

Returns this address as a SocketAddrV4 if it is in the AF_INET family.

Returns this address as a SocketAddrV6 if it is in the AF_INET6 family.

Returns this address as a SocketAddr if it is in the AF_INET or AF_INET6 family, otherwise returns None.

Returns this address’s family.

Returns the size of this address in bytes.

Returns a raw pointer to the address.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

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.