[−][src]Struct hycon_rust::common::merkle::MerkleTree
A merkle tree
Methods
impl MerkleTree
[src]
pub fn length_for(length: usize) -> usize
[src]
Calculate and return the length of vector required to build a tree for the input vector length
pub fn couple_hash(left: &Blake2bResult, right: &Blake2bResult) -> Blake2bResult
[src]
Calculate a hash value for the concatenated value of two hash values
pub fn empty_tree() -> MerkleTree
[src]
Construct a tree that has only one element containing the hash value of empty byte vector
pub fn from(hashes: Vec<Blake2bResult>) -> MerkleTree
[src]
Construct the merkle tree containing the input vector and their ancestors that are built with couple_hash
Example
let input = Vec::new(); input.push(hash(tx_object,32)); let merkle_tree=MerkleTree::from(input);
pub fn root(&self) -> &[u8]
[src]
Return the hash value stored in the root element of this tree
pub fn size(&self) -> usize
[src]
Return the size of merkle tree
Auto Trait Implementations
impl Send for MerkleTree
impl Sync for MerkleTree
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self