pub enum PeerAddr {
Tcp(SocketAddr),
Unix(Option<PathBuf>),
}
Expand description
A peer address for either Tcp or Unix socket
This enum is returned by
ByteStream::peer_addr
.
The enum contains Unix
option even on platforms that don’t support
unix sockets (Windows) to make code easier to write (less #[cfg(unix)]
attributes all over the code).
Variants§
Tcp(SocketAddr)
The peer address is TCP socket address.
Unix(Option<PathBuf>)
The peer address is Unix socket path. None
if socket is unnamed.
Trait Implementations§
impl Eq for PeerAddr
impl StructuralPartialEq for PeerAddr
Auto Trait Implementations§
impl Freeze for PeerAddr
impl RefUnwindSafe for PeerAddr
impl Send for PeerAddr
impl Sync for PeerAddr
impl Unpin for PeerAddr
impl UnwindSafe for PeerAddr
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