Struct tari_mmr::MerkleCheckPoint[][src]

pub struct MerkleCheckPoint { /* fields omitted */ }

Implementations

impl MerkleCheckPoint[src]

pub fn new(
    nodes_added: Vec<Hash>,
    nodes_deleted: Bitmap,
    prev_accumulated_nodes_added_count: u32
) -> MerkleCheckPoint
[src]

pub fn apply<D, B2>(
    &self,
    mmr: &mut MutableMmr<D, B2>
) -> Result<(), MerkleMountainRangeError> where
    D: Digest,
    B2: ArrayLike<Value = Hash>, 
[src]

Apply this checkpoint to the MMR provided. Take care: The deleted set is not compressed after returning from here.

pub fn reset(&mut self)[src]

Resets the current MerkleCheckpoint. The accumulated_nodes_added_count is set to the current MerkleCheckpoints count.

pub fn reset_to(&mut self, checkpoint: &Self)[src]

Resets the current MerkleCheckpoint. The accumulated_nodes_added_count is set to the given MerkleCheckpoints count.

pub fn push_addition(&mut self, hash: Hash)[src]

Add a hash to the set of nodes added.

pub fn push_deletion(&mut self, leaf_index: u32)[src]

Add a a deleted index to the set of deleted nodes.

pub fn nodes_added(&self) -> &Vec<Hash>[src]

Return a reference to the hashes of the nodes added in the checkpoint

pub fn nodes_deleted(&self) -> &Bitmap[src]

Return a reference to the roaring bitmap of nodes that were deleted in this checkpoint

pub fn accumulated_nodes_added_count(&self) -> u32[src]

Return the the total accumulated added node count including this checkpoint

pub fn append(&mut self, mut cp: MerkleCheckPoint)[src]

Merge the provided Merkle checkpoint into the current checkpoint.

pub fn into_parts(self) -> (Vec<Hash>, Bitmap)[src]

Break a checkpoint up into its constituent parts

Trait Implementations

impl Clone for MerkleCheckPoint[src]

impl Debug for MerkleCheckPoint[src]

impl Default for MerkleCheckPoint[src]

impl<'de> Deserialize<'de> for MerkleCheckPoint[src]

impl Eq for MerkleCheckPoint[src]

impl Hash for MerkleCheckPoint[src]

impl PartialEq<MerkleCheckPoint> for MerkleCheckPoint[src]

impl Serialize for MerkleCheckPoint[src]

impl StructuralPartialEq for MerkleCheckPoint[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MessageFormat for T where
    T: DeserializeOwned + Serialize
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,