Struct maitake::sync::spin::RwLockWriteGuard
source · pub struct RwLockWriteGuard<'lock, T>where
T: ?Sized,{ /* 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> AsRef<R> for RwLockWriteGuard<'_, T>
impl<T, R> AsRef<R> for RwLockWriteGuard<'_, T>
source§impl<T> Debug for RwLockWriteGuard<'_, T>
impl<T> Debug for RwLockWriteGuard<'_, T>
source§impl<T> Deref for RwLockWriteGuard<'_, T>where
T: ?Sized,
impl<T> Deref for RwLockWriteGuard<'_, T>where
T: ?Sized,
source§impl<T> DerefMut for RwLockWriteGuard<'_, T>where
T: ?Sized,
impl<T> DerefMut for RwLockWriteGuard<'_, T>where
T: ?Sized,
source§impl<T> Display for RwLockWriteGuard<'_, T>
impl<T> Display for RwLockWriteGuard<'_, T>
source§impl<T> Drop for RwLockWriteGuard<'_, T>where
T: ?Sized,
impl<T> Drop for RwLockWriteGuard<'_, T>where
T: ?Sized,
impl<T> Send for RwLockWriteGuard<'_, T>
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> Sync for RwLockWriteGuard<'_, T>
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
.