Skip to main content

BackupLayoutGuard

Struct BackupLayoutGuard 

Source
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

Source

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.

Source

pub fn root(&self) -> &Path

Return the resolved root protected by this guard.

Source

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.

Source

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.

Source

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. No release operation is exposed until terminal/custody contracts are implemented.

§Errors

Rejects conflicting intent, invalid locations, unsafe records, limits and IO failures.

Trait Implementations§

Source§

impl Debug for BackupLayoutGuard

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.