Struct maitake_sync::rwlock::OwnedRwLockWriteGuard
source · pub struct OwnedRwLockWriteGuard<T: ?Sized> { /* private fields */ }
Available on crate feature
alloc
only.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: ?Sized> Deref for OwnedRwLockWriteGuard<T>
impl<T: ?Sized> Deref for OwnedRwLockWriteGuard<T>
source§impl<T: ?Sized> DerefMut for OwnedRwLockWriteGuard<T>
impl<T: ?Sized> DerefMut for OwnedRwLockWriteGuard<T>
impl<T> Send for OwnedRwLockWriteGuard<T>
impl<T> Sync for OwnedRwLockWriteGuard<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for OwnedRwLockWriteGuard<T>
impl<T: ?Sized> Unpin for OwnedRwLockWriteGuard<T>
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