Skip to main content

BlockHeaderTrait

Trait BlockHeaderTrait 

Source
pub trait BlockHeaderTrait:
    PartialEq
    + Debug
    + Clone
    + Serialize
    + DeserializeOwned {
    type Hash: Clone;

    // Required methods
    fn prev_hash(&self) -> Self::Hash;
    fn hash(&self) -> Self::Hash;
    fn height(&self) -> u64;
    fn time(&self) -> Time;
}
Expand description

A block header, typically used in the context of an underlying DA blockchain.

Required Associated Types§

Source

type Hash: Clone

Each block header must have a unique canonical hash.

Required Methods§

Source

fn prev_hash(&self) -> Self::Hash

Each block header must contain the hash of the previous block.

Source

fn hash(&self) -> Self::Hash

Hash the type to get the digest.

Source

fn height(&self) -> u64

The current header height

Source

fn time(&self) -> Time

The timestamp of the block

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§