Struct maitake::sync::rwlock::OwnedRwLockWriteGuard
source · pub struct OwnedRwLockWriteGuard<T>where
T: ?Sized,{ /* private fields */ }
Expand description
Owned RAII structure used to release the exclusive write access of a
RwLock
when dropped.
This type is similar to the RwLockWriteGuard
type, but it is
only returned by an RwLock
that is wrapped in an an Arc
.
Instead of borrowing the RwLock
, this guard holds an Arc
clone of the RwLock
, incrementing its reference count.
Therefore, this type can outlive the RwLock
that created it, and
it is valid for the 'static
lifetime. Beyond this, is identical to
the RwLockWriteGuard
type.
The data protected by the RwLock
can be accessed through this
guard via its Deref
and DerefMut
implementations.
This guard can be held across any .await
point, as it implements
Send
.
This structure is created by the read_owned
and
try_read_owned
methods on Arc
<
RwLock
>
.
Trait Implementations§
source§impl<T> Debug for OwnedRwLockWriteGuard<T>
impl<T> Debug for OwnedRwLockWriteGuard<T>
source§impl<T> Deref for OwnedRwLockWriteGuard<T>where
T: ?Sized,
impl<T> Deref for OwnedRwLockWriteGuard<T>where
T: ?Sized,
source§impl<T> DerefMut for OwnedRwLockWriteGuard<T>where
T: ?Sized,
impl<T> DerefMut for OwnedRwLockWriteGuard<T>where
T: ?Sized,
impl<T> Send for OwnedRwLockWriteGuard<T>
impl<T> Sync for OwnedRwLockWriteGuard<T>
Auto Trait Implementations§
impl<T> Freeze for OwnedRwLockWriteGuard<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for OwnedRwLockWriteGuard<T>
impl<T> Unpin for OwnedRwLockWriteGuard<T>where
T: ?Sized,
impl<T> !UnwindSafe for OwnedRwLockWriteGuard<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more