Skip to main content

LockWithPoisonBehavior

Trait LockWithPoisonBehavior 

Source
pub trait LockWithPoisonBehavior<T>
where T: ?Sized,
{ type Guard<'g> where Self: 'g; // Required methods fn lock_with_poison_behavior<F>(&self, if_poisoned: F) -> Self::Guard<'_> where F: FnOnce(&mut Self::Guard<'_>), T: 'static; fn lock_ignore_poison(&self) -> Self::Guard<'_>; fn lock_clear_poison(&self) -> Self::Guard<'_>; }

Required Associated Types§

Source

type Guard<'g> where Self: 'g

Required Methods§

Source

fn lock_with_poison_behavior<F>(&self, if_poisoned: F) -> Self::Guard<'_>
where F: FnOnce(&mut Self::Guard<'_>), T: 'static,

Source

fn lock_ignore_poison(&self) -> Self::Guard<'_>

Source

fn lock_clear_poison(&self) -> Self::Guard<'_>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> LockWithPoisonBehavior<T> for Arc<Mutex<T>>
where T: ?Sized,

Source§

type Guard<'g> = MutexGuard<'g, T> where Arc<Mutex<T>>: 'g

Source§

fn lock_with_poison_behavior<F>( &self, if_poisoned: F, ) -> <Arc<Mutex<T>> as LockWithPoisonBehavior<T>>::Guard<'_>
where F: FnOnce(&mut <Arc<Mutex<T>> as LockWithPoisonBehavior<T>>::Guard<'_>), T: 'static,

Source§

fn lock_ignore_poison( &self, ) -> <Arc<Mutex<T>> as LockWithPoisonBehavior<T>>::Guard<'_>

Source§

fn lock_clear_poison( &self, ) -> <Arc<Mutex<T>> as LockWithPoisonBehavior<T>>::Guard<'_>

Implementors§