[−][src]Struct posix_socket::UnixSocketAddress
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]
fn as_sockaddr(&self) -> *const sockaddr
[src]
fn as_sockaddr_mut(address: &mut MaybeUninit<Self>) -> *mut sockaddr
[src]
fn len(&self) -> socklen_t
[src]
fn finalize(address: MaybeUninit<Self>, len: socklen_t) -> Result<Self>
[src]
fn max_len() -> socklen_t
[src]
fn family(&self) -> sa_family_t
[src]
impl Clone for UnixSocketAddress
[src]
fn clone(&self) -> UnixSocketAddress
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_> From<&'_ SocketAddr> for UnixSocketAddress
[src]
fn from(other: &SocketAddr) -> Self
[src]
impl<'_> From<&'_ UnixSocketAddress> for SocketAddress
[src]
fn from(other: &UnixSocketAddress) -> Self
[src]
impl From<SocketAddr> for UnixSocketAddress
[src]
fn from(other: SocketAddr) -> Self
[src]
impl From<UnixSocketAddress> for SocketAddress
[src]
fn from(other: UnixSocketAddress) -> Self
[src]
impl SpecificSocketAddress for UnixSocketAddress
[src]
fn static_family() -> sa_family_t
[src]
Auto Trait Implementations
impl RefUnwindSafe for UnixSocketAddress
impl Send for UnixSocketAddress
impl Sync for UnixSocketAddress
impl Unpin for UnixSocketAddress
impl UnwindSafe for UnixSocketAddress
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,