[−][src]Struct grin_core::core::pmmr::RewindablePMMR
Rewindable (but still readonly) view of a PMMR.
Methods
impl<'a, T, B> RewindablePMMR<'a, T, B> where
T: PMMRable,
B: 'a + Backend<T>,
[src]
T: PMMRable,
B: 'a + Backend<T>,
pub fn new(backend: &'a B) -> RewindablePMMR<T, B>
[src]
Build a new readonly PMMR.
pub fn backend(&'a self) -> &dyn Backend<T>
[src]
Reference to the underlying storage backend.
pub fn at(backend: &'a B, last_pos: u64) -> RewindablePMMR<T, B>
[src]
Build a new readonly PMMR pre-initialized to last_pos with the provided backend.
pub fn rewind(&mut self, position: u64) -> Result<(), String>
[src]
Note: We only rewind the last_pos, we do not rewind the (readonly) backend. Prunable backends are not supported here.
pub fn get_data(&self, pos: u64) -> Option<T::E>
[src]
Get the data element at provided position in the MMR.
pub fn is_empty(&self) -> bool
[src]
Is the MMR empty?
pub fn root(&self) -> Result<Hash, String>
[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.
Auto Trait Implementations
impl<'a, T, B> Send for RewindablePMMR<'a, T, B> where
B: Sync,
T: Send,
B: Sync,
T: Send,
impl<'a, T, B> Unpin for RewindablePMMR<'a, T, B> where
T: Unpin,
T: Unpin,
impl<'a, T, B> Sync for RewindablePMMR<'a, T, B> where
B: Sync,
T: Sync,
B: Sync,
T: Sync,
impl<'a, T, B> UnwindSafe for RewindablePMMR<'a, T, B> where
B: RefUnwindSafe,
T: UnwindSafe,
B: RefUnwindSafe,
T: UnwindSafe,
impl<'a, T, B> RefUnwindSafe for RewindablePMMR<'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