pub struct DatabaseRestore { /* private fields */ }Expand description
One restoration of a closed, consistent backup into a new database incarnation. Persist this request outside the database before calling a provider’s restore entry point, and reuse it only to resolve that same operation after an error. A separate restoration, including another copy of the same backup, requires a fresh target identity.
Implementations§
Source§impl DatabaseRestore
impl DatabaseRestore
Sourcepub fn new(source: DatabaseId) -> VersionResult<Self>
pub fn new(source: DatabaseId) -> VersionResult<Self>
Allocate the new incarnation without opening or changing a database.
Sourcepub fn from_identities(
source: DatabaseId,
target: DatabaseId,
) -> VersionResult<Self>
pub fn from_identities( source: DatabaseId, target: DatabaseId, ) -> VersionResult<Self>
Reconstitute a previously retained request. target must be unique to this restoration and must differ from the backup’s incarnation; callers normally obtain it from new.
pub const fn source(self) -> DatabaseId
pub const fn target(self) -> DatabaseId
Sourcepub fn needs_restore(self, current: DatabaseId) -> VersionResult<bool>
pub fn needs_restore(self, current: DatabaseId) -> VersionResult<bool>
A provider must inspect this before changing any restore state. Seeing the target means the atomic transition already completed; retries must preserve all subsequent transactions.