pub struct BackupManager { /* private fields */ }Expand description
Manages backup and restore operations
Implementations§
Source§impl BackupManager
impl BackupManager
Sourcepub fn new<P: AsRef<Path>>(source_path: P) -> Self
pub fn new<P: AsRef<Path>>(source_path: P) -> Self
Create a new backup manager for the given database path
Sourcepub fn create_backup<P: AsRef<Path>>(
&self,
destination: P,
) -> Result<BackupMetadata>
pub fn create_backup<P: AsRef<Path>>( &self, destination: P, ) -> Result<BackupMetadata>
Create a backup of the database to the specified destination
The backup includes:
- All SSTable files (*.sst)
- WAL file (wal.log)
- Causal index (causal.index)
- Vector index (vector.index)
- Agent registry (agent_registry.json)
- Metadata manifest (manifest.json)
§Example
ⓘ
let manager = BackupManager::new("./test-db");
let metadata = manager.create_backup("./backups/backup-2025-11-06")?;
println!("Backup created with {} files", metadata.file_count);Sourcepub fn restore_backup<P: AsRef<Path>>(
&self,
backup_path: P,
) -> Result<BackupMetadata>
pub fn restore_backup<P: AsRef<Path>>( &self, backup_path: P, ) -> Result<BackupMetadata>
Sourcepub fn list_backups<P: AsRef<Path>>(
backup_dir: P,
) -> Result<Vec<BackupMetadata>>
pub fn list_backups<P: AsRef<Path>>( backup_dir: P, ) -> Result<Vec<BackupMetadata>>
List all backups in the specified directory
Returns a list of backup metadata sorted by timestamp (newest first).
Auto Trait Implementations§
impl Freeze for BackupManager
impl RefUnwindSafe for BackupManager
impl Send for BackupManager
impl Sync for BackupManager
impl Unpin for BackupManager
impl UnsafeUnpin for BackupManager
impl UnwindSafe for BackupManager
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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