pub struct ConfigLock { /* private fields */ }Expand description
An exclusive, process-safe lock over the configuration file
Hold this across a read-modify-write cycle — from before load_config until after
save_config — so two concurrent alf processes cannot both load the same configuration and
have the later save silently discard the earlier one’s changes.
The lock is advisory: it excludes other holders of this same lock, not an unrelated process or a hand edit of the file. It is released when the guard is dropped, which covers early returns, errors and panics alike, and the operating system releases it if the process dies while holding it, so a crash cannot leave the lock stuck.
Implementations§
Trait Implementations§
Source§impl Drop for ConfigLock
impl Drop for ConfigLock
Auto Trait Implementations§
impl Freeze for ConfigLock
impl RefUnwindSafe for ConfigLock
impl Send for ConfigLock
impl Sync for ConfigLock
impl Unpin for ConfigLock
impl UnsafeUnpin for ConfigLock
impl UnwindSafe for ConfigLock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more