Trait sp_inherents::CreateInherentDataProviders

source ·
pub trait CreateInherentDataProviders<Block: BlockT, ExtraArgs>: Send + Sync {
    type InherentDataProviders: InherentDataProvider;

    // Required method
    fn create_inherent_data_providers<'life0, 'async_trait>(
        &'life0 self,
        parent: Block::Hash,
        extra_args: ExtraArgs,
    ) -> Pin<Box<dyn Future<Output = Result<Self::InherentDataProviders, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Something that can create inherent data providers.

It is possible for the caller to provide custom arguments to the callee by setting the ExtraArgs generic parameter.

The crate already provides some convince implementations of this trait for Box<dyn CreateInherentDataProviders> and closures. So, it should not be required to implement this trait manually.

Required Associated Types§

source

type InherentDataProviders: InherentDataProvider

The inherent data providers that will be created.

Required Methods§

source

fn create_inherent_data_providers<'life0, 'async_trait>( &'life0 self, parent: Block::Hash, extra_args: ExtraArgs, ) -> Pin<Box<dyn Future<Output = Result<Self::InherentDataProviders, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create the inherent data providers at the given parent block using the given extra_args.

Trait Implementations§

source§

impl<Block: BlockT, ExtraArgs: Send, IDPS: InherentDataProvider> CreateInherentDataProviders<Block, ExtraArgs> for Box<dyn CreateInherentDataProviders<Block, ExtraArgs, InherentDataProviders = IDPS>>

§

type InherentDataProviders = IDPS

The inherent data providers that will be created.
source§

fn create_inherent_data_providers<'life0, 'async_trait>( &'life0 self, parent: Block::Hash, extra_args: ExtraArgs, ) -> Pin<Box<dyn Future<Output = Result<Self::InherentDataProviders, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create the inherent data providers at the given parent block using the given extra_args.

Implementations on Foreign Types§

source§

impl<Block: BlockT, ExtraArgs: Send, IDPS: InherentDataProvider> CreateInherentDataProviders<Block, ExtraArgs> for Box<dyn CreateInherentDataProviders<Block, ExtraArgs, InherentDataProviders = IDPS>>

§

type InherentDataProviders = IDPS

source§

fn create_inherent_data_providers<'life0, 'async_trait>( &'life0 self, parent: Block::Hash, extra_args: ExtraArgs, ) -> Pin<Box<dyn Future<Output = Result<Self::InherentDataProviders, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<F, Block, IDP, ExtraArgs, Fut> CreateInherentDataProviders<Block, ExtraArgs> for F
where Block: BlockT, F: Fn(Block::Hash, ExtraArgs) -> Fut + Sync + Send, Fut: Future<Output = Result<IDP, Box<dyn Error + Send + Sync>>> + Send + 'static, IDP: InherentDataProvider + 'static, ExtraArgs: Send + 'static,