pub struct LeafWithHash<H: MerkleHash> { /* private fields */ }Expand description
The raw data of the leaf, together with its hash under some MerkleHasher
Implementations§
Source§impl<H: MerkleHash + Default> LeafWithHash<H>
impl<H: MerkleHash + Default> LeafWithHash<H>
Sourcepub fn new(data: Vec<u8>) -> Self
pub fn new(data: Vec<u8>) -> Self
Construct a LeafWithHash by hashing the provided data
Source§impl<H: MerkleHash> LeafWithHash<H>
impl<H: MerkleHash> LeafWithHash<H>
Source§impl<M: NamespaceMerkleHasher<NS_ID_SIZE, Output = NamespacedHash<NS_ID_SIZE>>, const NS_ID_SIZE: usize> LeafWithHash<M>
impl<M: NamespaceMerkleHasher<NS_ID_SIZE, Output = NamespacedHash<NS_ID_SIZE>>, const NS_ID_SIZE: usize> LeafWithHash<M>
Sourcepub fn new_with_namespace(
data: Vec<u8>,
namespace: NamespaceId<NS_ID_SIZE>,
ignore_max_ns: bool,
) -> Self
pub fn new_with_namespace( data: Vec<u8>, namespace: NamespaceId<NS_ID_SIZE>, ignore_max_ns: bool, ) -> Self
Create a new leaf with the provided namespace. Only available if the hasher supports namespacing.
Trait Implementations§
Source§impl<H: Clone + MerkleHash> Clone for LeafWithHash<H>
impl<H: Clone + MerkleHash> Clone for LeafWithHash<H>
Source§fn clone(&self) -> LeafWithHash<H>
fn clone(&self) -> LeafWithHash<H>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<H> Freeze for LeafWithHash<H>
impl<H> RefUnwindSafe for LeafWithHash<H>
impl<H> Send for LeafWithHash<H>
impl<H> Sync for LeafWithHash<H>
impl<H> Unpin for LeafWithHash<H>
impl<H> UnwindSafe for LeafWithHash<H>
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