pub struct DtactUnixSocketAddr(/* private fields */);Expand description
A Unix-domain-socket peer address as reported by recvfrom(2).
Either the filesystem path the peer bind()-ed to, or unnamed (a
socket that never called bind() before sendto(), the common
client-side case).
Not std::os::unix::net::SocketAddr: that type has no public
constructor from raw sockaddr_un bytes (only from a live syscall
result, e.g. UnixListener::accept’s own internal plumbing), and
recvfrom’s peer address has to come from the kernel-filled
msghdr::msg_name of the completed op — there’s no separate syscall
this crate could use to fetch a std-constructed one instead the way
DtactUnixListener::accept does via UnixStream::peer_addr.
Implementations§
Source§impl DtactUnixSocketAddr
impl DtactUnixSocketAddr
Sourcepub fn as_pathname(&self) -> Option<&Path>
pub fn as_pathname(&self) -> Option<&Path>
The path the peer was bound to, if any.
Sourcepub const fn is_unnamed(&self) -> bool
pub const fn is_unnamed(&self) -> bool
true if the peer never bind()-ed before sending (the common
case for a datagram socket that only ever calls send_to).
Trait Implementations§
Source§impl Clone for DtactUnixSocketAddr
impl Clone for DtactUnixSocketAddr
Source§fn clone(&self) -> DtactUnixSocketAddr
fn clone(&self) -> DtactUnixSocketAddr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more