pub struct BackupManager { /* private fields */ }
Expand description
Backup manager for Things 3 database
Implementations§
Source§impl BackupManager
impl BackupManager
Sourcepub fn new(config: ThingsConfig) -> Self
pub fn new(config: ThingsConfig) -> Self
Create a new backup manager
Sourcepub async fn create_backup(
&self,
backup_dir: &Path,
description: Option<&str>,
) -> Result<BackupMetadata>
pub async fn create_backup( &self, backup_dir: &Path, description: Option<&str>, ) -> Result<BackupMetadata>
Create a backup of the Things 3 database
Sourcepub async fn restore_backup(&self, backup_path: &Path) -> Result<()>
pub async fn restore_backup(&self, backup_path: &Path) -> Result<()>
Restore from a backup
Sourcepub fn list_backups(&self, backup_dir: &Path) -> Result<Vec<BackupMetadata>>
pub fn list_backups(&self, backup_dir: &Path) -> Result<Vec<BackupMetadata>>
List available backups in a directory
Sourcepub fn get_backup_metadata(&self, backup_path: &Path) -> Result<BackupMetadata>
pub fn get_backup_metadata(&self, backup_path: &Path) -> Result<BackupMetadata>
Get backup metadata from a backup file
Sourcepub fn delete_backup(&self, backup_path: &Path) -> Result<()>
pub fn delete_backup(&self, backup_path: &Path) -> Result<()>
Delete a backup and its metadata
Sourcepub fn cleanup_old_backups(
&self,
backup_dir: &Path,
keep_count: usize,
) -> Result<usize>
pub fn cleanup_old_backups( &self, backup_dir: &Path, keep_count: usize, ) -> Result<usize>
Clean up old backups, keeping only the specified number
Sourcepub fn verify_backup(&self, backup_path: &Path) -> Result<bool>
pub fn verify_backup(&self, backup_path: &Path) -> Result<bool>
Verify a backup by checking if it can be opened
Sourcepub fn get_backup_stats(&self, backup_dir: &Path) -> Result<BackupStats>
pub fn get_backup_stats(&self, backup_dir: &Path) -> Result<BackupStats>
Get backup statistics
Auto Trait Implementations§
impl Freeze for BackupManager
impl RefUnwindSafe for BackupManager
impl Send for BackupManager
impl Sync for BackupManager
impl Unpin for BackupManager
impl UnwindSafe for BackupManager
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
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