Struct ckb_network::PeerId [−]
pub struct PeerId { /* fields omitted */ }Expand description
Identifier of a peer of the network
The data is a hash of the public key of the peer
Implementations
impl PeerId
impl PeerId
pub fn from_public_key(public_key: &PublicKey) -> PeerId
pub fn from_public_key(public_key: &PublicKey) -> PeerId
Builds a PeerId from a public key.
If data is a valid PeerId, return PeerId, else return error
pub fn into_bytes(self) -> Vec<u8, Global>
pub fn into_bytes(self) -> Vec<u8, Global>
Consume self, return raw bytes representation of this peer id
pub fn is_public_key(&self, public_key: &PublicKey) -> bool
pub fn is_public_key(&self, public_key: &PublicKey) -> bool
Checks whether the public key passed as parameter matches the public key of this PeerId.
Trait Implementations
impl PartialOrd<PeerId> for PeerId
impl PartialOrd<PeerId> for PeerId
pub fn partial_cmp(&self, other: &PeerId) -> Option<Ordering>
pub fn partial_cmp(&self, other: &PeerId) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
impl StructuralEq for PeerId
impl StructuralPartialEq for PeerId
Auto Trait Implementations
impl RefUnwindSafe for PeerId
impl UnwindSafe for PeerId
Blanket Implementations
Mutably borrows from an owned value. Read more