Closed tomaka closed 6 years ago
This PR is an upstream of the local changes we've been making as part of https://github.com/libp2p/rust-libp2p/tree/master/rust-multiaddr
All these changes have already been reviewed. If nobody expresses opposition, I will merge in a few days.
Based over #27
Right now if you want to examine the content of the
Multiaddr
, you have to callas_bytes()
and examine bytes one by one and making the assumptions that they are going to be in a certain format.This PR does many minor changes to the library, and most notably adds the
AddrComponent
type which represents one segment of a multiaddr in a strongly-typed fashion. The components can be enumerated withMultiaddr::iter()
. Because of this large change, parsing has also been reworked.