pub struct SnapshotManager { /* private fields */ }Expand description
Manages snapshot operations for collections
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub fn new(storage: Box<dyn SnapshotStorage>) -> Self
pub fn new(storage: Box<dyn SnapshotStorage>) -> Self
Create a new snapshot manager with the given storage backend
Sourcepub async fn create_snapshot(
&self,
snapshot_data: SnapshotData,
) -> Result<Snapshot>
pub async fn create_snapshot( &self, snapshot_data: SnapshotData, ) -> Result<Snapshot>
Sourcepub async fn restore_snapshot(&self, id: &str) -> Result<SnapshotData>
pub async fn restore_snapshot(&self, id: &str) -> Result<SnapshotData>
Sourcepub async fn list_snapshots(&self) -> Result<Vec<Snapshot>>
pub async fn list_snapshots(&self) -> Result<Vec<Snapshot>>
List all available snapshots
§Returns
Vec<Snapshot>- List of all snapshot metadata, sorted by creation date (newest first)
Sourcepub async fn list_snapshots_for_collection(
&self,
collection_name: &str,
) -> Result<Vec<Snapshot>>
pub async fn list_snapshots_for_collection( &self, collection_name: &str, ) -> Result<Vec<Snapshot>>
Sourcepub async fn delete_snapshot(&self, id: &str) -> Result<()>
pub async fn delete_snapshot(&self, id: &str) -> Result<()>
Sourcepub async fn get_snapshot_info(&self, id: &str) -> Result<Snapshot>
pub async fn get_snapshot_info(&self, id: &str) -> Result<Snapshot>
Sourcepub async fn cleanup_old_snapshots(
&self,
collection_name: &str,
keep_count: usize,
) -> Result<usize>
pub async fn cleanup_old_snapshots( &self, collection_name: &str, keep_count: usize, ) -> Result<usize>
Sourcepub async fn total_size(&self) -> Result<u64>
pub async fn total_size(&self) -> Result<u64>
Get the total size of all snapshots in bytes
Sourcepub async fn collection_size(&self, collection_name: &str) -> Result<u64>
pub async fn collection_size(&self, collection_name: &str) -> Result<u64>
Get the total size of snapshots for a specific collection
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