#[repr(C)]pub struct UnixSocketAddress { /* private fields */ }
Expand description
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§
Source§impl UnixSocketAddress
impl UnixSocketAddress
Sourcepub fn new_unnamed() -> Self
pub fn new_unnamed() -> Self
Create a new unnamed unix socket address.
Sourcepub fn from_raw(inner: sockaddr_un, len: socklen_t) -> Self
pub fn from_raw(inner: sockaddr_un, len: socklen_t) -> Self
Create a Unix socket address from a libc::sockaddr_un
and a length.
Sourcepub fn into_raw(self) -> (sockaddr_un, socklen_t)
pub fn into_raw(self) -> (sockaddr_un, socklen_t)
Convert the [SocketAddress
] into raw libc
parts.
Sourcepub fn as_path(&self) -> Option<&Path>
pub fn as_path(&self) -> Option<&Path>
Get the path associated with the socket address, if there is one.
Returns None
if the socket address is unnamed or abstract,
Sourcepub fn is_unnamed(&self) -> bool
pub fn is_unnamed(&self) -> bool
Check if the address is unnamed.
Sourcepub fn as_abstract(&self) -> Option<&CStr>
pub fn as_abstract(&self) -> Option<&CStr>
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§
Source§impl AsSocketAddress for UnixSocketAddress
impl AsSocketAddress for UnixSocketAddress
Source§fn as_sockaddr_mut(address: &mut MaybeUninit<Self>) -> *mut sockaddr
fn as_sockaddr_mut(address: &mut MaybeUninit<Self>) -> *mut sockaddr
Get a mutable pointer to the socket address. Read more
Source§fn finalize(address: MaybeUninit<Self>, len: socklen_t) -> Result<Self>
fn finalize(address: MaybeUninit<Self>, len: socklen_t) -> Result<Self>
Finalize a socket address that has been written into by the kernel. Read more
Source§fn family(&self) -> sa_family_t
fn family(&self) -> sa_family_t
Get the address family of the socket address.
Source§impl Clone for UnixSocketAddress
impl Clone for UnixSocketAddress
Source§fn clone(&self) -> UnixSocketAddress
fn clone(&self) -> UnixSocketAddress
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl From<&SocketAddr> for UnixSocketAddress
impl From<&SocketAddr> for UnixSocketAddress
Source§fn from(other: &SocketAddr) -> Self
fn from(other: &SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<&UnixSocketAddress> for SocketAddress
impl From<&UnixSocketAddress> for SocketAddress
Source§fn from(other: &UnixSocketAddress) -> Self
fn from(other: &UnixSocketAddress) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for UnixSocketAddress
impl From<SocketAddr> for UnixSocketAddress
Source§fn from(other: SocketAddr) -> Self
fn from(other: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<UnixSocketAddress> for SocketAddress
impl From<UnixSocketAddress> for SocketAddress
Source§fn from(other: UnixSocketAddress) -> Self
fn from(other: UnixSocketAddress) -> Self
Converts to this type from the input type.
Source§impl SpecificSocketAddress for UnixSocketAddress
impl SpecificSocketAddress for UnixSocketAddress
Source§fn static_family() -> sa_family_t
fn static_family() -> sa_family_t
The address family supported by this socket address.
Auto Trait Implementations§
impl Freeze for UnixSocketAddress
impl RefUnwindSafe for UnixSocketAddress
impl Send for UnixSocketAddress
impl Sync for UnixSocketAddress
impl Unpin for UnixSocketAddress
impl UnwindSafe for UnixSocketAddress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more