Struct cancel_safe_futures::sync::PoisonError
source · pub struct PoisonError<T> { /* private fields */ }
Available on crate feature
std
only.Expand description
A type of error which can be returned whenever a RobustMutex
is acquired.
RobustMutex
es are poisoned whenever a thread panics or a cancellation happens while the lock
is held. The precise semantics for when a lock is poisoned is documented on RobustMutex
, but
once a lock is poisoned then all future acquisitions will return this error.
Implementations§
source§impl<T> PoisonError<T>
impl<T> PoisonError<T>
sourcepub fn is_panic(&self) -> bool
pub fn is_panic(&self) -> bool
Returns true if this error indicates that the lock was poisoned by a panic from another task.
sourcepub fn is_cancel(&self) -> bool
pub fn is_cancel(&self) -> bool
Returns true if this error indicates that the lock was poisoned by an early cancellation.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes this error indicating that a lock is poisoned, returning the underlying guard to allow access regardless.
Trait Implementations§
source§impl<T> Debug for PoisonError<T>
impl<T> Debug for PoisonError<T>
source§impl<T> Display for PoisonError<T>
impl<T> Display for PoisonError<T>
source§impl<T> Error for PoisonError<T>
impl<T> Error for PoisonError<T>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<T> From<PoisonError<T>> for TryLockError<T>
impl<T> From<PoisonError<T>> for TryLockError<T>
source§fn from(error: PoisonError<T>) -> TryLockError<T>
fn from(error: PoisonError<T>) -> TryLockError<T>
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for PoisonError<T>where
T: Freeze,
impl<T> RefUnwindSafe for PoisonError<T>where
T: RefUnwindSafe,
impl<T> Send for PoisonError<T>where
T: Send,
impl<T> Sync for PoisonError<T>where
T: Sync,
impl<T> Unpin for PoisonError<T>where
T: Unpin,
impl<T> UnwindSafe for PoisonError<T>where
T: 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