pub type HeaderId = Hash;

Aliased Type§

struct HeaderId {
    hash: Blake2b256,
}

Fields§

§hash: Blake2b256

Implementations§

source§

impl Hash

source

pub fn new(hash: Blake2b256) -> Self

source

pub fn get_hash(&self) -> &Blake2b256

source

pub fn zero_hash() -> Self

All 0 hash used as a special hash

source

pub fn hash_bytes(bytes: &[u8]) -> Self

source

pub fn from_bytes(bytes: [u8; 32]) -> Self

source

pub fn as_bytes(&self) -> &[u8]

Trait Implementations§

source§

impl Arbitrary for Hash

source§

fn arbitrary<G: Gen>(g: &mut G) -> Self

§

fn shrink(&self) -> Box<dyn Iterator<Item = Self>, Global>

source§

impl Arbitrary for Hash

§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = BoxedStrategy<Hash>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl AsRef<[u8]> for Hash

source§

fn as_ref(&self) -> &[u8]

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

impl BlockId for Hash

source§

fn zero() -> Hash

A special ID used to denote a non-existent block (e.g. the parent of the first block).
source§

impl Clone for Hash

source§

fn clone(&self) -> Hash

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 Hash

source§

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

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

impl Deserialize for Hash

source§

fn deserialize<R: Read>(codec: &mut Codec<R>) -> Result<Self, ReadError>

§

fn deserialize_validate<R>(codec: &mut Codec<R>) -> Result<(), ReadError>where R: Read,

source§

impl Display for Hash

source§

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

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

impl From<[u8; 32]> for Hash

source§

fn from(a: [u8; 32]) -> Self

Converts to this type from the input type.
source§

impl From<Blake2b256> for Hash

source§

fn from(hash: Blake2b256) -> Self

Converts to this type from the input type.
source§

impl FromStr for Hash

§

type Err = Error

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

fn from_str(s: &str) -> Result<Self, Self::Err>

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

impl Hash for Hash

source§

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

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 Hash

source§

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

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

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

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

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

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

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

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

impl PartialEq<Hash> for Hash

source§

fn eq(&self, other: &Hash) -> 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<Hash> for Hash

source§

fn partial_cmp(&self, other: &Hash) -> 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 Serialize for Hash

source§

fn serialized_size(&self) -> usize

Default implementation, not efficient, not recommended to use it
source§

fn serialize<W: Write>(&self, codec: &mut Codec<W>) -> Result<(), WriteError>

§

fn serialize_as_vec(&self) -> Result<Vec<u8, Global>, WriteError>

Convenience method to serialize into a byte vector.
source§

impl Copy for Hash

source§

impl Eq for Hash

source§

impl FragmentId for Hash

source§

impl StructuralEq for Hash

source§

impl StructuralPartialEq for Hash