# 1.0.0[−][src]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.

`WouldBlock`

The lock could not be acquired at this time because the operation would otherwise block.

## Trait Implementations

### `impl<T> Debug for TryLockError<T>`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl<T> Display for TryLockError<T>`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl<T> Error for TryLockError<T>`[src]

#### `fn description(&self) -> &str`[src]

This method is soft-deprecated. Read more

#### `fn cause(&self) -> Option<&dyn Error>`[src]

Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

The lower-level cause of this error, if any. Read more

#### `fn source(&self) -> Option<&(dyn Error + 'static)>`1.30.0[src]

The lower-level source of this error, if any. Read more

#### `fn backtrace(&self) -> Option<&Backtrace>`[src]

🔬 This is a nightly-only experimental API. (`backtrace` #53487)

Returns a stack backtrace, if available, of where this error occurred. Read more

### `impl<T> From<PoisonError<T>> for TryLockError<T>`[src]

#### `fn from(err: PoisonError<T>) -> TryLockError<T>`[src]

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> Any for T where
T: 'static + ?Sized,` [src]

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

####
ⓘImportant traits for &'_ mut F

### Important traits for &'_ mut F

`impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, R: Read + ?Sized> Read for &'_ mut Rimpl<'_, W: Write + ?Sized> Write for &'_ mut W`
`fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

####
ⓘImportant traits for &'_ mut F

### Important traits for &'_ mut F

`impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, R: Read + ?Sized> Read for &'_ mut Rimpl<'_, W: Write + ?Sized> Write for &'_ mut W`
`fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

### `impl<T> From<T> for T`[src]

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `fn into(self) -> U`[src]

Performs the conversion.

### `impl<T> ToString for T where
T: Display + ?Sized,` [src]

#### `default fn to_string(&self) -> String`[src]

Converts the given value to a `String`. Read more

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.