[][src]Trait mohan::merkle::Element

pub trait Element: Ord + Clone + AsRef<[u8]> + Sync + Send + Default + Debug {
    fn byte_len() -> usize;
fn from_slice(bytes: &[u8]) -> Self;
fn copy_to_slice(&self, bytes: &mut [u8]); }

Element stored in the merkle tree.

Required methods

fn byte_len() -> usize

Returns the length of an element when serialized as a byte slice.

fn from_slice(bytes: &[u8]) -> Self

Creates the element from its byte form. Panics if the slice is not appropriately sized.

fn copy_to_slice(&self, bytes: &mut [u8])

Loading content...

Implementors

impl Element for H256[src]

Loading content...