pub struct SocketAddrUnix { /* private fields */ }
Expand description
struct sockaddr_un
Implementations§
Source§impl SocketAddrUnix
impl SocketAddrUnix
Sourcepub fn new<P: Arg>(path: P) -> Result<Self>
pub fn new<P: Arg>(path: P) -> Result<Self>
Construct a new Unix-domain address from a filesystem path.
Sourcepub fn new_abstract_name(name: &[u8]) -> Result<Self>
pub fn new_abstract_name(name: &[u8]) -> Result<Self>
Construct a new abstract Unix-domain address from a byte slice.
Sourcepub fn new_unnamed() -> Self
pub fn new_unnamed() -> Self
Construct a new unnamed address.
The kernel will assign an abstract Unix-domain address to the socket
when you call bind
. You can inspect the assigned
name with getsockname
.
§References
Sourcepub fn path_bytes(&self) -> Option<&[u8]>
pub fn path_bytes(&self) -> Option<&[u8]>
For a filesystem path address, return the path as a byte sequence, excluding the NUL terminator.
Sourcepub fn abstract_name(&self) -> Option<&[u8]>
pub fn abstract_name(&self) -> Option<&[u8]>
For an abstract address, return the identifier.
Sourcepub fn is_unnamed(&self) -> bool
pub fn is_unnamed(&self) -> bool
true
if the socket address is unnamed.
Trait Implementations§
Source§impl Clone for SocketAddrUnix
impl Clone for SocketAddrUnix
Source§fn clone(&self) -> SocketAddrUnix
fn clone(&self) -> SocketAddrUnix
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 Debug for SocketAddrUnix
impl Debug for SocketAddrUnix
Source§impl From<SocketAddrUnix> for SocketAddrAny
impl From<SocketAddrUnix> for SocketAddrAny
Source§fn from(from: SocketAddrUnix) -> Self
fn from(from: SocketAddrUnix) -> Self
Converts to this type from the input type.
Source§impl Hash for SocketAddrUnix
impl Hash for SocketAddrUnix
Source§impl Ord for SocketAddrUnix
impl Ord for SocketAddrUnix
Source§impl PartialEq for SocketAddrUnix
impl PartialEq for SocketAddrUnix
Source§impl PartialOrd for SocketAddrUnix
impl PartialOrd for SocketAddrUnix
Source§impl SocketAddrArg for SocketAddrUnix
impl SocketAddrArg for SocketAddrUnix
Source§unsafe fn with_sockaddr<R>(
&self,
f: impl FnOnce(*const SocketAddrOpaque, SocketAddrLen) -> R,
) -> R
unsafe fn with_sockaddr<R>( &self, f: impl FnOnce(*const SocketAddrOpaque, SocketAddrLen) -> R, ) -> R
Call a closure with the pointer and length to the corresponding C type. Read more
Source§fn as_any(&self) -> SocketAddrAny
fn as_any(&self) -> SocketAddrAny
Convert to
SocketAddrAny
.Source§unsafe fn write_sockaddr(
&self,
storage: *mut SocketAddrStorage,
) -> SocketAddrLen
unsafe fn write_sockaddr( &self, storage: *mut SocketAddrStorage, ) -> SocketAddrLen
Encode an address into a
SocketAddrStorage
. Read moreSource§impl TryFrom<SocketAddrAny> for SocketAddrUnix
impl TryFrom<SocketAddrAny> for SocketAddrUnix
impl Eq for SocketAddrUnix
Auto Trait Implementations§
impl Freeze for SocketAddrUnix
impl RefUnwindSafe for SocketAddrUnix
impl Send for SocketAddrUnix
impl Sync for SocketAddrUnix
impl Unpin for SocketAddrUnix
impl UnwindSafe for SocketAddrUnix
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