referrerpolicy=no-referrer-when-downgrade

Trait BlockInfoProvider

Source
pub trait BlockInfoProvider: Send + Sync {
    // Required methods
    fn update_latest<'life0, 'async_trait>(
        &'life0 self,
        block: SubstrateBlock,
        subscription_type: SubscriptionType,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn latest_finalized_block<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Arc<SubstrateBlock>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn latest_block<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Arc<SubstrateBlock>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_by_number<'life0, 'async_trait>(
        &'life0 self,
        block_number: SubstrateBlockNumber,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Arc<SubstrateBlock>>, ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_by_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        hash: &'life1 H256,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Arc<SubstrateBlock>>, ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn latest_block_number<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = SubstrateBlockNumber> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

BlockInfoProvider cache and retrieves information about blocks.

Required Methods§

Source

fn update_latest<'life0, 'async_trait>( &'life0 self, block: SubstrateBlock, subscription_type: SubscriptionType, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update the latest block

Source

fn latest_finalized_block<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Arc<SubstrateBlock>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the latest finalized block.

Source

fn latest_block<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Arc<SubstrateBlock>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the latest block.

Source

fn block_by_number<'life0, 'async_trait>( &'life0 self, block_number: SubstrateBlockNumber, ) -> Pin<Box<dyn Future<Output = Result<Option<Arc<SubstrateBlock>>, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get block by block_number.

Source

fn block_by_hash<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 H256, ) -> Pin<Box<dyn Future<Output = Result<Option<Arc<SubstrateBlock>>, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get block by block hash.

Provided Methods§

Source

fn latest_block_number<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = SubstrateBlockNumber> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the latest block number

Implementors§