W3cubDocs

/Rust

Type Alias TryLockResult

pub type TryLockResult<Guard> = Result<Guard, TryLockError<Guard>>;
🔬This is a nightly-only experimental API. (sync_poison_mod #134646)

A type alias for the result of a nonblocking locking method.

For more information, see LockResult. A TryLockResult doesn’t necessarily hold the associated guard in the Err type as the lock might not have been acquired for other reasons.

Aliased Type

pub enum TryLockResult<Guard> {
    Ok(Guard),
    Err(TryLockError<Guard>),
}

Variants

Ok(Guard)
🔬This is a nightly-only experimental API. (sync_poison_mod #134646)

Contains the success value

Err(TryLockError<Guard>)
🔬This is a nightly-only experimental API. (sync_poison_mod #134646)

Contains the error value

© 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/poison/type.TryLockResult.html