referrerpolicy=no-referrer-when-downgrade
substrate_test_runtime

Type Alias Digest

Source
pub type Digest = Digest;
Expand description

The digest of a block.

Aliased Type§

struct Digest {
    pub logs: Vec<DigestItem>,
}

Fields§

§logs: Vec<DigestItem>

A list of logs in the digest.

Implementations

Source§

impl Digest

Source

pub fn logs(&self) -> &[DigestItem]

Get reference to all digest items.

Source

pub fn push(&mut self, item: DigestItem)

Push new digest item.

Source

pub fn pop(&mut self) -> Option<DigestItem>

Pop a digest item.

Source

pub fn log<T, F>(&self, predicate: F) -> Option<&T>
where F: Fn(&DigestItem) -> Option<&T>, T: ?Sized,

Get reference to the first digest item that matches the passed predicate.

Source

pub fn convert_first<T, F>(&self, predicate: F) -> Option<T>
where F: Fn(&DigestItem) -> Option<T>,

Get a conversion of the first digest item that successfully converts using the function.

Trait Implementations

Source§

impl Clone for Digest

Source§

fn clone(&self) -> Digest

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Digest

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Decode for Digest

Source§

fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Digest, Error>
where __CodecInputEdqy: Input,

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl Default for Digest

Source§

fn default() -> Digest

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Digest

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Digest, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encode for Digest

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
Source§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
Source§

fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
where __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl PartialEq for Digest

Source§

fn eq(&self, other: &Digest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Digest

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TypeInfo for Digest

Source§

type Identity = Digest

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl DecodeWithMemTracking for Digest

Source§

impl EncodeLike for Digest

Source§

impl Eq for Digest

Source§

impl StorageAppend<DigestItem> for Digest

We abuse the fact that SCALE does not put any marker into the encoding, i.e. we only encode the internal vec and we can append to this vec. We have a test that ensures that if the Digest format ever changes, we need to remove this here.

Source§

impl StructuralPartialEq for Digest