pub struct MutationSet<const DEPTH: u8, K: Eq + Hash, V> { /* private fields */ }Expand description
Represents a group of prospective mutations to a SparseMerkleTree, created by
SparseMerkleTree::compute_mutations(), and that can be applied with
SparseMerkleTree::apply_mutations().
Implementations§
Source§impl<const DEPTH: u8, K: Eq + Hash, V> MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K: Eq + Hash, V> MutationSet<DEPTH, K, V>
Sourcepub fn root(&self) -> RpoDigest
pub fn root(&self) -> RpoDigest
Returns the SMT root that was calculated during SparseMerkleTree::compute_mutations(). See
that method for more information.
Sourcepub fn node_mutations(&self) -> &BTreeMap<NodeIndex, NodeMutation>
pub fn node_mutations(&self) -> &BTreeMap<NodeIndex, NodeMutation>
Returns the set of inner nodes that need to be removed or added.
Trait Implementations§
Source§impl<const DEPTH: u8, K: Clone + Eq + Hash, V: Clone> Clone for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K: Clone + Eq + Hash, V: Clone> Clone for MutationSet<DEPTH, K, V>
Source§fn clone(&self) -> MutationSet<DEPTH, K, V>
fn clone(&self) -> MutationSet<DEPTH, K, V>
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<const DEPTH: u8, K: Default + Eq + Hash, V: Default> Default for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K: Default + Eq + Hash, V: Default> Default for MutationSet<DEPTH, K, V>
Source§fn default() -> MutationSet<DEPTH, K, V>
fn default() -> MutationSet<DEPTH, K, V>
Returns the “default value” for a type. Read more
Source§impl<const DEPTH: u8, K: Deserializable + Ord + Eq + Hash, V: Deserializable> Deserializable for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K: Deserializable + Ord + Eq + Hash, V: Deserializable> Deserializable for MutationSet<DEPTH, K, V>
Source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into Self, and returns the result. Read moreSource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl<const DEPTH: u8, K: PartialEq + Eq + Hash, V: PartialEq> PartialEq for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K: PartialEq + Eq + Hash, V: PartialEq> PartialEq for MutationSet<DEPTH, K, V>
Source§impl<const DEPTH: u8, K: Serializable + Eq + Hash, V: Serializable> Serializable for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K: Serializable + Eq + Hash, V: Serializable> Serializable for MutationSet<DEPTH, K, V>
Source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self into bytes and writes these bytes into the target.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl<const DEPTH: u8, K: Eq + Eq + Hash, V: Eq> Eq for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K: Eq + Hash, V> StructuralPartialEq for MutationSet<DEPTH, K, V>
Auto Trait Implementations§
impl<const DEPTH: u8, K, V> Freeze for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K, V> RefUnwindSafe for MutationSet<DEPTH, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<const DEPTH: u8, K, V> Send for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K, V> Sync for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K, V> Unpin for MutationSet<DEPTH, K, V>
impl<const DEPTH: u8, K, V> UnwindSafe for MutationSet<DEPTH, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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