Struct sp_runtime::generic::Header[][src]

pub struct Header<Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> {
    pub parent_hash: Hash::Output,
    pub number: Number,
    pub state_root: Hash::Output,
    pub extrinsics_root: Hash::Output,
    pub digest: Digest<Hash::Output>,
}

Abstraction over a block header for a substrate chain.

Fields

parent_hash: Hash::Output

The parent hash.

number: Number

The block number.

state_root: Hash::Output

The state trie merkle root

extrinsics_root: Hash::Output

The merkle root of the extrinsics.

digest: Digest<Hash::Output>

A chain-specific digest of data useful for light clients or referencing auxiliary data.

Implementations

impl<Number, Hash> Header<Number, Hash> where
    Number: Member + Hash + Copy + MaybeDisplay + AtLeast32BitUnsigned + Codec + Into<U256> + TryFrom<U256>,
    Hash: HashT,
    Hash::Output: Default + Hash + Copy + Member + MaybeDisplay + SimpleBitOps + Codec
[src]

pub fn hash(&self) -> Hash::Output[src]

Convenience helper for computing the hash of the header without having to import the trait.

impl Header<u64, BlakeTwo256>[src]

pub fn new_from_number(number: Self::Number) -> Self[src]

A new header with the given number and default hash for all other fields.

Trait Implementations

impl<Number: Clone + Copy + Into<U256> + TryFrom<U256>, Hash: Clone + HashT> Clone for Header<Number, Hash> where
    Hash::Output: Clone,
    Hash::Output: Clone,
    Hash::Output: Clone,
    Hash::Output: Clone
[src]

impl<Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> Debug for Header<Number, Hash> where
    Number: Debug,
    Hash: Debug
[src]

impl<Number, Hash> Decode for Header<Number, Hash> where
    Number: HasCompact + Copy + Into<U256> + TryFrom<U256>,
    Hash: HashT,
    Hash::Output: Decode
[src]

impl<'de, Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> Deserialize<'de> for Header<Number, Hash> where
    Hash::Output: Deserialize<'de>,
    Hash::Output: Deserialize<'de>,
    Hash::Output: Deserialize<'de>, 
[src]

impl<Number, Hash> Encode for Header<Number, Hash> where
    Number: HasCompact + Copy + Into<U256> + TryFrom<U256>,
    Hash: HashT,
    Hash::Output: Encode
[src]

impl<Number, Hash> EncodeLike<Header<Number, Hash>> for Header<Number, Hash> where
    Number: HasCompact + Copy + Into<U256> + TryFrom<U256>,
    Hash: HashT,
    Hash::Output: Encode
[src]

impl<Number: Eq + Copy + Into<U256> + TryFrom<U256>, Hash: Eq + HashT> Eq for Header<Number, Hash> where
    Hash::Output: Eq,
    Hash::Output: Eq,
    Hash::Output: Eq,
    Hash::Output: Eq
[src]

impl<Number, Hash> Header for Header<Number, Hash> where
    Number: Member + MaybeSerializeDeserialize + Debug + Hash + MaybeDisplay + AtLeast32BitUnsigned + Codec + Copy + Into<U256> + TryFrom<U256> + FromStr + MaybeMallocSizeOf,
    Hash: HashT,
    Hash::Output: Default + Hash + Copy + Member + Ord + MaybeSerialize + Debug + MaybeDisplay + SimpleBitOps + Codec + MaybeMallocSizeOf
[src]

type Number = Number

Header number.

type Hash = <Hash as HashT>::Output

Header hash type

type Hashing = Hash

Hashing algorithm

impl<Number, Hash> MallocSizeOf for Header<Number, Hash> where
    Number: Copy + Into<U256> + TryFrom<U256> + MallocSizeOf,
    Hash: HashT,
    Hash::Output: MallocSizeOf
[src]

impl<Number: PartialEq + Copy + Into<U256> + TryFrom<U256>, Hash: PartialEq + HashT> PartialEq<Header<Number, Hash>> for Header<Number, Hash> where
    Hash::Output: PartialEq,
    Hash::Output: PartialEq,
    Hash::Output: PartialEq,
    Hash::Output: PartialEq
[src]

impl<Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> Serialize for Header<Number, Hash> where
    Hash::Output: Serialize,
    Hash::Output: Serialize,
    Hash::Output: Serialize
[src]

impl<Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> StructuralEq for Header<Number, Hash>[src]

impl<Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> StructuralPartialEq for Header<Number, Hash>[src]

Auto Trait Implementations

impl<Number, Hash> RefUnwindSafe for Header<Number, Hash> where
    Number: RefUnwindSafe,
    <Hash as Hash>::Output: RefUnwindSafe

impl<Number, Hash> Send for Header<Number, Hash> where
    Number: Send

impl<Number, Hash> Sync for Header<Number, Hash> where
    Number: Sync

impl<Number, Hash> Unpin for Header<Number, Hash> where
    Number: Unpin,
    <Hash as Hash>::Output: Unpin

impl<Number, Hash> UnwindSafe for Header<Number, Hash> where
    Number: UnwindSafe,
    <Hash as Hash>::Output: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<S> Codec for S where
    S: Encode + Decode
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DecodeLimit for T where
    T: Decode
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T, Global>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

impl<T> From<T> for T[src]

impl<S> FullCodec for S where
    S: Decode + FullEncode
[src]

impl<S> FullEncode for S where
    S: Encode + EncodeLike<S>, 
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> MallocSizeOfExt for T where
    T: MallocSizeOf
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeMallocSizeOf for T where
    T: MallocSizeOf
[src]

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe
[src]

impl<T> MaybeSerialize for T where
    T: Serialize
[src]

impl<T> MaybeSerializeDeserialize for T where
    T: DeserializeOwned + Serialize
[src]

impl<T> Member for T where
    T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> SaturatedConversion for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]