pub trait Header: Serialize {
    type Id: BlockId;
    type Date: BlockDate;
    type ChainLength: ChainLength;
    type Version;

    // Required methods
    fn id(&self) -> Self::Id;
    fn parent_id(&self) -> Self::Id;
    fn date(&self) -> Self::Date;
    fn version(&self) -> Self::Version;
    fn chain_length(&self) -> Self::ChainLength;
}
Expand description

Trait identifying the block header type.

Required Associated Types§

Source

type Id: BlockId

The block header id.

Source

type Date: BlockDate

The block date.

Source

type ChainLength: ChainLength

the length of the blockchain (number of blocks)

Source

type Version

the type associated to the version of a block

Required Methods§

Source

fn id(&self) -> Self::Id

Retrieves the block’s header id.

Source

fn parent_id(&self) -> Self::Id

get the parent block identifier (the previous block in the blockchain).

Source

fn date(&self) -> Self::Date

Retrieves the block’s date.

Source

fn version(&self) -> Self::Version

access the version of a given block

Source

fn chain_length(&self) -> Self::ChainLength

get the block’s chain length. The number of block created following this thread of blocks on the blockchain (including Self).

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§