pub struct MutationLock { /* private fields */ }Expand description
An exclusive ownership record for one installation domain.
The lock is fail-closed: ambiguous, malformed, oversized, or otherwise
unreadable records never trigger automatic removal. There is deliberately
no automatic stale-lock recovery based on PID liveness alone, because PID
reuse cannot prove process identity across the public contract. Operators
establish ownership out-of-band (for example via MutationLock::inspect
plus deployment-specific process evidence) and remove a stale record
manually.
Implementations§
Source§impl MutationLock
impl MutationLock
Sourcepub fn acquire(
root: &Path,
product: &ProductId,
release: &ReleaseId,
) -> Result<Self>
pub fn acquire( root: &Path, product: &ProductId, release: &ReleaseId, ) -> Result<Self>
Acquires the installation-root lock using create-new filesystem semantics.
Sourcepub fn inspect(root: &Path) -> Result<LockStatus>
pub fn inspect(root: &Path) -> Result<LockStatus>
Inspects the lock record without acquiring or removing it.
Returns LockStatus::Available when no record exists,
LockStatus::Held when a bounded readable record exists, and
LockStatus::Malformed when the record is missing, unreadable,
oversized, or non-UTF-8. This function never deletes anything.