pub struct SparseMerkleTree<const D: usize, S: NodeStore> { /* private fields */ }Implementations§
Source§impl<const D: usize, S: NodeStore> SparseMerkleTree<D, S>
impl<const D: usize, S: NodeStore> SparseMerkleTree<D, S>
Sourcepub fn add(
&mut self,
key: [u8; 32],
val: [u8; 32],
) -> Result<(), Error<S::Error>>
pub fn add( &mut self, key: [u8; 32], val: [u8; 32], ) -> Result<(), Error<S::Error>>
Insert a new leaf.
Sourcepub fn update(
&mut self,
key: [u8; 32],
val: [u8; 32],
) -> Result<[u8; 32], Error<S::Error>>
pub fn update( &mut self, key: [u8; 32], val: [u8; 32], ) -> Result<[u8; 32], Error<S::Error>>
Update an existing leaf’s value, returning the previous value.
Auto Trait Implementations§
impl<const D: usize, S> Freeze for SparseMerkleTree<D, S>where
S: Freeze,
impl<const D: usize, S> RefUnwindSafe for SparseMerkleTree<D, S>where
S: RefUnwindSafe,
impl<const D: usize, S> Send for SparseMerkleTree<D, S>where
S: Send,
impl<const D: usize, S> Sync for SparseMerkleTree<D, S>where
S: Sync,
impl<const D: usize, S> Unpin for SparseMerkleTree<D, S>where
S: Unpin,
impl<const D: usize, S> UnwindSafe for SparseMerkleTree<D, S>where
S: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more