pub struct Checkpoint<C> { /* private fields */ }Expand description
A data structure used to store the information necessary to “rewind” the state of a
BridgeTree to a particular leaf position.
This is needed because the BridgeTree::marked_indices map is a cache of information that
crosses MerkleBridge boundaries, and so it is not sufficient to just truncate the list of
bridges; instead, we use Checkpoint values to be able to rapidly restore the cache to its
previous state.
Implementations§
Source§impl<C> Checkpoint<C>
impl<C> Checkpoint<C>
Sourcepub fn from_parts(
id: C,
bridges_len: usize,
marked: BTreeSet<Position>,
forgotten: BTreeSet<Position>,
) -> Self
pub fn from_parts( id: C, bridges_len: usize, marked: BTreeSet<Position>, forgotten: BTreeSet<Position>, ) -> Self
Creates a new checkpoint from its constituent parts.
Sourcepub fn at_length(bridges_len: usize, id: C) -> Self
pub fn at_length(bridges_len: usize, id: C) -> Self
Creates a new empty checkpoint for the specified BridgeTree state.
Sourcepub fn bridges_len(&self) -> usize
pub fn bridges_len(&self) -> usize
Returns the length of the BridgeTree::prior_bridges vector of the BridgeTree to
which this checkpoint refers.
This is the number of bridges that will be retained in the event of a rewind to this checkpoint.
Trait Implementations§
Source§impl<C: Clone> Clone for Checkpoint<C>
impl<C: Clone> Clone for Checkpoint<C>
Source§fn clone(&self) -> Checkpoint<C>
fn clone(&self) -> Checkpoint<C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: Debug> Debug for Checkpoint<C>
impl<C: Debug> Debug for Checkpoint<C>
Source§impl<C: PartialEq> PartialEq for Checkpoint<C>
impl<C: PartialEq> PartialEq for Checkpoint<C>
impl<C: Eq> Eq for Checkpoint<C>
impl<C> StructuralPartialEq for Checkpoint<C>
Auto Trait Implementations§
impl<C> Freeze for Checkpoint<C>where
C: Freeze,
impl<C> RefUnwindSafe for Checkpoint<C>where
C: RefUnwindSafe,
impl<C> Send for Checkpoint<C>where
C: Send,
impl<C> Sync for Checkpoint<C>where
C: Sync,
impl<C> Unpin for Checkpoint<C>where
C: Unpin,
impl<C> UnwindSafe for Checkpoint<C>where
C: 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