pub type Digest = Digest;
Expand description
Header Digest
Aliased Type§
struct Digest {
pub logs: Vec<DigestItem>,
}
Fields§
§logs: Vec<DigestItem>
A list of logs in the digest.
Implementations
Source§impl Digest
impl Digest
Sourcepub fn logs(&self) -> &[DigestItem]
pub fn logs(&self) -> &[DigestItem]
Get reference to all digest items.
Sourcepub fn push(&mut self, item: DigestItem)
pub fn push(&mut self, item: DigestItem)
Push new digest item.
Sourcepub fn pop(&mut self) -> Option<DigestItem>
pub fn pop(&mut self) -> Option<DigestItem>
Pop a digest item.
Sourcepub fn log<T: ?Sized, F: Fn(&DigestItem) -> Option<&T>>(
&self,
predicate: F,
) -> Option<&T>
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.
Sourcepub fn convert_first<T, F: Fn(&DigestItem) -> Option<T>>(
&self,
predicate: F,
) -> Option<T>
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 Decode for Digest
impl Decode for Digest
Source§fn 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.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: 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,
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>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Source§impl<'de> Deserialize<'de> for Digest
impl<'de> Deserialize<'de> for Digest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
impl Encode for Digest
Source§fn size_hint(&self) -> usize
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,
)
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 using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
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.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more