Trait Block

Source
pub trait Block: Clone {
    type Identifier: Clone + Eq + Hash;

    // Required methods
    fn id(&self) -> Self::Identifier;
    fn parent_id(&self) -> Option<Self::Identifier>;
}
Expand description

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

Required Associated Types§

Source

type Identifier: Clone + Eq + Hash

Hash type of the block.

Required Methods§

Source

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

Get the block hash.

Source

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

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

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§