[][src]Struct posix_socket::SocketAddress

#[repr(C)]pub struct SocketAddress { /* fields omitted */ }

Generic socket address, large enough to hold any valid address.

Implementations

impl SocketAddress[src]

pub fn from_raw(inner: sockaddr_storage, len: socklen_t) -> Self[src]

Create a SocketAddress from a libc::sockaddr_storage and a length.

pub fn from_other<Address: AsSocketAddress>(other: &Address) -> Self[src]

Create a generic SocketAddress by copying data from another address.

pub fn into_raw(self) -> (sockaddr_storage, socklen_t)[src]

Convert the SocketAddress into raw libc parts.

pub fn family(&self) -> c_int[src]

Get the address family.

pub fn as_inet4(&self) -> Option<Inet4SocketAddress>[src]

Get the address as an IPv4 socket address.

Returns None if the address is not an IPv4 socket address.

pub fn as_inet6(&self) -> Option<Inet6SocketAddress>[src]

Get the address as an IPv6 socket address.

Returns None if the address is not an IPv6 socket address.

pub fn as_unix(&self) -> Option<UnixSocketAddress>[src]

Get the address as an unix socket address.

Returns None if the address is not a unix socket address.

Trait Implementations

impl AsSocketAddress for SocketAddress[src]

impl Clone for SocketAddress[src]

impl<'_> From<&'_ Inet4SocketAddress> for SocketAddress[src]

impl<'_> From<&'_ Inet6SocketAddress> for SocketAddress[src]

impl<'_> From<&'_ UnixSocketAddress> for SocketAddress[src]

impl From<Inet4SocketAddress> for SocketAddress[src]

impl From<Inet6SocketAddress> for SocketAddress[src]

impl From<UnixSocketAddress> for SocketAddress[src]

impl GenericSocketAddress for SocketAddress[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.