pub struct Backup {
pub backup_dir: PathBuf,
pub backup_wal_dir: PathBuf,
}
Fields§
§backup_dir: PathBuf
§backup_wal_dir: PathBuf
Implementations§
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(
&self,
resource: &HeldResource,
archive_command: &str,
) -> Result<bool, BackupError>
pub async fn do_configure_archiving( &self, resource: &HeldResource, 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(
&self,
resource: &HeldResource,
) -> Result<PathBuf, BackupError>
pub async fn do_base_backup( &self, resource: &HeldResource, ) -> 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 Freeze for Backup
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
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