Trait polkadot_service::HeaderMetadata

source ·
pub trait HeaderMetadata<Block>
where Block: Block,
{ type Error: Error; // Required methods fn header_metadata( &self, hash: <Block as Block>::Hash, ) -> Result<CachedHeaderMetadata<Block>, Self::Error>; fn insert_header_metadata( &self, hash: <Block as Block>::Hash, header_metadata: CachedHeaderMetadata<Block>, ); fn remove_header_metadata(&self, hash: <Block as Block>::Hash); }
Expand description

Handles header metadata: hash, number, parent hash, etc.

Required Associated Types§

source

type Error: Error

Error used in case the header metadata is not found.

Required Methods§

source

fn header_metadata( &self, hash: <Block as Block>::Hash, ) -> Result<CachedHeaderMetadata<Block>, Self::Error>

source

fn insert_header_metadata( &self, hash: <Block as Block>::Hash, header_metadata: CachedHeaderMetadata<Block>, )

source

fn remove_header_metadata(&self, hash: <Block as Block>::Hash)

Implementations on Foreign Types§

§

impl<B, E, Block, RA> HeaderMetadata<Block> for Client<B, E, Block, RA>
where B: Backend<Block>, E: CallExecutor<Block>, Block: Block,

§

type Error = Error

§

fn header_metadata( &self, hash: <Block as Block>::Hash, ) -> Result<CachedHeaderMetadata<Block>, <Client<B, E, Block, RA> as HeaderMetadata<Block>>::Error>

§

fn insert_header_metadata( &self, hash: <Block as Block>::Hash, metadata: CachedHeaderMetadata<Block>, )

§

fn remove_header_metadata(&self, hash: <Block as Block>::Hash)

source§

impl<Block> HeaderMetadata<Block> for Blockchain<Block>
where Block: Block,

§

type Error = Error

source§

fn header_metadata( &self, hash: <Block as Block>::Hash, ) -> Result<CachedHeaderMetadata<Block>, <Blockchain<Block> as HeaderMetadata<Block>>::Error>

source§

fn insert_header_metadata( &self, _hash: <Block as Block>::Hash, _metadata: CachedHeaderMetadata<Block>, )

source§

fn remove_header_metadata(&self, _hash: <Block as Block>::Hash)

source§

impl<Block> HeaderMetadata<Block> for BlockchainDb<Block>
where Block: Block,

§

type Error = Error

source§

fn header_metadata( &self, hash: <Block as Block>::Hash, ) -> Result<CachedHeaderMetadata<Block>, <BlockchainDb<Block> as HeaderMetadata<Block>>::Error>

source§

fn insert_header_metadata( &self, hash: <Block as Block>::Hash, metadata: CachedHeaderMetadata<Block>, )

source§

fn remove_header_metadata(&self, hash: <Block as Block>::Hash)

Implementors§