pub struct Chain<T: Clone + Hash> { /* private fields */ }
Expand description
A Chain
representation.
Implementations§
Source§impl<T: Clone + Hash> Chain<T>
impl<T: Clone + Hash> Chain<T>
Sourcepub fn push(&mut self, v: Block<T>) -> Option<()>
pub fn push(&mut self, v: Block<T>) -> Option<()>
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)
Sourcepub fn is_trusty_chain(&self) -> bool
pub fn is_trusty_chain(&self) -> bool
Returns true
if the given Chain
is trusty.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Chain<T>
impl<T> RefUnwindSafe for Chain<T>where
T: RefUnwindSafe,
impl<T> Send for Chain<T>where
T: Send,
impl<T> Sync for Chain<T>where
T: Sync,
impl<T> Unpin for Chain<T>where
T: Unpin,
impl<T> UnwindSafe for Chain<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more