[−][src]Trait sp_runtime::traits::Header
Something which fulfills the abstract idea of a Substrate header. It has types for a Number
,
a Hash
and a Hashing
. It provides access to an extrinsics_root
, state_root
and
parent_hash
, as well as a digest
and a block number
.
You can also create a new
one from those fields.
Associated Types
type Number: Member + MaybeSerializeDeserialize + Debug + Hash + Copy + MaybeDisplay + AtLeast32BitUnsigned + Codec + FromStr + MaybeMallocSizeOf
[src]
Header number.
type Hash: Member + MaybeSerializeDeserialize + Debug + Hash + Ord + Copy + MaybeDisplay + Default + SimpleBitOps + Codec + AsRef<[u8]> + AsMut<[u8]> + MaybeMallocSizeOf
[src]
Header hash type
type Hashing: Hash<Output = Self::Hash>
[src]
Hashing algorithm
Required methods
pub fn new(
number: Self::Number,
extrinsics_root: Self::Hash,
state_root: Self::Hash,
parent_hash: Self::Hash,
digest: Digest<Self::Hash>
) -> Self
[src]
number: Self::Number,
extrinsics_root: Self::Hash,
state_root: Self::Hash,
parent_hash: Self::Hash,
digest: Digest<Self::Hash>
) -> Self
Creates new header.
pub fn number(&self) -> &Self::Number
[src]
Returns a reference to the header number.
pub fn set_number(&mut self, number: Self::Number)
[src]
Sets the header number.
pub fn extrinsics_root(&self) -> &Self::Hash
[src]
Returns a reference to the extrinsics root.
pub fn set_extrinsics_root(&mut self, root: Self::Hash)
[src]
Sets the extrinsic root.
pub fn state_root(&self) -> &Self::Hash
[src]
Returns a reference to the state root.
pub fn set_state_root(&mut self, root: Self::Hash)
[src]
Sets the state root.
pub fn parent_hash(&self) -> &Self::Hash
[src]
Returns a reference to the parent hash.
pub fn set_parent_hash(&mut self, hash: Self::Hash)
[src]
Sets the parent hash.
pub fn digest(&self) -> &Digest<Self::Hash>
[src]
Returns a reference to the digest.
pub fn digest_mut(&mut self) -> &mut Digest<Self::Hash>
[src]
Get a mutable reference to the digest.
Provided methods
Loading content...Implementors
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]
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,
type Number = Number
type Hash = <Hash as HashT>::Output
type Hashing = Hash
pub fn number(&self) -> &Self::Number
[src]
pub fn set_number(&mut self, num: Self::Number)
[src]
pub fn extrinsics_root(&self) -> &Self::Hash
[src]
pub fn set_extrinsics_root(&mut self, root: Self::Hash)
[src]
pub fn state_root(&self) -> &Self::Hash
[src]
pub fn set_state_root(&mut self, root: Self::Hash)
[src]
pub fn parent_hash(&self) -> &Self::Hash
[src]
pub fn set_parent_hash(&mut self, hash: Self::Hash)
[src]
pub fn digest(&self) -> &Digest<Self::Hash>
[src]
pub fn digest_mut(&mut self) -> &mut Digest<Self::Hash>
[src]
pub fn new(
number: Self::Number,
extrinsics_root: Self::Hash,
state_root: Self::Hash,
parent_hash: Self::Hash,
digest: Digest<Self::Hash>
) -> Self
[src]
number: Self::Number,
extrinsics_root: Self::Hash,
state_root: Self::Hash,
parent_hash: Self::Hash,
digest: Digest<Self::Hash>
) -> Self