Type Alias ForkBlock

pub type ForkBlock = NumHash;
Expand description

Block number and hash of the forked block.

Aliased Type§

struct ForkBlock {
    pub number: u64,
    pub hash: FixedBytes<32>,
}

Fields§

§number: u64

The number

§hash: FixedBytes<32>

The hash.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 40 bytes

Implementations

§

impl NumHash

pub const fn new(number: u64, hash: FixedBytes<32>) -> NumHash

Creates a new NumHash from a number and hash.

pub const fn into_components(self) -> (u64, FixedBytes<32>)

Consumes Self and returns the number and hash

pub fn matches_block_or_num(&self, block: &HashOrNumber) -> bool

Returns whether or not the block matches the given HashOrNumber.

Trait Implementations

§

impl<'arbitrary> Arbitrary<'arbitrary> for NumHash

§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<NumHash, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<NumHash, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

impl Clone for NumHash

§

fn clone(&self) -> NumHash

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
§

impl Debug for NumHash

§

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

Formats the value using the given formatter. Read more
§

impl Default for NumHash

§

fn default() -> NumHash

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for NumHash

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<NumHash, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl From<(FixedBytes<32>, u64)> for NumHash

§

fn from(val: (FixedBytes<32>, u64)) -> NumHash

Converts to this type from the input type.
§

impl From<(u64, FixedBytes<32>)> for NumHash

§

fn from(val: (u64, FixedBytes<32>)) -> NumHash

Converts to this type from the input type.
§

impl From<ChainInfo> for NumHash

§

fn from(value: ChainInfo) -> NumHash

Converts to this type from the input type.
§

impl Hash for NumHash

§

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
§

impl PartialEq for NumHash

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Serialize for NumHash

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Copy for NumHash

§

impl Eq for NumHash

§

impl StructuralPartialEq for NumHash