Struct sp_inherents::CheckInherentsResult
source · [−]pub struct CheckInherentsResult { /* private fields */ }
Expand description
The result of checking inherents.
It either returns okay for all checks, stores all occurred errors or just one fatal error.
When a fatal error occurs, all other errors are removed and the implementation needs to abort checking inherents.
Implementations
sourceimpl CheckInherentsResult
impl CheckInherentsResult
sourcepub fn put_error<E: Encode + IsFatalError>(
&mut self,
identifier: InherentIdentifier,
error: &E
) -> Result<(), Error>
pub fn put_error<E: Encode + IsFatalError>(
&mut self,
identifier: InherentIdentifier,
error: &E
) -> Result<(), Error>
Put an error into the result.
This makes this result resolve to ok() == false
.
Parameters
- identifier - The identifier of the inherent that generated the error.
- error - The error that will be encoded.
sourcepub fn get_error<E: Decode>(
&self,
identifier: &InherentIdentifier
) -> Result<Option<E>, Error>
pub fn get_error<E: Decode>(
&self,
identifier: &InherentIdentifier
) -> Result<Option<E>, Error>
Get an error out of the result.
Return
Ok(Some(I))
if the error could be found and deserialized.Ok(None)
if the error could not be found.Err(_)
if the error could be found, but deserialization did not work.
sourcepub fn into_errors(self) -> IntoIter<InherentIdentifier, Vec<u8>>
pub fn into_errors(self) -> IntoIter<InherentIdentifier, Vec<u8>>
Convert into an iterator over all contained errors.
sourcepub fn fatal_error(&self) -> bool
pub fn fatal_error(&self) -> bool
Is this a fatal error?
Trait Implementations
sourceimpl Clone for CheckInherentsResult
impl Clone for CheckInherentsResult
sourcefn clone(&self) -> CheckInherentsResult
fn clone(&self) -> CheckInherentsResult
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 Decode for CheckInherentsResult
impl Decode for CheckInherentsResult
sourcefn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.
sourcefn skip<I>(input: &mut I) -> Result<(), Error> where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error> where
I: Input,
Attempt to skip the encoded value from input. Read more
sourcefn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
sourceimpl Default for CheckInherentsResult
impl Default for CheckInherentsResult
sourceimpl Encode for CheckInherentsResult
impl Encode for CheckInherentsResult
sourcefn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
Convert self to a slice and append it to the destination.
sourcefn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
sourcefn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
Convert self to a slice and then invoke the given closure with it.
sourcefn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
impl EncodeLike<CheckInherentsResult> for CheckInherentsResult
Auto Trait Implementations
impl RefUnwindSafe for CheckInherentsResult
impl Send for CheckInherentsResult
impl Sync for CheckInherentsResult
impl Unpin for CheckInherentsResult
impl UnwindSafe for CheckInherentsResult
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> DecodeLimit for T where
T: Decode,
impl<T> DecodeLimit for T where
T: Decode,
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