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 PeerIdpub fn from_public_key(public_key: &PublicKey) -> PeerId
pub fn from_public_key(public_key: &PublicKey) -> PeerIdBuilds a PeerId from a public key.
pub fn from_bytes(data: Vec<u8, Global>) -> Result<PeerId, ()>
pub fn from_bytes(data: Vec<u8, Global>) -> Result<PeerId, ()>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) -> boolChecks 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 PeerIdpub 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
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Eq for PeerId
impl StructuralEq for PeerId
impl StructuralPartialEq for PeerId
Auto Trait Implementations
impl RefUnwindSafe for PeerId
impl Send for PeerId
impl Sync for PeerId
impl Unpin for PeerId
impl UnwindSafe for PeerId
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,