Struct nix::sys::socket::UnixAddr
pub struct UnixAddr { /* fields hidden */ }
Documentation
A wrapper around sockaddr_un
.
Implementations
impl UnixAddr
pub fn new_abstract(path: &[u8]) -> Result<UnixAddr>
Create a new sockaddr_un
representing an address in the “abstract namespace”.
The leading null byte for the abstract namespace is automatically added;
thus the input path
is expected to be the bare name, not null-prefixed.
This is a Linux-specific extension, primarily used to allow chrooted
processes to communicate with processes having a different filesystem view.
pub fn as_abstract(&Self) -> Option<&[u8]>
If this address represents an abstract socket, return its name.
For abstract sockets only the bare name is returned, without the
leading null byte. None
is returned for unnamed or path-backed sockets.
pub fn path_len(&Self) -> usize
Returns the addrlen of this socket - offsetof(struct sockaddr_un, sun_path)
pub fn as_ptr(&Self) -> *const libc::sockaddr_un
Returns a pointer to the raw sockaddr_un
struct
pub fn as_mut_ptr(&mut Self) -> *mut libc::sockaddr_un
Returns a mutable pointer to the raw sockaddr_un
struct
Trait Implementations
impl Debug for UnixAddr
fn fmt(&Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Display for UnixAddr
fn fmt(&Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
Auto Trait Implementations
impl RefUnwindSafe for UnixAddr
impl UnwindSafe for UnixAddr
Blanket Implementations
impl<T> BorrowMut<T> for T
where
T: ?Sized,
where
T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T