#[non_exhaustive]pub enum Endpoint {
Ip(SocketAddr),
Unix(Arc<UnixPath>),
Pipe(Arc<PipeName>),
Unnamed,
}Expand description
One end of a connection.
let end = net_io::Endpoint::Ip("127.0.0.1:80".parse().unwrap());
assert_eq!(end.socket_addr().unwrap().port(), 80);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ip(SocketAddr)
An IP socket address.
Unix(Arc<UnixPath>)
A Unix socket path (shared with the listener that owns it).
Pipe(Arc<PipeName>)
A Windows pipe name (shared with the listener that owns it).
Unnamed
An unnamed Unix socket peer.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn socket_addr(&self) -> Option<SocketAddr>
pub fn socket_addr(&self) -> Option<SocketAddr>
The socket address, for IP endpoints.
Trait Implementations§
Source§impl Display for Endpoint
The address as text: 127.0.0.1:80, a Unix path, a pipe name, or unnamed.
impl Display for Endpoint
The address as text: 127.0.0.1:80, a Unix path, a pipe name, or unnamed.
let e = net_io::Endpoint::Ip("127.0.0.1:80".parse().unwrap());
assert_eq!(e.to_string(), "127.0.0.1:80");impl Eq for Endpoint
impl StructuralPartialEq for Endpoint
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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