pub trait ToSocketAddr {
// Required method
fn to_socket_addr(&self) -> SocketAddr;
}Expand description
Trait for the types which are able to return socket address to connect to. NBL In case of a proxied addresses this should be an address of the proxy, not the destination host.
The trait is required since the socket address has to be constructed from a type reference without cloning.
Required Methods§
fn to_socket_addr(&self) -> SocketAddr
Implementations on Foreign Types§
Source§impl ToSocketAddr for SocketAddr
impl ToSocketAddr for SocketAddr
fn to_socket_addr(&self) -> SocketAddr
Source§impl ToSocketAddr for SocketAddrV4
impl ToSocketAddr for SocketAddrV4
fn to_socket_addr(&self) -> SocketAddr
Source§impl ToSocketAddr for SocketAddrV6
impl ToSocketAddr for SocketAddrV6
fn to_socket_addr(&self) -> SocketAddr
Implementors§
impl ToSocketAddr for NetAddr<IpAddr>
impl ToSocketAddr for NetAddr<Ipv4Addr>
impl ToSocketAddr for NetAddr<Ipv6Addr>
impl<Id: EcPk, A: Addr + ToSocketAddr> ToSocketAddr for PeerAddr<Id, A>
Available on crate features
p2p-ed25519 or p2p-secp256k1 only.