SnapshotManager

Struct SnapshotManager 

Source
pub struct SnapshotManager { /* private fields */ }
Expand description

Manages snapshot operations for collections

Implementations§

Source§

impl SnapshotManager

Source

pub fn new(storage: Box<dyn SnapshotStorage>) -> Self

Create a new snapshot manager with the given storage backend

Source

pub async fn create_snapshot( &self, snapshot_data: SnapshotData, ) -> Result<Snapshot>

Create a snapshot of a collection

§Arguments
  • snapshot_data - The complete snapshot data including vectors and configuration
§Returns
  • Snapshot - Metadata about the created snapshot
Source

pub async fn restore_snapshot(&self, id: &str) -> Result<SnapshotData>

Restore a snapshot by ID

§Arguments
  • id - The unique snapshot identifier
§Returns
  • SnapshotData - The complete snapshot data including vectors and configuration
Source

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)
Source

pub async fn list_snapshots_for_collection( &self, collection_name: &str, ) -> Result<Vec<Snapshot>>

List snapshots for a specific collection

§Arguments
  • collection_name - Name of the collection to filter by
§Returns
  • Vec<Snapshot> - List of snapshots for the specified collection
Source

pub async fn delete_snapshot(&self, id: &str) -> Result<()>

Delete a snapshot by ID

§Arguments
  • id - The unique snapshot identifier
Source

pub async fn get_snapshot_info(&self, id: &str) -> Result<Snapshot>

Get snapshot metadata by ID

§Arguments
  • id - The unique snapshot identifier
§Returns
  • Snapshot - Metadata about the snapshot
Source

pub async fn cleanup_old_snapshots( &self, collection_name: &str, keep_count: usize, ) -> Result<usize>

Delete old snapshots, keeping only the N most recent

§Arguments
  • collection_name - Name of the collection
  • keep_count - Number of recent snapshots to keep
§Returns
  • usize - Number of snapshots deleted
Source

pub async fn total_size(&self) -> Result<u64>

Get the total size of all snapshots in bytes

Source

pub async fn collection_size(&self, collection_name: &str) -> Result<u64>

Get the total size of snapshots for a specific collection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.