Type Alias sc_consensus::import_queue::RuntimeOrigin

source ·
pub type RuntimeOrigin = PeerId;
Expand description

Maps to the RuntimeOrigin used by the network.

Aliased Type§

struct RuntimeOrigin { /* private fields */ }

Implementations

source§

impl PeerId

source

pub fn random() -> PeerId

Generate random peer ID.

source

pub fn try_from_multiaddr(address: &Multiaddr) -> Option<PeerId>

Try to extract PeerId from Multiaddr.

source

pub fn from_multihash(multihash: Multihash) -> Result<PeerId, Multihash>

Tries to turn a Multihash into a PeerId.

If the multihash does not use a valid hashing algorithm for peer IDs, or the hash value does not satisfy the constraints for a hashed peer ID, it is returned as an Err.

source

pub fn from_bytes(data: &[u8]) -> Result<PeerId, Error>

Parses a PeerId from bytes.

source

pub fn to_bytes(&self) -> Vec<u8>

Returns a raw bytes representation of this PeerId.

source

pub fn to_base58(&self) -> String

Returns a base-58 encoded string of this PeerId.

source

pub fn into_ed25519(&self) -> Option<[u8; 32]>

Convert PeerId into ed25519 public key bytes.

source

pub fn from_ed25519(bytes: &[u8; 32]) -> Option<PeerId>

Get PeerId from ed25519 public key bytes.

Trait Implementations

source§

impl AsRef<Multihash> for PeerId

source§

fn as_ref(&self) -> &Multihash

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for PeerId

source§

fn clone(&self) -> PeerId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeerId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for PeerId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<&PeerId> for PeerId

source§

fn from(peer_id: &PeerId) -> PeerId

Converts to this type from the input type.
source§

impl From<&PeerId> for PeerId

source§

fn from(peer_id: &PeerId) -> PeerId

Converts to this type from the input type.
source§

impl From<PeerId> for PeerId

source§

fn from(peer_id: PeerId) -> PeerId

Converts to this type from the input type.
source§

impl From<PeerId> for PeerId

source§

fn from(peer_id: PeerId) -> PeerId

Converts to this type from the input type.
source§

impl FromStr for PeerId

§

type Err = ParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<PeerId, <PeerId as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for PeerId

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PeerId

source§

fn cmp(&self, other: &PeerId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PeerId

source§

fn eq(&self, other: &PeerId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PeerId

source§

fn partial_cmp(&self, other: &PeerId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for PeerId

source§

impl Eq for PeerId

source§

impl StructuralPartialEq for PeerId