pub struct Backup {
pub backup_dir: PathBuf,
pub backup_wal_dir: PathBuf,
}Fields§
§backup_dir: PathBuf§backup_wal_dir: PathBufImplementations§
source§impl Backup
impl Backup
sourcepub async fn prepare<D: AsRef<Path>>(backup_dir: D) -> Result<Self, BackupError>
pub async fn prepare<D: AsRef<Path>>(backup_dir: D) -> Result<Self, BackupError>
Creates the destination directory and the WAL archive directory if these do not exist, and allocates a temporary location for the base backup.
sourcepub async fn do_configure_archiving<'a>(
&self,
resource: &'a StartupResource<'a>,
archive_command: &str
) -> Result<bool, BackupError>
pub async fn do_configure_archiving<'a>( &self, resource: &'a StartupResource<'a>, archive_command: &str ) -> Result<bool, BackupError>
Configures the cluster for continuous archiving.
Returns a flag indicating if the cluster must be restarted for changes
to take effect. If the cluster is already configured appropriately, this
does nothing (and returns false).
sourcepub async fn do_base_backup<'a>(
&self,
resource: &'a StartupResource<'a>
) -> Result<PathBuf, BackupError>
pub async fn do_base_backup<'a>( &self, resource: &'a StartupResource<'a> ) -> Result<PathBuf, BackupError>
Performs a “base backup” of the cluster.
Returns the directory into which the backup has been created. This is
always a subdirectory of [self.backup_dir].
This must be performed after configuring continuous archiving (see
Backup::do_configure_archiving).
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Backup
impl Send for Backup
impl Sync for Backup
impl Unpin for Backup
impl UnwindSafe for Backup
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