pub struct BackupManager { /* private fields */ }Expand description
Manages backup operations for override storage
Implementations§
Source§impl BackupManager
impl BackupManager
Sourcepub fn new(workspace_path: &Path, max_backups: usize) -> Result<Self>
pub fn new(workspace_path: &Path, max_backups: usize) -> Result<Self>
Create a new backup manager
Sourcepub fn create_backup<T: Serialize>(&self, current_state: &T) -> Result<PathBuf>
pub fn create_backup<T: Serialize>(&self, current_state: &T) -> Result<PathBuf>
Create a backup of the current state
Sourcepub fn restore_backup<T: for<'de> Deserialize<'de>>(
&self,
backup_path: &Path,
) -> Result<T>
pub fn restore_backup<T: for<'de> Deserialize<'de>>( &self, backup_path: &Path, ) -> Result<T>
Restore from a backup file
Sourcepub fn get_last_backup(&self) -> Result<Option<BackupInfo>>
pub fn get_last_backup(&self) -> Result<Option<BackupInfo>>
Get the most recent backup
Sourcepub fn list_backups(&self) -> Result<Vec<BackupInfo>>
pub fn list_backups(&self) -> Result<Vec<BackupInfo>>
List all backups, sorted by creation time (newest first)
Sourcepub fn cleanup_old_backups(&self) -> Result<()>
pub fn cleanup_old_backups(&self) -> Result<()>
Clean up old backups, keeping only the most recent N
Sourcepub fn find_last_good_backup(&self) -> Result<Option<BackupInfo>>
pub fn find_last_good_backup(&self) -> Result<Option<BackupInfo>>
Find a known-good backup (one that was marked as validated)
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