Struct SockaddrUn

Source
#[repr(C)]
pub struct SockaddrUn { /* private fields */ }

Implementations§

Source§

impl SockaddrUn

Source

pub fn path(&self) -> &[u8]

Source

pub unsafe fn from_raw_parts<'a>(addr: *const sockaddr, len: usize) -> &'a Self

Create a SockaddrUn reference from a sockaddr_un pointer and a size.

§Safety

The sockaddr_un pointer must point to a valid sockaddr_un, and len must be less than or equal to the size of the underlying sockaddr object.

Methods from Deref<Target = Sockaddr>§

Source

pub fn family(&self) -> sa_family_t

Source

pub fn len(&self) -> usize

Return the size, in bytes, of the pointed-to Sockaddr. This byte count includes the leading two bytes used to store the address family.

Source

pub fn as_parts(&self) -> (&sockaddr, socklen_t)

Return a reference to the underlying sockaddr and the length. This is useful for calling underlying libc functions that take a constant sockaddr. For libc functions that take mutable sockaddrs, see SockaddrStorage::as_mut_parts.

Source

pub fn as_sockaddr_un(&self) -> Option<&SockaddrUn>

Trait Implementations§

Source§

impl Deref for SockaddrUn

Source§

type Target = Sockaddr

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.