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