[][src]Struct posix_socket::UnixSocketAddress

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

Unix socket address.

A Unix socket address can be unnamed or a filesystem path. On Linux it can also be an abstract socket path, although this is not portable.

Implementations

impl UnixSocketAddress[src]

pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Create a Unix socket address from a path.

pub fn new_unnamed() -> Self[src]

Create a new unnamed unix socket address.

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

Create a Unix socket address from a libc::sockaddr_un and a length.

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

Convert the [SocketAddress] into raw libc parts.

pub fn as_path(&self) -> Option<&Path>[src]

Get the path associated with the socket address, if there is one.

Returns None if the socket address is unnamed or abstract,

pub fn is_unnamed(&self) -> bool[src]

Check if the address is unnamed.

pub fn as_abstract(&self) -> Option<&CStr>[src]

Get the abstract path associated with the socket address.

Returns None if the socket address is not abstract.

Abstract Unix socket addresses are a non-portable Linux extension.

Trait Implementations

impl AsSocketAddress for UnixSocketAddress[src]

impl Clone for UnixSocketAddress[src]

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

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

impl From<SocketAddr> for UnixSocketAddress[src]

impl From<UnixSocketAddress> for SocketAddress[src]

impl SpecificSocketAddress for UnixSocketAddress[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.