Struct sp_inherents::InherentDataProviders
source · [−]pub struct InherentDataProviders { /* private fields */ }
Expand description
All InherentData
providers.
Implementations
sourceimpl InherentDataProviders
impl InherentDataProviders
sourcepub fn register_provider<P: ProvideInherentData + Send + Sync + 'static>(
&self,
provider: P
) -> Result<(), Error>
pub fn register_provider<P: ProvideInherentData + Send + Sync + 'static>(
&self,
provider: P
) -> Result<(), Error>
Register an InherentData
provider.
The registration order is preserved and this order will also be used when creating the inherent data.
Result
Will return an error, if a provider with the same identifier already exists.
sourcepub fn has_provider(&self, identifier: &InherentIdentifier) -> bool
pub fn has_provider(&self, identifier: &InherentIdentifier) -> bool
Returns if a provider for the given identifier exists.
sourcepub fn create_inherent_data(&self) -> Result<InherentData, Error>
pub fn create_inherent_data(&self) -> Result<InherentData, Error>
Create inherent data.
sourcepub fn error_to_string(
&self,
identifier: &InherentIdentifier,
error: &[u8]
) -> String
pub fn error_to_string(
&self,
identifier: &InherentIdentifier,
error: &[u8]
) -> String
Converts a given encoded error into a String
.
Useful if the implementation encounters an error for an identifier it does not know.
Trait Implementations
sourceimpl Clone for InherentDataProviders
impl Clone for InherentDataProviders
sourcefn clone(&self) -> InherentDataProviders
fn clone(&self) -> InherentDataProviders
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for InherentDataProviders
impl Default for InherentDataProviders
sourcefn default() -> InherentDataProviders
fn default() -> InherentDataProviders
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for InherentDataProviders
impl Send for InherentDataProviders
impl Sync for InherentDataProviders
impl Unpin for InherentDataProviders
impl !UnwindSafe for InherentDataProviders
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more