pub trait LockAccess<Lock, Inner> {
// Required methods
fn lock_read(&self, lock: &Lock) -> Option<Inner>;
fn lock_write(&self, lock: &Lock) -> Option<Inner>;
}Expand description
Trait for types that can provide lock/unlock behavior Converts from a Lock type to Inner or InnerMut value
Required Methods§
Sourcefn lock_write(&self, lock: &Lock) -> Option<Inner>
fn lock_write(&self, lock: &Lock) -> Option<Inner>
Get mutable access to the inner value
Note: Takes &Lock not &mut Lock because locks like Mutex/RwLock
provide interior mutability - we don’t need exclusive access to the
lock container itself, just to the data inside.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".