zebra_state::service::block_iter

Trait ChainItem

Source
pub(crate) trait ChainItem {
    type Type;

    // Required method
    fn read(
        chain: Option<&Arc<Chain>>,
        db: &ZebraDb,
        height: Height,
    ) -> Option<Self::Type>;
}
Expand description

A trait that implements iteration for a specific chain type.

Required Associated Types§

Required Methods§

Source

fn read( chain: Option<&Arc<Chain>>, db: &ZebraDb, height: Height, ) -> Option<Self::Type>

Read the Type at height from the non-finalized chain or finalized db.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ChainItem for Header

Source§

type Type = Arc<Header>

Source§

fn read( chain: Option<&Arc<Chain>>, db: &ZebraDb, height: Height, ) -> Option<Self::Type>

Source§

impl ChainItem for Block

Source§

type Type = Arc<Block>

Source§

fn read( chain: Option<&Arc<Chain>>, db: &ZebraDb, height: Height, ) -> Option<Self::Type>

Implementors§