pub type BlockId = BlockId<Block>;
Expand description
BlockId type as expected by this runtime.
Aliased Type§
enum BlockId {
Hash(H256),
Number(u32),
}
Variants§
Implementations
Source§impl<Block> BlockId<Block>where
Block: Block,
impl<Block> BlockId<Block>where
Block: Block,
Sourcepub const fn hash(hash: <Block as Block>::Hash) -> BlockId<Block>
pub const fn hash(hash: <Block as Block>::Hash) -> BlockId<Block>
Create a block ID from a hash.
Sourcepub const fn number(
number: <<Block as Block>::Header as Header>::Number,
) -> BlockId<Block>
pub const fn number( number: <<Block as Block>::Header as Header>::Number, ) -> BlockId<Block>
Create a block ID from a number.
Sourcepub fn is_pre_genesis(&self) -> bool
pub fn is_pre_genesis(&self) -> bool
Check if this block ID refers to the pre-genesis state.
Sourcepub fn pre_genesis() -> BlockId<Block>
pub fn pre_genesis() -> BlockId<Block>
Create a block ID for a pre-genesis state.
Trait Implementations
Source§impl<Block> Decode for BlockId<Block>
impl<Block> Decode for BlockId<Block>
Source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<BlockId<Block>, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<BlockId<Block>, Error>where
__CodecInputEdqy: Input,
Attempt to deserialise the value from input.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Source§impl<Block> Encode for BlockId<Block>
impl<Block> Encode for BlockId<Block>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more