Trait sp_inherents::InherentDataProvider
source · [−]pub trait InherentDataProvider: Send + Sync {
fn provide_inherent_data(
&self,
inherent_data: &mut InherentData
) -> Result<(), Error>;
fn try_handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
identifier: &'life1 InherentIdentifier,
error: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Option<Result<(), Error>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn create_inherent_data(&self) -> Result<InherentData, Error> { ... }
}
Expand description
Something that provides inherent data.
Required methods
fn provide_inherent_data(
&self,
inherent_data: &mut InherentData
) -> Result<(), Error>
fn provide_inherent_data(
&self,
inherent_data: &mut InherentData
) -> Result<(), Error>
Provide inherent data that should be included in a block.
The data should be stored in the given InherentData
structure.
fn try_handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
identifier: &'life1 InherentIdentifier,
error: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Option<Result<(), Error>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn try_handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
identifier: &'life1 InherentIdentifier,
error: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Option<Result<(), Error>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Convert the given encoded error to a string.
If the given error could not be decoded, None
should be returned.
Provided methods
fn create_inherent_data(&self) -> Result<InherentData, Error>
fn create_inherent_data(&self) -> Result<InherentData, Error>
Convenience function for creating InherentData
.
Basically maps around Self::provide_inherent_data
.