pub struct RewindablePMMR<'a, T, B>
where T: PMMRable, B: Backend<T>,
{ /* private fields */ }
Expand description

Rewindable (but still readonly) view of a PMMR.

Implementations§

source§

impl<'a, T, B> RewindablePMMR<'a, T, B>
where T: PMMRable, B: 'a + Backend<T>,

source

pub fn new(backend: &'a B) -> RewindablePMMR<'_, T, B>

Build a new readonly PMMR.

source

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.

source

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.

source

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>

§

impl<'a, T, B> Send for RewindablePMMR<'a, T, B>
where B: Sync, T: Send,

§

impl<'a, T, B> Sync for RewindablePMMR<'a, T, B>
where B: Sync, T: Sync,

§

impl<'a, T, B> Unpin for RewindablePMMR<'a, T, B>
where T: Unpin,

§

impl<'a, T, B> UnwindSafe for RewindablePMMR<'a, T, B>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UnsafeAny for T
where T: Any,