pub enum DigestItemRef<'a, Hash: 'a> {
ChangesTrieRoot(&'a Hash),
PreRuntime(&'a ConsensusEngineId, &'a Vec<u8>),
Consensus(&'a ConsensusEngineId, &'a Vec<u8>),
Seal(&'a ConsensusEngineId, &'a Vec<u8>),
ChangesTrieSignal(&'a ChangesTrieSignal),
Other(&'a Vec<u8>),
}
Expand description
A ‘referencing view’ for digest item. Does not own its contents. Used by final runtime implementations for encoding/decoding its log items.
Variants§
ChangesTrieRoot(&'a Hash)
Reference to DigestItem::ChangesTrieRoot
.
PreRuntime(&'a ConsensusEngineId, &'a Vec<u8>)
A pre-runtime digest.
These are messages from the consensus engine to the runtime, although the consensus engine can (and should) read them itself to avoid code and state duplication. It is erroneous for a runtime to produce these, but this is not (yet) checked.
Consensus(&'a ConsensusEngineId, &'a Vec<u8>)
A message from the runtime to the consensus engine. This should never be generated by the native code of any consensus engine, but this is not checked (yet).
Seal(&'a ConsensusEngineId, &'a Vec<u8>)
Put a Seal on it. This is only used by native code, and is never seen by runtimes.
ChangesTrieSignal(&'a ChangesTrieSignal)
Digest item that contains signal from changes tries manager to the native code.
Other(&'a Vec<u8>)
Any ‘non-system’ digest item, opaque to the native code.
Implementations§
Source§impl<'a, Hash> DigestItemRef<'a, Hash>
impl<'a, Hash> DigestItemRef<'a, Hash>
Sourcepub fn as_changes_trie_root(&self) -> Option<&'a Hash>
pub fn as_changes_trie_root(&self) -> Option<&'a Hash>
Cast this digest item into ChangesTrieRoot
.
Sourcepub fn as_pre_runtime(&self) -> Option<(ConsensusEngineId, &'a [u8])>
pub fn as_pre_runtime(&self) -> Option<(ConsensusEngineId, &'a [u8])>
Cast this digest item into PreRuntime
Sourcepub fn as_consensus(&self) -> Option<(ConsensusEngineId, &'a [u8])>
pub fn as_consensus(&self) -> Option<(ConsensusEngineId, &'a [u8])>
Cast this digest item into Consensus
Sourcepub fn as_seal(&self) -> Option<(ConsensusEngineId, &'a [u8])>
pub fn as_seal(&self) -> Option<(ConsensusEngineId, &'a [u8])>
Cast this digest item into Seal
Sourcepub fn as_changes_trie_signal(&self) -> Option<&'a ChangesTrieSignal>
pub fn as_changes_trie_signal(&self) -> Option<&'a ChangesTrieSignal>
Cast this digest item into ChangesTrieSignal
.
Sourcepub fn try_as_raw(&self, id: OpaqueDigestItemId<'_>) -> Option<&'a [u8]>
pub fn try_as_raw(&self, id: OpaqueDigestItemId<'_>) -> Option<&'a [u8]>
Try to match this digest item to the given opaque item identifier; if it matches, then return the opaque data it contains.
Sourcepub fn try_to<T: Decode>(&self, id: OpaqueDigestItemId<'_>) -> Option<T>
pub fn try_to<T: Decode>(&self, id: OpaqueDigestItemId<'_>) -> Option<T>
Try to match this digest item to the given opaque item identifier; if it matches, then try to cast to the given data type; if that works, return it.
Trait Implementations§
Source§impl<'a, Hash: Clone + 'a> Clone for DigestItemRef<'a, Hash>
impl<'a, Hash: Clone + 'a> Clone for DigestItemRef<'a, Hash>
Source§fn clone(&self) -> DigestItemRef<'a, Hash>
fn clone(&self) -> DigestItemRef<'a, Hash>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a, Hash> Debug for DigestItemRef<'a, Hash>where
Hash: Debug + 'a,
impl<'a, Hash> Debug for DigestItemRef<'a, Hash>where
Hash: Debug + 'a,
Source§impl<'a, Hash: Encode> Encode for DigestItemRef<'a, Hash>
impl<'a, Hash: Encode> Encode for DigestItemRef<'a, Hash>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn encode_to<T>(&self, dest: &mut T)
fn encode_to<T>(&self, dest: &mut T)
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Source§impl<'a, Hash: PartialEq + 'a> PartialEq for DigestItemRef<'a, Hash>
impl<'a, Hash: PartialEq + 'a> PartialEq for DigestItemRef<'a, Hash>
impl<'a, Hash: Encode> EncodeLike for DigestItemRef<'a, Hash>
impl<'a, Hash: Eq + 'a> Eq for DigestItemRef<'a, Hash>
impl<'a, Hash: 'a> StructuralPartialEq for DigestItemRef<'a, Hash>
Auto Trait Implementations§
impl<'a, Hash> Freeze for DigestItemRef<'a, Hash>
impl<'a, Hash> RefUnwindSafe for DigestItemRef<'a, Hash>where
Hash: RefUnwindSafe,
impl<'a, Hash> Send for DigestItemRef<'a, Hash>where
Hash: Sync,
impl<'a, Hash> Sync for DigestItemRef<'a, Hash>where
Hash: Sync,
impl<'a, Hash> Unpin for DigestItemRef<'a, Hash>
impl<'a, Hash> UnwindSafe for DigestItemRef<'a, Hash>where
Hash: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moreSource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.