pub struct BackupLayoutGuard { /* private fields */ }Expand description
Exclusive access to an existing resolved backup layout and its dependencies.
All layout writers/removers must use the same parent-side lock. The operator owns the trusted parent; this guard does not fence arbitrary filesystem writers.
Implementations§
Source§impl BackupLayoutGuard
impl BackupLayoutGuard
Sourcepub fn acquire(root: &Path) -> Result<Self, JournalLockError>
pub fn acquire(root: &Path) -> Result<Self, JournalLockError>
Resolve and exclusively lock an existing directory without recreating it.
An explicitly selected root symlink resolves once. The lock remains beside the resolved directory, including after that directory is removed.
§Errors
Returns lock contention, unsafe lock entries, missing roots or IO failures.
Sourcepub fn restore_references(
&self,
) -> Result<RestoreReferencesRecord, PersistenceError>
pub fn restore_references( &self, ) -> Result<RestoreReferencesRecord, PersistenceError>
Read bounded, validated restore dependencies; absent records mean empty.
§Errors
Rejects replaced layouts, unsafe entries, invalid records and IO failures.
Sourcepub fn has_restore_references(&self) -> Result<bool, PersistenceError>
pub fn has_restore_references(&self) -> Result<bool, PersistenceError>
Report retained dependencies even if their external journals are missing.
§Errors
Returns the same conservative read failures as Self::restore_references.
Sourcepub fn retain_restore(
&self,
journal: &Path,
authority: &str,
) -> Result<RestoreReferenceRecord, PersistenceError>
pub fn retain_restore( &self, journal: &Path, authority: &str, ) -> Result<RestoreReferenceRecord, PersistenceError>
Durably retain exact immutable restore intent before publishing its journal.
Resolve the existing journal parent once; the journal itself may be absent. This binds local custody only and does not establish restore authority. Release requires the separate terminal/custody provider boundary.
§Errors
Rejects conflicting intent, invalid locations, unsafe records, limits and IO failures.
Source§impl BackupLayoutGuard
impl BackupLayoutGuard
Sourcepub fn release_restore<P: RestoreTerminalEvidenceProvider>(
&self,
journal_guard: &JournalLock,
provider: &P,
) -> Result<RestoreReferenceReleaseOutcome, RestoreReferenceReleaseError<P::Error>>
pub fn release_restore<P: RestoreTerminalEvidenceProvider>( &self, journal_guard: &JournalLock, provider: &P, ) -> Result<RestoreReferenceReleaseOutcome, RestoreReferenceReleaseError<P::Error>>
Release one exact restore dependency after fresh terminal and command checks.
Keep the original journal mutation guard held. Every declared command sidecar must already exist with its retained inode/device identity and be exclusively quiescent. Guards remain held through reference publication. Failures leave dependencies retained; lost publication responses reconcile by the same call. This performs no application fence release, retry or paid effect.
§Errors
Refuses changed layouts/journals, terminal admission, changed intent, invalid or conflicting custody identities, active descendants and publication failures.