pub struct PoisonGuard<'a, G> { /* private fields */ }Expand description
An RAII guard for a Poisonable. When this structure is dropped (falls
out of scope), the lock will be unlocked.
The data protected by the underlying lock can be accessed through this
guard via its Deref and DerefMut implementations.
This method is created by calling the lock, try_lock, read, and
try_read methods on Poisonable
This guard holds a ThreadKey, so it is not possible to lock anything
else until this guard is dropped. The ThreadKey can be reacquired by
calling Poisonable::unlock, or Poisonable::unlock_read.
Trait Implementations§
Source§impl<Guard> AsMut<Guard> for PoisonGuard<'_, Guard>
impl<Guard> AsMut<Guard> for PoisonGuard<'_, Guard>
Source§fn as_mut(&mut self) -> &mut Guard
fn as_mut(&mut self) -> &mut Guard
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<Guard> AsRef<Guard> for PoisonGuard<'_, Guard>
impl<Guard> AsRef<Guard> for PoisonGuard<'_, Guard>
Source§impl<Guard: Debug> Debug for PoisonGuard<'_, Guard>
impl<Guard: Debug> Debug for PoisonGuard<'_, Guard>
Source§impl<T, Guard: Deref<Target = T>> Deref for PoisonGuard<'_, Guard>
impl<T, Guard: Deref<Target = T>> Deref for PoisonGuard<'_, Guard>
Source§impl<T, Guard: DerefMut<Target = T>> DerefMut for PoisonGuard<'_, Guard>
impl<T, Guard: DerefMut<Target = T>> DerefMut for PoisonGuard<'_, Guard>
Source§impl<Guard: Display> Display for PoisonGuard<'_, Guard>
impl<Guard: Display> Display for PoisonGuard<'_, Guard>
Source§impl<Guard: Hash> Hash for PoisonGuard<'_, Guard>
impl<Guard: Hash> Hash for PoisonGuard<'_, Guard>
Auto Trait Implementations§
impl<'a, G> Freeze for PoisonGuard<'a, G>where
G: Freeze,
impl<'a, G> RefUnwindSafe for PoisonGuard<'a, G>where
G: RefUnwindSafe,
impl<'a, G> !Send for PoisonGuard<'a, G>
impl<'a, G> Sync for PoisonGuard<'a, G>where
G: Sync,
impl<'a, G> Unpin for PoisonGuard<'a, G>where
G: Unpin,
impl<'a, G> UnwindSafe for PoisonGuard<'a, G>where
G: UnwindSafe,
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