Trait ToSocketAddr

Source
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§

Implementations on Foreign Types§

Source§

impl ToSocketAddr for SocketAddr

Source§

impl ToSocketAddr for SocketAddrV4

Source§

impl ToSocketAddr for SocketAddrV6

Implementors§

Source§

impl ToSocketAddr for NetAddr<IpAddr>

Source§

impl ToSocketAddr for NetAddr<Ipv4Addr>

Source§

impl ToSocketAddr for NetAddr<Ipv6Addr>

Source§

impl<Id: EcPk, A: Addr + ToSocketAddr> ToSocketAddr for PeerAddr<Id, A>

Available on crate features p2p-ed25519 or p2p-secp256k1 only.