[−][src]Struct tari_mmr::pruned_hashset::PrunedHashSet
This is a specialised struct that represents a pruned hash set for Merkle Mountain Ranges.
The basic idea is that when adding a new hash, only the peaks to the left of the new node hierarchy are ever needed. This means that if we don't care about the data earlier than a given leaf node index, n_0, (i.e. we still have the hashes, but can't recalculate them from source), we only need to store the local peaks for the MMR at that time and we can forget about the rest. There will never be a request for a hash other than those at the peaks for the MMR with n_0 leaf nodes.
The awesome thing is that this struct can be dropped into MerkleMountainRange as a backend and it. just. works.
Trait Implementations
impl ArrayLike for PrunedHashSet
[src]
type Error = MerkleMountainRangeError
type Value = Hash
fn len(&self) -> Result<usize, Self::Error>
[src]
fn is_empty(&self) -> Result<bool, Self::Error>
[src]
fn push(&mut self, item: Self::Value) -> Result<usize, Self::Error>
[src]
fn get(&self, index: usize) -> Result<Option<Self::Value>, Self::Error>
[src]
fn get_or_panic(&self, index: usize) -> Self::Value
[src]
fn clear(&mut self) -> Result<(), Self::Error>
[src]
impl Debug for PrunedHashSet
[src]
impl<'_, D, B> TryFrom<&'_ MerkleMountainRange<D, B>> for PrunedHashSet where
D: Digest,
B: ArrayLike<Value = Hash>,
[src]
D: Digest,
B: ArrayLike<Value = Hash>,
type Error = MerkleMountainRangeError
The type returned in the event of a conversion error.
fn try_from(base_mmr: &MerkleMountainRange<D, B>) -> Result<Self, Self::Error>
[src]
Auto Trait Implementations
impl RefUnwindSafe for PrunedHashSet
impl Send for PrunedHashSet
impl Sync for PrunedHashSet
impl Unpin for PrunedHashSet
impl UnwindSafe for PrunedHashSet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,