Struct miden_crypto::merkle::MerkleTreeDelta
source · pub struct MerkleTreeDelta { /* private fields */ }
Expand description
[MerkleDelta] stores the differences between the initial and final Merkle tree states.
The differences are represented as follows:
- depth: the depth of the merkle tree.
- cleared_slots: indexes of slots where values were set to [ZERO; 4].
- updated_slots: index-value pairs of slots where values were set to non [ZERO; 4] values.
Implementations§
source§impl MerkleTreeDelta
impl MerkleTreeDelta
pub fn new(depth: u8) -> Self
sourcepub fn depth(&self) -> u8
pub fn depth(&self) -> u8
Returns the depth of the Merkle tree the [MerkleDelta] is associated with.
sourcepub fn cleared_slots(&self) -> &[u64]
pub fn cleared_slots(&self) -> &[u64]
Returns the indexes of slots where values were set to [ZERO; 4].
sourcepub fn updated_slots(&self) -> &[(u64, Word)]
pub fn updated_slots(&self) -> &[(u64, Word)]
Returns the index-value pairs of slots where values were set to non [ZERO; 4] values.
sourcepub fn add_cleared_slot(&mut self, index: u64)
pub fn add_cleared_slot(&mut self, index: u64)
Adds a slot index to the list of cleared slots.
sourcepub fn add_updated_slot(&mut self, index: u64, value: Word)
pub fn add_updated_slot(&mut self, index: u64, value: Word)
Adds a slot index and a value to the list of updated slots.
Trait Implementations§
source§impl Clone for MerkleTreeDelta
impl Clone for MerkleTreeDelta
source§fn clone(&self) -> MerkleTreeDelta
fn clone(&self) -> MerkleTreeDelta
Returns a copy 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 moresource§impl Debug for MerkleTreeDelta
impl Debug for MerkleTreeDelta
source§impl PartialEq for MerkleTreeDelta
impl PartialEq for MerkleTreeDelta
source§fn eq(&self, other: &MerkleTreeDelta) -> bool
fn eq(&self, other: &MerkleTreeDelta) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for MerkleTreeDelta
impl StructuralEq for MerkleTreeDelta
impl StructuralPartialEq for MerkleTreeDelta
Auto Trait Implementations§
impl RefUnwindSafe for MerkleTreeDelta
impl Send for MerkleTreeDelta
impl Sync for MerkleTreeDelta
impl Unpin for MerkleTreeDelta
impl UnwindSafe for MerkleTreeDelta
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