Trait aleph_bft::DataProvider

source ·
pub trait DataProvider<Data>: Sync + Send + 'static {
    // Required method
    fn get_data<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Option<Data>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

The source of data items that consensus should order.

AlephBFT internally calls DataProvider::get_data whenever a new unit is created and data needs to be placed inside.

We refer to the documentation https://cardinal-cryptography.github.io/AlephBFT/aleph_bft_api.html for a discussion and examples of how this trait can be implemented.

Required Methods§

source

fn get_data<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Option<Data>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Outputs a new data item to be ordered

Implementors§