pub struct CheckpointManager { /* private fields */ }Implementations§
Source§impl CheckpointManager
impl CheckpointManager
Sourcepub fn load(
storage_path: PathBuf,
policy: RetentionPolicy,
) -> Result<Self, ManagerLoadError>
pub fn load( storage_path: PathBuf, policy: RetentionPolicy, ) -> Result<Self, ManagerLoadError>
Given a storage path, load headers from the available checkpoints into memory
Sourcepub fn is_ready(&self, timestamp: &DateTime<Utc>) -> bool
pub fn is_ready(&self, timestamp: &DateTime<Utc>) -> bool
Check if the manager is ready to create a new checkpoint given the current timestamp
pub fn cull(&mut self)
Sourcepub fn cull_timestamp(&mut self, timestamp: DateTime<Utc>)
pub fn cull_timestamp(&mut self, timestamp: DateTime<Utc>)
Remove the oldest checkpoints that are no longer needed
Sourcepub fn policy(&self) -> &RetentionPolicy
pub fn policy(&self) -> &RetentionPolicy
Get the retention policy used by this manager
Sourcepub fn checkpoints(&self) -> impl Iterator<Item = &(CheckpointHeader, PathBuf)>
pub fn checkpoints(&self) -> impl Iterator<Item = &(CheckpointHeader, PathBuf)>
Iterate the checkpoints stored by this manager
Trait Implementations§
Source§impl Clone for CheckpointManager
impl Clone for CheckpointManager
Source§fn clone(&self) -> CheckpointManager
fn clone(&self) -> CheckpointManager
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 Debug for CheckpointManager
impl Debug for CheckpointManager
Auto Trait Implementations§
impl Freeze for CheckpointManager
impl RefUnwindSafe for CheckpointManager
impl Send for CheckpointManager
impl Sync for CheckpointManager
impl Unpin for CheckpointManager
impl UnwindSafe for CheckpointManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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