pub trait IntoListenAddr {
// Required method
fn into_listen_addr(self) -> Result<SocketAddr, Error>;
}Expand description
Conversion into a single TCP bind address.
Implemented for the address-shaped inputs — a bare port (binds 0.0.0.0:port), a SocketAddr
or its v4/v6 forms, and (ip, port) tuples — all of which are infallible, and for the string
and (host, port) forms, which are resolved through the system resolver and so can fail or
yield no address. A resolving form binds the first address it resolves to; pass a
SocketAddr when you need to pin exactly which one.
Required Methods§
Sourcefn into_listen_addr(self) -> Result<SocketAddr, Error>
fn into_listen_addr(self) -> Result<SocketAddr, Error>
Resolve to the concrete socket address to bind, surfacing a resolution failure as an
io::Error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".