pub trait Lock<T> {
// Required methods
fn new(b: T) -> Self;
fn into_inner(self) -> T;
fn with_lock<R>(&self, f: impl FnOnce(&mut T) -> R) -> R;
}Expand description
A type that allows mutable access to its inner value via interior mutability.
Required Methods§
Sourcefn into_inner(self) -> T
fn into_inner(self) -> T
Consume the lock and return the inner value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.