Struct grin_core::core::pmmr::RewindablePMMR
source · pub struct RewindablePMMR<'a, T, B>{ /* private fields */ }
Expand description
Rewindable (but still readonly) view of a PMMR.
Implementations§
source§impl<'a, T, B> RewindablePMMR<'a, T, B>
impl<'a, T, B> RewindablePMMR<'a, T, B>
sourcepub fn new(backend: &'a B) -> RewindablePMMR<'_, T, B>
pub fn new(backend: &'a B) -> RewindablePMMR<'_, T, B>
Build a new readonly PMMR.
sourcepub fn at(backend: &'a B, last_pos: u64) -> RewindablePMMR<'_, T, B>
pub fn at(backend: &'a B, last_pos: u64) -> RewindablePMMR<'_, T, B>
Build a new readonly PMMR pre-initialized to last_pos with the provided backend.
sourcepub fn rewind(&mut self, position: u64) -> Result<(), String>
pub fn rewind(&mut self, position: u64) -> Result<(), String>
Note: We only rewind the last_pos, we do not rewind the (readonly) backend. Prunable backends are not supported here.
sourcepub fn as_readonly(&self) -> ReadonlyPMMR<'a, T, B>
pub fn as_readonly(&self) -> ReadonlyPMMR<'a, T, B>
Allows conversion of a “rewindable” PMMR into a “readonly” PMMR. Intended usage is to create a rewindable PMMR, rewind it, then convert to “readonly” and read from it.
Auto Trait Implementations§
impl<'a, T, B> RefUnwindSafe for RewindablePMMR<'a, T, B>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, B> Send for RewindablePMMR<'a, T, B>
impl<'a, T, B> Sync for RewindablePMMR<'a, T, B>
impl<'a, T, B> Unpin for RewindablePMMR<'a, T, B>where
T: Unpin,
impl<'a, T, B> UnwindSafe for RewindablePMMR<'a, T, B>where
B: RefUnwindSafe,
T: UnwindSafe,
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