Skip to main content

Blockchain

Trait Blockchain 

Source
pub trait Blockchain {
    // Required methods
    fn name(&self) -> &str;
    fn block(&self, height: usize) -> Option<&dyn Block>;
    fn last_block(&self) -> &dyn Block;
    fn last_block_mut(&mut self) -> &mut dyn Block;
}

Required Methods§

Source

fn name(&self) -> &str

Returns the name of this blockchain.

Source

fn block(&self, height: usize) -> Option<&dyn Block>

Returns the block at a given height.

Source

fn last_block(&self) -> &dyn Block

Returns a reference to the block at the current maximum height.

Source

fn last_block_mut(&mut self) -> &mut dyn Block

Returns a mutable reference to the block at the current maximum height.

Implementors§