Skip to main content

BlockIdTo

Trait BlockIdTo 

Source
pub trait BlockIdTo<Block>
where Block: Block,
{ type Error: Error; // Required methods fn to_hash( &self, block_id: &BlockId<Block>, ) -> Result<Option<<Block as Block>::Hash>, Self::Error>; fn to_number( &self, block_id: &BlockId<Block>, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Self::Error>; }
Expand description

Something that can convert a BlockId to a number or a hash.

Required Associated Types§

Source

type Error: Error

The error type that will be returned by the functions.

Required Methods§

Source

fn to_hash( &self, block_id: &BlockId<Block>, ) -> Result<Option<<Block as Block>::Hash>, Self::Error>

Convert the given block_id to the corresponding block hash.

Source

fn to_number( &self, block_id: &BlockId<Block>, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Self::Error>

Convert the given block_id to the corresponding block number.

Implementors§