Type Alias sp_runtime::testing::Digest

source ·
pub type Digest = Digest;
Expand description

Header Digest

Aliased Type§

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

Fields§

§logs: Vec<DigestItem, Global>

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: ?Sized, F: Fn(&DigestItem) -> Option<&T>>( &self, predicate: F ) -> Option<&T>

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

source

pub fn convert_first<T, F: Fn(&DigestItem) -> Option<T>>( &self, predicate: F ) -> 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

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

impl Decode for Digest

source§

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

Attempt to deserialise the value from input.
source§

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
source§

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

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

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<Self, __D::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: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )

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: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback ) -> __CodecOutputReturn

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

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
source§

impl PartialEq<Digest> for Digest

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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::Ok, __S::Error>where __S: Serializer,

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

impl TypeInfo for Digest

§

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 EncodeLike<Digest> for Digest

source§

impl Eq for Digest

source§

impl StructuralEq for Digest

source§

impl StructuralPartialEq for Digest