Struct maitake_sync::spin::RwLockWriteGuard
source · pub struct RwLockWriteGuard<'lock, 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: ?Sized> AsRef<R> for RwLockWriteGuard<'_, T>
impl<T, R: ?Sized> AsRef<R> for RwLockWriteGuard<'_, T>
source§impl<T: ?Sized> Deref for RwLockWriteGuard<'_, T>
impl<T: ?Sized> Deref for RwLockWriteGuard<'_, T>
source§impl<T: ?Sized> DerefMut for RwLockWriteGuard<'_, T>
impl<T: ?Sized> DerefMut for RwLockWriteGuard<'_, T>
source§impl<T: ?Sized> Drop for RwLockWriteGuard<'_, T>
impl<T: ?Sized> Drop for RwLockWriteGuard<'_, T>
impl<T: ?Sized + Send + Sync> 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: ?Sized + Send + Sync> 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
.