pub trait GenericBlockHeader<'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§
Sourcetype Owned: GenericOwnedBlockHeader<Header<'a> = Self>
where
Self: 'a
type Owned: GenericOwnedBlockHeader<Header<'a> = Self> where Self: 'a
Owned block header
Required Methods§
Sourcefn try_to_owned(self) -> Option<Self::Owned>
fn try_to_owned(self) -> Option<Self::Owned>
Turn into owned version
Sourcefn root(&self) -> BlockRoot
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.