pub struct BackupManager { /* private fields */ }Expand description
Backup manager
Manages package backups including creation, verification, restoration, and automated rotation based on retention policies.
Implementations§
Source§impl BackupManager
impl BackupManager
Sourcepub fn new(config: BackupConfig) -> Self
pub fn new(config: BackupConfig) -> Self
Create a new backup manager
Sourcepub fn create_backup(
&mut self,
package_id: &str,
version: &str,
data: &[u8],
) -> Result<String, TorshError>
pub fn create_backup( &mut self, package_id: &str, version: &str, data: &[u8], ) -> Result<String, TorshError>
Create a backup
Sourcepub fn restore_backup(&self, backup_id: &str) -> Result<Vec<u8>, TorshError>
pub fn restore_backup(&self, backup_id: &str) -> Result<Vec<u8>, TorshError>
Restore from backup
Sourcepub fn verify_backup(&self, backup_id: &str) -> VerificationResult
pub fn verify_backup(&self, backup_id: &str) -> VerificationResult
Verify backup integrity
Sourcepub fn create_recovery_point(
&mut self,
package_id: &str,
version: &str,
description: String,
) -> Result<String, TorshError>
pub fn create_recovery_point( &mut self, package_id: &str, version: &str, description: String, ) -> Result<String, TorshError>
Create a recovery point
Sourcepub fn restore_to_recovery_point(
&self,
recovery_point_id: &str,
) -> Result<Vec<u8>, TorshError>
pub fn restore_to_recovery_point( &self, recovery_point_id: &str, ) -> Result<Vec<u8>, TorshError>
Restore to recovery point
Sourcepub fn list_backups(&self, package_id: &str) -> Vec<&BackupMetadata>
pub fn list_backups(&self, package_id: &str) -> Vec<&BackupMetadata>
List all backups for a package
Sourcepub fn get_statistics(&self) -> &BackupStatistics
pub fn get_statistics(&self) -> &BackupStatistics
Get backup statistics
Sourcepub fn delete_backup(&mut self, backup_id: &str) -> Result<(), TorshError>
pub fn delete_backup(&mut self, backup_id: &str) -> Result<(), TorshError>
Delete a backup
Sourcepub fn apply_retention_policy(&mut self) -> Result<(), TorshError>
pub fn apply_retention_policy(&mut self) -> Result<(), TorshError>
Apply retention policy
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§
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