Trait merkletree::merkle::Element

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

Element stored in the merkle tree.

Required Methods§

source

fn byte_len() -> usize

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

source

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

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

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Element for [u8; 32]

source§

fn byte_len() -> usize

source§

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

source§

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

Implementors§