pub trait PeerIdentity:
Hash
+ Eq
+ Copy
+ Debug
+ Serialize
+ DeserializeOwned { }
Expand description
The identifier for a peer.
The protocol implementation is generic over this trait. When implementing the protocol, a concrete type must be chosen that will then be used throughout the implementation to identify and index individual peers.
Note that the concrete type will be used in protocol messages. Therefore, implementations of the protocol are only compatible if the same concrete type is supplied for this trait.
TODO: Rename to PeerId
? It does not necessarily refer to a peer’s address, as long as the
networking layer can translate the value of its concrete type into an address.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.