Trait Poll

Source
pub trait Poll {
    // Required methods
    fn poll_chain_tip<'a>(
        &'a self,
        best_known_chain_tip: ValidatedBlockHeader,
    ) -> AsyncBlockSourceResult<'a, ChainTip>;
    fn look_up_previous_header<'a>(
        &'a self,
        header: &'a ValidatedBlockHeader,
    ) -> AsyncBlockSourceResult<'a, ValidatedBlockHeader>;
    fn fetch_block<'a>(
        &'a self,
        header: &'a ValidatedBlockHeader,
    ) -> AsyncBlockSourceResult<'a, ValidatedBlock>;
}
Expand description

The Poll trait defines behavior for polling block sources for a chain tip and retrieving related chain data. It serves as an adapter for BlockSource.

ChainPoller adapts a single BlockSource, while any other implementations of Poll are required to be built in terms of it to ensure chain data validity.

Required Methods§

Source

fn poll_chain_tip<'a>( &'a self, best_known_chain_tip: ValidatedBlockHeader, ) -> AsyncBlockSourceResult<'a, ChainTip>

Returns a chain tip in terms of its relationship to the provided chain tip.

Source

fn look_up_previous_header<'a>( &'a self, header: &'a ValidatedBlockHeader, ) -> AsyncBlockSourceResult<'a, ValidatedBlockHeader>

Returns the header that preceded the given header in the chain.

Source

fn fetch_block<'a>( &'a self, header: &'a ValidatedBlockHeader, ) -> AsyncBlockSourceResult<'a, ValidatedBlock>

Returns the block associated with the given header.

Implementors§

Source§

impl<B: Deref<Target = T> + Sized + Send + Sync, T: BlockSource + ?Sized> Poll for ChainPoller<B, T>