Struct maitake_sync::blocking::RwLockWriteGuard
source · pub struct RwLockWriteGuard<'lock, T: ?Sized, Lock: RawRwLock = 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§
source§impl<T, R: ?Sized, Lock> AsRef<R> for RwLockWriteGuard<'_, T, Lock>
impl<T, R: ?Sized, Lock> AsRef<R> for RwLockWriteGuard<'_, T, Lock>
source§impl<T, Lock> Debug for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> Debug for RwLockWriteGuard<'_, T, Lock>
source§impl<T, Lock> Display for RwLockWriteGuard<'_, T, Lock>
impl<T, Lock> Display 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
.