pub trait GenericBlockHeader<'a>where
Self: Clone + Debug + Deref<Target = SharedBlockHeader<'a>> + Into<BlockHeader<'a>> + Send + Sync,{
type Owned: GenericOwnedBlockHeader<Header<'a> = Self>
where Self: 'a;
const SHARD_KIND: RealShardKind;
// Required methods
fn to_owned(self) -> Self::Owned;
fn root(&self) -> impl Deref<Target = BlockRoot> + Send + Sync;
fn pre_seal_hash(&self) -> Blake3Hash;
}Expand description
Generic block header
Required Associated Constants§
Sourceconst SHARD_KIND: RealShardKind
const SHARD_KIND: RealShardKind
Shard kind
Required Associated Types§
Sourcetype Owned: GenericOwnedBlockHeader<Header<'a> = Self>
where
Self: 'a
type Owned: GenericOwnedBlockHeader<Header<'a> = Self> where Self: 'a
Owned block header
Required Methods§
Sourcefn root(&self) -> impl Deref<Target = BlockRoot> + Send + Sync
fn root(&self) -> impl Deref<Target = BlockRoot> + Send + Sync
Compute block root out of this header.
Block root is a Merkle Tree Root. The leaves are derived from individual fields in
SharedBlockHeader and other fields of this enum in the declaration order.
Note that this method does a bunch of hashing and if root is often needed, should be cached.
Sourcefn pre_seal_hash(&self) -> Blake3Hash
fn pre_seal_hash(&self) -> Blake3Hash
Hash of the block before seal is applied to it
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".