Enum std::sync::TryLockError
pub enum TryLockError<T> { Poisoned(PoisonError<T>), WouldBlock, }
An enumeration of possible errors associated with a TryLockResult
which can occur while trying to acquire a lock, from the try_lock
method on a Mutex
or the try_read
and try_write
methods on an RwLock
.
Variants
Poisoned(PoisonError<T>)
The lock could not be acquired because another thread failed while holding the lock.
Tuple Fields of Poisoned
0: PoisonError<T>
WouldBlock
The lock could not be acquired at this time because the operation would otherwise block.
Trait Implementations
impl<T> Debug for TryLockError<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter. Read more
impl<T> Display for TryLockError<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter. Read more
impl<T> Error for TryLockError<T>
fn description(&self) -> &str
use the Display impl or to_string()
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
Returns a stack backtrace, if available, of where this error occurred. Read more
impl<T> From<PoisonError<T>> for TryLockError<T>
fn from(err: PoisonError<T>) -> TryLockError<T>
Performs the conversion.
Auto Trait Implementations
impl<T> RefUnwindSafe for TryLockError<T> where
T: RefUnwindSafe,
impl<T> Send for TryLockError<T> where
T: Send,
impl<T> Sync for TryLockError<T> where
T: Sync,
impl<T> Unpin for TryLockError<T> where
T: Unpin,
impl<T> UnwindSafe for TryLockError<T> where
T: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
pub fn from(t: T) -> T
Performs the conversion.
pub fn into(self) -> U
Performs the conversion.
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
Performs the conversion.
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
Performs the conversion.
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/sync/enum.TryLockError.html