pub struct BackupManager { /* private fields */ }Expand description
Database backup manager
Implementations§
Source§impl BackupManager
impl BackupManager
Sourcepub fn new(config: BackupConfig) -> Self
pub fn new(config: BackupConfig) -> Self
Create a new backup manager
Sourcepub async fn create_backup(&self, database_url: &str) -> Result<BackupMetadata>
pub async fn create_backup(&self, database_url: &str) -> Result<BackupMetadata>
Create a database backup using pg_dump
Sourcepub async fn list_backups(&self) -> Result<Vec<BackupMetadata>>
pub async fn list_backups(&self) -> Result<Vec<BackupMetadata>>
List all available backups
Sourcepub async fn restore_backup(
&self,
backup_path: &Path,
database_url: &str,
) -> Result<()>
pub async fn restore_backup( &self, backup_path: &Path, database_url: &str, ) -> Result<()>
Restore database from a backup file
Sourcepub async fn cleanup_old_backups(&self) -> Result<Vec<PathBuf>>
pub async fn cleanup_old_backups(&self) -> Result<Vec<PathBuf>>
Clean up old backups based on retention policy
Sourcepub async fn get_total_backup_size(&self) -> Result<u64>
pub async fn get_total_backup_size(&self) -> Result<u64>
Get total size of all backups
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> 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