macro_rules! build_multiaddr { ($($comp:ident $(($param:expr))*),+) => { ... }; }
Expand description
Easy way for a user to create a Multiaddr
.
Example:
use sc_network_types::build_multiaddr;
let addr = build_multiaddr!(Ip4([127, 0, 0, 1]), Tcp(10500u16));
Each element passed to multiaddr!
should be a variant of the Protocol
enum. The
optional parameter is turned into the proper type with the Into
trait.
For example, Ip4([127, 0, 0, 1])
works because Ipv4Addr
implements From<[u8; 4]>
.