Trait sp_inherents::CreateInherentDataProviders [−][src]
pub trait CreateInherentDataProviders<Block: BlockT, ExtraArgs>: Send + Sync { type InherentDataProviders: InherentDataProvider; 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
'life0: 'async_trait,
Self: '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 convience implementations of this trait for
Box<dyn CreateInherentDataProviders>
and closures. So, it should not be required to implement
this trait manually.
Associated Types
The inherent data providers that will be created.
Required methods
Create the inherent data providers at the given parent
block using the given extra_args
.
Implementations on Foreign Types
impl<Block: BlockT, ExtraArgs: Send, IDPS: InherentDataProvider> CreateInherentDataProviders<Block, ExtraArgs> for Box<dyn CreateInherentDataProviders<Block, ExtraArgs, InherentDataProviders = IDPS>>
impl<Block: BlockT, ExtraArgs: Send, IDPS: InherentDataProvider> CreateInherentDataProviders<Block, ExtraArgs> for Box<dyn CreateInherentDataProviders<Block, ExtraArgs, InherentDataProviders = IDPS>>
type InherentDataProviders = IDPS
Implementors
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,