Trait lightning_block_sync::poll::Poll[][src]

pub trait Poll {
    fn poll_chain_tip<'a>(
        &'a mut self,
        best_known_chain_tip: ValidatedBlockHeader
    ) -> Pin<Box<dyn Future<Output = Result<ChainTip, BlockSourceError>> + Send + 'a>>;
fn look_up_previous_header<'a>(
        &'a mut self,
        header: &'a ValidatedBlockHeader
    ) -> Pin<Box<dyn Future<Output = Result<ValidatedBlockHeader, BlockSourceError>> + Send + 'a>>;
fn fetch_block<'a>(
        &'a mut self,
        header: &'a ValidatedBlockHeader
    ) -> Pin<Box<dyn Future<Output = Result<ValidatedBlock, BlockSourceError>> + Send + 'a>>; }

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

fn poll_chain_tip<'a>(
    &'a mut self,
    best_known_chain_tip: ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ChainTip, BlockSourceError>> + Send + 'a>>
[src]

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

fn look_up_previous_header<'a>(
    &'a mut self,
    header: &'a ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ValidatedBlockHeader, BlockSourceError>> + Send + 'a>>
[src]

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

fn fetch_block<'a>(
    &'a mut self,
    header: &'a ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ValidatedBlock, BlockSourceError>> + Send + 'a>>
[src]

Returns the block associated with the given header.

Loading content...

Implementors

impl<B: DerefMut<Target = T> + Sized + Sync + Send, T: BlockSource> Poll for ChainPoller<B, T>[src]

Loading content...