Struct libblockchain::chain::Chain
[−]
[src]
pub struct Chain<T: Clone + Hash> { /* fields omitted */ }
A Chain
representation.
Methods
impl<T: Clone + Hash> Chain<T>
[src]
fn new(inner: Vec<Block<T>>) -> Chain<T>
[src]
Creates a new Chain
.
fn push(&mut self, v: Block<T>) -> Option<()>
[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)
fn is_trusty_chain(&self) -> bool
[src]
Returns true
if the given Chain
is trusty.