Trait sp_blockchain::HeaderMetadata

source ·
pub trait HeaderMetadata<Block: BlockT> {
    type Error: Error;

    // Required methods
    fn header_metadata(
        &self,
        hash: Block::Hash,
    ) -> Result<CachedHeaderMetadata<Block>, Self::Error>;
    fn insert_header_metadata(
        &self,
        hash: Block::Hash,
        header_metadata: CachedHeaderMetadata<Block>,
    );
    fn remove_header_metadata(&self, hash: 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::Hash, ) -> Result<CachedHeaderMetadata<Block>, Self::Error>

source

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

source

fn remove_header_metadata(&self, hash: Block::Hash)

Implementors§