Trait lock_order::lock::ReadWriteLock
source · pub trait ReadWriteLock<T>: 'static {
type ReadGuard<'l>: Deref<Target = T>;
type WriteGuard<'l>: DerefMut<Target = T>;
// Required methods
fn read_lock(&self) -> Self::ReadGuard<'_>;
fn write_lock(&self) -> Self::WriteGuard<'_>;
}
Expand description
Abstracts a read write lock (i.e. an RwLock).
Required Associated Types§
sourcetype ReadGuard<'l>: Deref<Target = T>
type ReadGuard<'l>: Deref<Target = T>
The guard type returned when locking for reads (i.e. shared).
sourcetype WriteGuard<'l>: DerefMut<Target = T>
type WriteGuard<'l>: DerefMut<Target = T>
The guard type returned when locking for writes (i.e. exclusive).
Required Methods§
sourcefn write_lock(&self) -> Self::WriteGuard<'_>
fn write_lock(&self) -> Self::WriteGuard<'_>
Locks this lock for writing.
Object Safety§
This trait is not object safe.