ReentrantLockGuard in std::sync - Rust (original) (raw)
Struct ReentrantLockGuard
pub struct ReentrantLockGuard<'a, T: ?Sized + 'a> { /* private fields */ }🔬This is a nightly-only experimental API. (reentrant_lock #121440)
Expand description
An RAII implementation of a “scoped lock” of a re-entrant lock. When this structure is dropped (falls out of scope), the lock will be unlocked.
The data protected by the mutex can be accessed through this guard via itsDeref implementation.
This structure is created by the lock method onReentrantLock.
§Mutability
Unlike MutexGuard, ReentrantLockGuard does not implement DerefMut, because implementation of the trait would violate Rust’s reference aliasing rules. Use interior mutability (usually RefCell) in order to mutate the guarded data.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of[From](../convert/trait.From.html "trait std::convert::From")<T> for U chooses to do.
🔬This is a nightly-only experimental API. (arbitrary_self_types #44874)
The target type on which the method may be called.
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.