pub trait Poll {
// Required methods
fn poll_chain_tip<'a>(
&'a self,
best_known_chain_tip: ValidatedBlockHeader,
) -> impl Future<Output = BlockSourceResult<ChainTip>> + Send + 'a;
fn look_up_previous_header<'a>(
&'a self,
header: &'a ValidatedBlockHeader,
) -> impl Future<Output = BlockSourceResult<ValidatedBlockHeader>> + Send + 'a;
fn fetch_block<'a>(
&'a self,
header: &'a ValidatedBlockHeader,
) -> impl Future<Output = BlockSourceResult<ValidatedBlock>> + Send + 'a;
fn get_header<'a>(
&'a self,
block_hash: &'a BlockHash,
height_hint: Option<u32>,
) -> impl Future<Output = BlockSourceResult<ValidatedBlockHeader>> + Send + 'a;
}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§
Sourcefn poll_chain_tip<'a>(
&'a self,
best_known_chain_tip: ValidatedBlockHeader,
) -> impl Future<Output = BlockSourceResult<ChainTip>> + Send + 'a
fn poll_chain_tip<'a>( &'a self, best_known_chain_tip: ValidatedBlockHeader, ) -> impl Future<Output = BlockSourceResult<ChainTip>> + Send + 'a
Returns a chain tip in terms of its relationship to the provided chain tip.
Sourcefn look_up_previous_header<'a>(
&'a self,
header: &'a ValidatedBlockHeader,
) -> impl Future<Output = BlockSourceResult<ValidatedBlockHeader>> + Send + 'a
fn look_up_previous_header<'a>( &'a self, header: &'a ValidatedBlockHeader, ) -> impl Future<Output = BlockSourceResult<ValidatedBlockHeader>> + Send + 'a
Returns the header that preceded the given header in the chain.
Sourcefn fetch_block<'a>(
&'a self,
header: &'a ValidatedBlockHeader,
) -> impl Future<Output = BlockSourceResult<ValidatedBlock>> + Send + 'a
fn fetch_block<'a>( &'a self, header: &'a ValidatedBlockHeader, ) -> impl Future<Output = BlockSourceResult<ValidatedBlock>> + Send + 'a
Returns the block associated with the given header.
Sourcefn get_header<'a>(
&'a self,
block_hash: &'a BlockHash,
height_hint: Option<u32>,
) -> impl Future<Output = BlockSourceResult<ValidatedBlockHeader>> + Send + 'a
fn get_header<'a>( &'a self, block_hash: &'a BlockHash, height_hint: Option<u32>, ) -> impl Future<Output = BlockSourceResult<ValidatedBlockHeader>> + Send + 'a
Returns the header for a given hash and optional height hint.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".