#[repr(C)]pub struct UnixAddr { /* private fields */ }
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.
Source§impl SockaddrLike for UnixAddr
impl SockaddrLike for UnixAddr
Source§fn len(&self) -> socklen_t
fn len(&self) -> socklen_t
Return the length of valid data in the sockaddr structure. Read more
Source§unsafe fn from_raw(
addr: *const sockaddr,
len: Option<socklen_t>,
) -> Option<Self>where
Self: Sized,
unsafe fn from_raw(
addr: *const sockaddr,
len: Option<socklen_t>,
) -> Option<Self>where
Self: Sized,
Unsafe constructor from a variable length source Read more
impl Copy for UnixAddr
impl Eq for UnixAddr
Auto Trait Implementations§
impl Freeze for UnixAddr
impl RefUnwindSafe for UnixAddr
impl Send for UnixAddr
impl Sync for UnixAddr
impl Unpin for UnixAddr
impl UnwindSafe for UnixAddr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)