referrerpolicy=no-referrer-when-downgrade
sp_test_primitives

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

§

impl Digest

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

Get reference to all digest items.

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

Push new digest item.

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

Pop a digest item.

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.

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

§

impl Clone for Digest

§

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
§

impl Debug for Digest

§

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

Formats the value using the given formatter. Read more
§

impl Decode for Digest

§

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
§

impl Default for Digest

§

fn default() -> Digest

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

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

§

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
§

impl Encode for Digest

§

fn size_hint(&self) -> usize

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

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

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

Convert self to an owned vector.
§

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
§

impl PartialEq for Digest

§

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

impl Serialize for Digest

§

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
§

impl TypeInfo for Digest

§

type Identity = Digest

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

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl DecodeWithMemTracking for Digest

§

impl EncodeLike for Digest

§

impl Eq for Digest

§

impl StructuralPartialEq for Digest