[−][src]Struct grin_core::core::pmmr::ReadonlyPMMR
Readonly view of a PMMR.
Methods
impl<'a, T, B> ReadonlyPMMR<'a, T, B> where
T: PMMRable,
B: 'a + Backend<T>,
[src]
T: PMMRable,
B: 'a + Backend<T>,
pub fn new(backend: &'a B) -> ReadonlyPMMR<T, B>
[src]
Build a new readonly PMMR.
pub fn at(backend: &'a B, last_pos: u64) -> ReadonlyPMMR<T, B>
[src]
Build a new readonly PMMR pre-initialized to last_pos with the provided backend.
pub fn get_data(&self, pos: u64) -> Option<T::E>
[src]
Get the data element at provided position in the MMR.
pub fn get_hash(&self, pos: u64) -> Option<Hash>
[src]
Get the hash at provided position in the MMR.
pub fn is_empty(&self) -> bool
[src]
Is the MMR empty?
pub fn root(&self) -> Hash
[src]
Computes the root of the MMR. Find all the peaks in the current tree and "bags" them to get a single peak.
pub fn peaks(&self) -> Vec<Hash>
[src]
Returns a vec of the peaks of this MMR.
pub fn unpruned_size(&self) -> u64
[src]
Total size of the tree, including intermediary nodes and ignoring any pruning.
pub fn elements_from_insertion_index(
&self,
index: u64,
max_count: u64
) -> (u64, Vec<T::E>)
[src]
&self,
index: u64,
max_count: u64
) -> (u64, Vec<T::E>)
Helper function which returns un-pruned nodes from the insertion index forward returns last insertion index returned along with data
pub fn get_last_n_insertions(&self, n: u64) -> Vec<(Hash, T::E)>
[src]
Helper function to get the last N nodes inserted, i.e. the last n nodes along the bottom of the tree. May return less than n items if the MMR has been pruned/compacted.
Auto Trait Implementations
impl<'a, T, B> Send for ReadonlyPMMR<'a, T, B> where
B: Sync,
T: Send,
B: Sync,
T: Send,
impl<'a, T, B> Unpin for ReadonlyPMMR<'a, T, B> where
T: Unpin,
T: Unpin,
impl<'a, T, B> Sync for ReadonlyPMMR<'a, T, B> where
B: Sync,
T: Sync,
B: Sync,
T: Sync,
impl<'a, T, B> UnwindSafe for ReadonlyPMMR<'a, T, B> where
B: RefUnwindSafe,
T: UnwindSafe,
B: RefUnwindSafe,
T: UnwindSafe,
impl<'a, T, B> RefUnwindSafe for ReadonlyPMMR<'a, T, B> where
B: RefUnwindSafe,
T: RefUnwindSafe,
B: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<T> Same<T> for T
type Output = T
Should always be Self