Skip to main content

ChainSource

Trait ChainSource 

Source
pub(crate) trait ChainSource: Send + Sync {
    // Required methods
    fn block_height<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_range<'life0, 'async_trait>(
        &'life0 self,
        from: u64,
        to: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<VerifiedBlock>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_cert2<'life0, 'life1, 'async_trait>(
        &'life0 self,
        header: &'life1 Header,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Certificate2<SeqTypes>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Where a follower reads the chain from.

Required Methods§

Source

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

Source

fn fetch_range<'life0, 'async_trait>( &'life0 self, from: u64, to: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<VerifiedBlock>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The blocks at heights from..to, in order.

Source

fn fetch_cert2<'life0, 'life1, 'async_trait>( &'life0 self, header: &'life1 Header, ) -> Pin<Box<dyn Future<Output = Result<Option<Certificate2<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The cert2 that finalized header directly, if any.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§