pub struct CheckpointStore { /* private fields */ }Expand description
Workspace-wide checkpoint store.
Stores named snapshots of file contents. On create, reads the listed files
(or all tracked files from a BackupStore if the list is empty). On restore,
overwrites files with stored content. Checkpoints can be cleaned up by TTL.
Implementations§
Source§impl CheckpointStore
impl CheckpointStore
pub fn new() -> Self
Sourcepub fn create(
&mut self,
name: &str,
files: Vec<PathBuf>,
backup_store: &BackupStore,
) -> Result<CheckpointInfo, AftError>
pub fn create( &mut self, name: &str, files: Vec<PathBuf>, backup_store: &BackupStore, ) -> Result<CheckpointInfo, AftError>
Create a checkpoint by reading the given files.
If files is empty, snapshots all tracked files from the BackupStore.
Overwrites any existing checkpoint with the same name.
Sourcepub fn restore(&self, name: &str) -> Result<CheckpointInfo, AftError>
pub fn restore(&self, name: &str) -> Result<CheckpointInfo, AftError>
Restore a checkpoint by overwriting files with stored content.
Sourcepub fn list(&self) -> Vec<CheckpointInfo>
pub fn list(&self) -> Vec<CheckpointInfo>
List all checkpoints with metadata.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CheckpointStore
impl RefUnwindSafe for CheckpointStore
impl Send for CheckpointStore
impl Sync for CheckpointStore
impl Unpin for CheckpointStore
impl UnsafeUnpin for CheckpointStore
impl UnwindSafe for CheckpointStore
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> 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