[][src]Macro parity_multiaddr::multiaddr

macro_rules! multiaddr {
    ($($comp:ident $(($param:expr))*),+) => { ... };
}

Easy way for a user to create a Multiaddr.

Example:

let _addr = 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 casted into the proper type with the Into trait.

For example, Ip4([127, 0, 0, 1]) works because Ipv4Addr implements From<[u8; 4]>.