pub struct AsyncRwLockWriteGuard<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> { /* private fields */ }Expand description
Exclusive locking grant on an AsyncRwLock.
Implementations§
Source§impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> AsyncRwLockWriteGuard<ST, T, LP>
impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> AsyncRwLockWriteGuard<ST, T, LP>
Sourcepub fn get_rwlock(&self) -> LP::SyncRcPtrRef<'_>
pub fn get_rwlock(&self) -> LP::SyncRcPtrRef<'_>
Obtain the associated AsyncRwLock.
Sourcepub fn into_rwlock(self) -> LP
pub fn into_rwlock(self) -> LP
Release the lock and return the associated AsyncRwLock.
Sourcepub fn into_weak(self) -> AsyncRwLockWriteWeakGuard<ST, T, LP>
pub fn into_weak(self) -> AsyncRwLockWriteWeakGuard<ST, T, LP>
Convert into an AsyncRwLockWriteWeakGuard not hindering
destruction of the associated AsyncRwLock.
Sourcepub fn borrow_outer_inner_mut<'a>(
&'a mut self,
) -> (LP::SyncRcPtrRef<'a>, &'a mut T)
pub fn borrow_outer_inner_mut<'a>( &'a mut self, ) -> (LP::SyncRcPtrRef<'a>, &'a mut T)
Simultaneously obtain an immutable reference to the associated
AsyncRwLock as well as a mutable one to its wrapped inner value.
Mutably dereferencing the AsyncRwLockWriteGuard to obtain a mut
reference on the protected value would result in a borrow on self
and thus, prohibits any use of get_rwlock()
over the course of the reference’s lifetime.
However, due to the AsyncRwLockWriteGuard’s locking semantics, there
isn’t anything problematic about immutably referencing the
associated AsyncRwLock at the same time. It’s useful in e.g.
situations where the lock lives in some zero-overhead
SyncRcPtrForInner and one seeks to
obtain a reference to the container starting out from the lock
guard.