Trait InherentDigest

Source
pub trait InherentDigest {
    type Value: Send + Sync + 'static;

    // Required methods
    fn from_inherent_data(
        inherent_data: &InherentData,
    ) -> Result<Vec<DigestItem>, Box<dyn Error + Send + Sync>>;
    fn value_from_digest(
        digests: &[DigestItem],
    ) -> Result<Self::Value, Box<dyn Error + Send + Sync>>;
}
Expand description

Defines parts of inherent data that should be included in header digest

Required Associated Types§

Source

type Value: Send + Sync + 'static

Rust type of the inherent digest value

Required Methods§

Source

fn from_inherent_data( inherent_data: &InherentData, ) -> Result<Vec<DigestItem>, Box<dyn Error + Send + Sync>>

Construct digest items from block’s inherent data

Source

fn value_from_digest( digests: &[DigestItem], ) -> Result<Self::Value, Box<dyn Error + Send + Sync>>

Retrieve value from digests

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl InherentDigest for ()

Source§

type Value = ()

Source§

fn from_inherent_data( _inherent_data: &InherentData, ) -> Result<Vec<DigestItem>, Box<dyn Error + Send + Sync>>

Source§

fn value_from_digest( _digests: &[DigestItem], ) -> Result<(), Box<dyn Error + Send + Sync>>

Implementors§