Struct socket2::SockAddr [] [src]

pub struct SockAddr { /* fields omitted */ }

The address of a socket.

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

Methods

impl SockAddr
[src]

[src]

Constructs a SockAddr from its raw components.

[src]

Constructs a SockAddr with the family AF_UNIX and the provided path.

This function is only available on Unix when the unix feature is enabled.

Failure

Returns an error if the path is longer than SUN_LEN.

[src]

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

[src]

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

[src]

Returns this address's family.

[src]

Returns the size of this address in bytes.

[src]

Returns a raw pointer to the address.

Trait Implementations

impl Debug for SockAddr
[src]

[src]

Formats the value using the given formatter. Read more

impl From<SocketAddrV4> for SockAddr
[src]

[src]

Performs the conversion.

impl From<SocketAddrV6> for SockAddr
[src]

[src]

Performs the conversion.

impl From<SocketAddr> for SockAddr
[src]

[src]

Performs the conversion.

Auto Trait Implementations

impl Send for SockAddr

impl Sync for SockAddr