pub trait ToMultiaddr {
    fn to_multiaddr(&self) -> Result<Multiaddr>;
}
Expand description

A trait for objects which can be converted to a Multiaddr.

This trait is implemented by default for

  • SocketAddr, SocketAddrV4 and SocketAddrV6, assuming that the the given port is a tcp port.

  • Ipv4Addr, Ipv6Addr

  • String and &str, requiring the default string format for a Multiaddr.

Required Methods

Converts this object to a Multiaddr

Errors

Any errors encountered during parsing will be returned as an Err.

Implementations on Foreign Types

Implementors