Enum TryLockError

pub enum TryLockError<T>

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.

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

impl<T> Display for TryLockError<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<T> Error for TryLockError<T>

fn cause(&self) -> Option<&dyn Error>

impl<T> From<PoisonError<T>> for TryLockError<T>

fn from(err: PoisonError<T>) -> TryLockError<T>

Auto Trait Implementations

impl<T> Freeze for TryLockError<T> where PoisonError<T>: Freeze,

impl<T> RefUnwindSafe for TryLockError<T> where PoisonError<T>: RefUnwindSafe,

impl<T> Send for TryLockError<T> where PoisonError<T>: Send,

impl<T> Sync for TryLockError<T> where PoisonError<T>: Sync,

impl<T> Unpin for TryLockError<T> where PoisonError<T>: Unpin,

impl<T> UnsafeUnpin for TryLockError<T> where PoisonError<T>: UnsafeUnpin,

impl<T> UnwindSafe for TryLockError<T> where PoisonError<T>: UnwindSafe,

Blanket Implementations

impl<T> Any for TryLockError<T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for TryLockError<T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for TryLockError<T> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for TryLockError<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for TryLockError<T> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for TryLockError<T>

impl<T> ToString for TryLockError<T> where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for TryLockError<T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for TryLockError<T> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for TryLockError<T> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>