pub struct DagRecoveryManager { /* private fields */ }Expand description
Manages checkpoint snapshots and provides recovery.
Snapshots are held in memory. Persistence to disk or object storage is the caller’s responsibility.
Implementations§
Source§impl DagRecoveryManager
impl DagRecoveryManager
Sourcepub fn with_snapshots(snapshots: Vec<DagCheckpointSnapshot>) -> Self
pub fn with_snapshots(snapshots: Vec<DagCheckpointSnapshot>) -> Self
Creates a recovery manager pre-loaded with snapshots.
Sourcepub fn add_snapshot(&mut self, snapshot: DagCheckpointSnapshot)
pub fn add_snapshot(&mut self, snapshot: DagCheckpointSnapshot)
Adds a snapshot to the manager.
Sourcepub fn recover_latest(&self) -> Result<RecoveredDagState, DagError>
pub fn recover_latest(&self) -> Result<RecoveredDagState, DagError>
Recovers from the latest (highest checkpoint_id) snapshot.
§Errors
Returns DagError::CheckpointNotFound if no snapshots exist.
Sourcepub fn recover_by_id(
&self,
checkpoint_id: u64,
) -> Result<RecoveredDagState, DagError>
pub fn recover_by_id( &self, checkpoint_id: u64, ) -> Result<RecoveredDagState, DagError>
Recovers from a specific checkpoint by ID.
§Errors
Returns DagError::CheckpointNotFound if the checkpoint ID
does not exist.
Sourcepub fn snapshot_count(&self) -> usize
pub fn snapshot_count(&self) -> usize
Returns the number of stored snapshots.
Sourcepub fn has_snapshots(&self) -> bool
pub fn has_snapshots(&self) -> bool
Returns whether any snapshots are available.
Trait Implementations§
Source§impl Debug for DagRecoveryManager
impl Debug for DagRecoveryManager
Auto Trait Implementations§
impl Freeze for DagRecoveryManager
impl RefUnwindSafe for DagRecoveryManager
impl Send for DagRecoveryManager
impl Sync for DagRecoveryManager
impl Unpin for DagRecoveryManager
impl UnsafeUnpin for DagRecoveryManager
impl UnwindSafe for DagRecoveryManager
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.