Enum CrossProcessLockState
pub enum CrossProcessLockState {
Clean(CrossProcessLockGuard),
Dirty(CrossProcessLockGuard),
}Expand description
Represent a successful result of a locking attempt, either by
CrossProcessLock::try_lock_once or CrossProcessLock::spin_lock.
Variants§
Clean(CrossProcessLockGuard)
The lock has been obtained successfully, all good.
Dirty(CrossProcessLockGuard)
The lock has been obtained successfully, but the lock is dirty!
This holder has obtained this cross-process lock once, then another holder has obtained this cross-process lock before this holder obtained it again. The lock is marked as dirty. It means the value protected by the cross-process lock may need to be reloaded if synchronisation is important.
Until CrossProcessLock::clear_dirty is called,
CrossProcessLock::is_dirty, CrossProcessLock::try_lock_once and
CrossProcessLock::spin_lock will report the lock as dirty. Put it
differently: dirty once, dirty forever, unless
CrossProcessLock::clear_dirty is called.
Implementations§
§impl CrossProcessLockState
impl CrossProcessLockState
pub fn into_guard(self) -> CrossProcessLockGuard
pub fn into_guard(self) -> CrossProcessLockGuard
Map this value into the inner CrossProcessLockGuard.
pub fn map<F, G>(self, mapper: F) -> MappedCrossProcessLockState<G>where
F: FnOnce(CrossProcessLockGuard) -> G,
pub fn map<F, G>(self, mapper: F) -> MappedCrossProcessLockState<G>where
F: FnOnce(CrossProcessLockGuard) -> G,
Map this CrossProcessLockState into a
MappedCrossProcessLockState.
This is helpful when one wants to create its own wrapper over
CrossProcessLockGuard.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrossProcessLockState
impl RefUnwindSafe for CrossProcessLockState
impl Send for CrossProcessLockState
impl Sync for CrossProcessLockState
impl Unpin for CrossProcessLockState
impl UnwindSafe for CrossProcessLockState
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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