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
impl NumHash
pub const fn new(number: u64, hash: FixedBytes<32>) -> 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>)
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
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
impl<'arbitrary> Arbitrary<'arbitrary> for NumHash
§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<NumHash, Error>
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>
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>)
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>
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<'de> Deserialize<'de> for NumHash
impl<'de> Deserialize<'de> for NumHash
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NumHash, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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
impl From<(FixedBytes<32>, u64)> for NumHash
§fn from(val: (FixedBytes<32>, u64)) -> NumHash
fn from(val: (FixedBytes<32>, u64)) -> NumHash
Converts to this type from the input type.
§impl From<(u64, FixedBytes<32>)> for NumHash
impl From<(u64, FixedBytes<32>)> for NumHash
§fn from(val: (u64, FixedBytes<32>)) -> NumHash
fn from(val: (u64, FixedBytes<32>)) -> NumHash
Converts to this type from the input type.
§impl Serialize for NumHash
impl Serialize for NumHash
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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