pub trait Mutex {
type Data;
// Required method
fn lock<R>(&mut self, f: impl FnOnce(&mut Self::Data) -> R) -> R;
}
Expand description
Any object implementing this trait guarantees exclusive access to the data contained within the mutex for the duration of the lock.
Required Associated Types§
Required Methods§
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.