#[repr(C)]pub struct UnixAddr { /* private fields */ }
Available on crate feature
socket
only.Expand description
A wrapper around sockaddr_un
.
Implementations§
source§impl UnixAddr
impl UnixAddr
sourcepub fn new<P: ?Sized + NixPath>(path: &P) -> Result<UnixAddr>
pub fn new<P: ?Sized + NixPath>(path: &P) -> Result<UnixAddr>
Create a new sockaddr_un representing a filesystem path.
sourcepub fn path(&self) -> Option<&Path>
pub fn path(&self) -> Option<&Path>
If this address represents a filesystem path, return that path.
sourcepub fn path_len(&self) -> usize
pub fn path_len(&self) -> usize
Returns the addrlen of this socket - offsetof(struct sockaddr_un, sun_path)
sourcepub fn as_ptr(&self) -> *const sockaddr_un
pub fn as_ptr(&self) -> *const sockaddr_un
Returns a pointer to the raw sockaddr_un
struct
sourcepub fn as_mut_ptr(&mut self) -> *mut sockaddr_un
pub fn as_mut_ptr(&mut self) -> *mut sockaddr_un
Returns a mutable pointer to the raw sockaddr_un
struct
Trait Implementations§
source§impl AsRef<sockaddr_un> for UnixAddr
impl AsRef<sockaddr_un> for UnixAddr
source§fn as_ref(&self) -> &sockaddr_un
fn as_ref(&self) -> &sockaddr_un
Converts this type into a shared reference of the (usually inferred) input type.