[][src]Trait blockchain::traits::Block

pub trait Block: Clone {
type Identifier: Copy + Eq + Hash;
    fn id(&self) -> Self::Identifier;
fn parent_id(&self) -> Option<Self::Identifier>; }

A block contains a hash, and reference a parent block via parent hash.

Associated Types

type Identifier: Copy + Eq + Hash

Hash type of the block.

Loading content...

Required methods

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

Get the block hash.

fn parent_id(&self) -> Option<Self::Identifier>

Get the parent block hash. None if this block is genesis.

Loading content...

Implementors

Loading content...