Struct maitake::sync::blocking::RwLockWriteGuard
pub struct RwLockWriteGuard<'lock, T, Lock = RwSpinlock>{ /* private fields */ }
Expand description
An RAII implementation of a “scoped write lock” of a RwLock
. When this
structure is dropped (falls out of scope), the lock will be unlocked.
The data protected by the RwLock
can be mutably accessed through this
guard via its Deref
and DerefMut
implementations.
This structure is created by the write
and try_write
methods on
RwLock
.
Trait Implementations§
§impl<T, R, Lock> AsRef<R> for RwLockWriteGuard<'_, T, Lock>
impl<T, R, Lock> AsRef<R> for RwLockWriteGuard<'_, T, Lock>
§impl<T, Lock> Debug for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> Debug for RwLockWriteGuard<'_, T, Lock>
§impl<T, Lock> Deref for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> Deref for RwLockWriteGuard<'_, T, Lock>
§impl<T, Lock> DerefMut for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> DerefMut for RwLockWriteGuard<'_, T, Lock>
§fn deref_mut(&mut self) -> &mut <RwLockWriteGuard<'_, T, Lock> as Deref>::Target
fn deref_mut(&mut self) -> &mut <RwLockWriteGuard<'_, T, Lock> as Deref>::Target
§impl<T, Lock> Display for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> Display for RwLockWriteGuard<'_, T, Lock>
§impl<T, Lock> Drop for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> Drop for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> Send for RwLockWriteGuard<'_, T, Lock>
A RwLockWriteGuard
is only Send
if T
is Send
and Sync
,
because it can be used to move a T
across thread boundaries, as it
allows mutable access to the T
that can be used with
core::mem::replace
or core::mem::swap
.
impl<T, Lock> Sync for RwLockWriteGuard<'_, T, Lock>
A RwLockWriteGuard
is only Sync
if T
is Send
and Sync
,
because it can be used to move a T
across thread boundaries, as it
allows mutable access to the T
that can be used with
core::mem::replace
or core::mem::swap
.