Trait DataProvider

Source
pub trait DataProvider:
    Sync
    + Send
    + 'static {
    type Output: Data;

    // Required method
    fn get_data<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<Self::Output>> + 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 Associated Types§

Source

type Output: Data

Type of data returned by this provider.

Required Methods§

Source

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

Outputs a new data item to be ordered.

Implementors§