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 dependency after fresh in-process terminal qualification.
Hold the original journal mutation guard. Retained command sidecars reject even after their holders exit. Their absence does not qualify command-free execution: the provider must establish that from its complete original record. Recheck journal bytes and sidecars before durable publication. Lost publication responses reconcile by this same effect-free call; no fence is released.
§Errors
Rejects retired command evidence, terminal admission, changed originals, unsafe layouts and publication failure, preserving unfinished dependencies.