pub struct SnapshotManager { /* private fields */ }Expand description
Snapshot manager
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub fn new(source_dir: impl AsRef<Path>) -> Result<Self>
pub fn new(source_dir: impl AsRef<Path>) -> Result<Self>
Create a new snapshot manager for the given database directory
Sourcepub fn with_config(
source_dir: impl AsRef<Path>,
config: SnapshotConfig,
) -> Result<Self>
pub fn with_config( source_dir: impl AsRef<Path>, config: SnapshotConfig, ) -> Result<Self>
Create a new snapshot manager with custom configuration
Sourcepub fn create_snapshot(
&mut self,
dest: impl AsRef<Path>,
) -> Result<SnapshotMeta>
pub fn create_snapshot( &mut self, dest: impl AsRef<Path>, ) -> Result<SnapshotMeta>
Create a full snapshot of the database
Sourcepub fn load_snapshot(snapshot_dir: impl AsRef<Path>) -> Result<SnapshotMeta>
pub fn load_snapshot(snapshot_dir: impl AsRef<Path>) -> Result<SnapshotMeta>
Load snapshot metadata from a snapshot directory
Sourcepub fn restore_snapshot(
&self,
snapshot: &SnapshotMeta,
dest: impl AsRef<Path>,
) -> Result<()>
pub fn restore_snapshot( &self, snapshot: &SnapshotMeta, dest: impl AsRef<Path>, ) -> Result<()>
Restore a database from a snapshot
Sourcepub fn list_snapshots(&self) -> &[SnapshotMeta]
pub fn list_snapshots(&self) -> &[SnapshotMeta]
List all tracked snapshots
Sourcepub fn delete_snapshot(&mut self, snapshot_id: &str) -> Result<bool>
pub fn delete_snapshot(&mut self, snapshot_id: &str) -> Result<bool>
Delete a snapshot
Sourcepub fn get_snapshot(&self, id: &str) -> Option<&SnapshotMeta>
pub fn get_snapshot(&self, id: &str) -> Option<&SnapshotMeta>
Get snapshot by ID
Auto Trait Implementations§
impl Freeze for SnapshotManager
impl RefUnwindSafe for SnapshotManager
impl Send for SnapshotManager
impl Sync for SnapshotManager
impl Unpin for SnapshotManager
impl UnwindSafe for SnapshotManager
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