Trait GenericBlockHeader

Source
pub trait GenericBlockHeader<'a>
where Self: Copy + Debug + Deref<Target = SharedBlockHeader<'a>>,
{ type Owned: GenericOwnedBlockHeader<Header<'a> = Self> where Self: 'a; // Required methods fn try_to_owned(self) -> Option<Self::Owned>; fn root(&self) -> BlockRoot; }
Expand description

Generic block header

Required Associated Types§

Source

type Owned: GenericOwnedBlockHeader<Header<'a> = Self> where Self: 'a

Owned block header

Required Methods§

Source

fn try_to_owned(self) -> Option<Self::Owned>

Turn into owned version

Source

fn root(&self) -> BlockRoot

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 hash is needed often, should be cached.

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.

Implementors§