pub struct SnapshotStore {
pub snapshots_dir: PathBuf,
}Expand description
Store for managing snapshots
Fields§
§snapshots_dir: PathBufDirectory where snapshots are stored
Implementations§
Source§impl SnapshotStore
impl SnapshotStore
Sourcepub fn ensure_dir(&self) -> Result<()>
pub fn ensure_dir(&self) -> Result<()>
Ensure the snapshots directory exists
Sourcepub fn snapshot_path(&self, snapshot_id: &str) -> PathBuf
pub fn snapshot_path(&self, snapshot_id: &str) -> PathBuf
Get the path for a snapshot file
Sourcepub fn load_by_name(&self, name: &str) -> Result<Snapshot>
pub fn load_by_name(&self, name: &str) -> Result<Snapshot>
Load a snapshot by name
Sourcepub fn delete_by_name(&self, name: &str) -> Result<()>
pub fn delete_by_name(&self, name: &str) -> Result<()>
Delete a snapshot by name
Sourcepub fn exists_by_name(&self, name: &str) -> bool
pub fn exists_by_name(&self, name: &str) -> bool
Check if a snapshot with the given name exists
Sourcepub fn list_names(&self) -> Result<Vec<String>>
pub fn list_names(&self) -> Result<Vec<String>>
Get all snapshot names
Trait Implementations§
Source§impl Clone for SnapshotStore
impl Clone for SnapshotStore
Source§fn clone(&self) -> SnapshotStore
fn clone(&self) -> SnapshotStore
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 moreAuto Trait Implementations§
impl Freeze for SnapshotStore
impl RefUnwindSafe for SnapshotStore
impl Send for SnapshotStore
impl Sync for SnapshotStore
impl Unpin for SnapshotStore
impl UnwindSafe for SnapshotStore
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