Struct libblockchain::chain::Chain [] [src]

pub struct Chain<T: Clone + Hash> { /* fields omitted */ }

A Chain representation.

Methods

impl<T: Clone + Hash> Chain<T>
[src]

[src]

Creates a new Chain.

[src]

Appends a block to the Chain.

Examples

use libblockchain::{Block, Chain};

let mut chain = Chain::new(vec![]);

let block0 = Block::new(0, vec![0; 256], 0);

let resp = chain.push(block0);

assert_eq!(resp.is_some(), true)

[src]

Returns true if the given Chain is trusty.

Trait Implementations

impl<T: Debug + Clone + Hash> Debug for Chain<T>
[src]

[src]

Formats the value using the given formatter.