Trait message_io::network::ToRemoteAddr
source · pub trait ToRemoteAddr {
// Required method
fn to_remote_addr(&self) -> Result<RemoteAddr>;
}
Expand description
Similar to ToSocketAddrs
but for a RemoteAddr
.
Instead of ToSocketAddrs
that only can accept valid ‘ip:port’ string format,
ToRemoteAddr
accept any string without panic.
If the string has the ‘ip:port’ format, it will be interpreted as a SocketAddr
,
if not, it will be interpreted as a string.