pub struct AsyncRwLockReadWeakGuard<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> { /* private fields */ }Expand description
Weak variant of AsyncRwLockReadGuard not hindering destruction of the
associated AsyncRwLock.
In cases were it’s desired that long-living locking grants don’t prevent a
destruction of the associated AsyncRwLock, or to break cycles, a
AsyncRwLockReadWeakGuard may be used. To be obtained via
AsyncRwLockReadGuard::into_weak().
An AsyncRwLockReadWeakGuard may get converted back into a full
AsyncRwLockReadGuard via upgrade().
Implementations§
Source§impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> AsyncRwLockReadWeakGuard<ST, T, LP>
impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> AsyncRwLockReadWeakGuard<ST, T, LP>
Sourcepub fn upgrade(self) -> Option<AsyncRwLockReadGuard<ST, T, LP>>
pub fn upgrade(self) -> Option<AsyncRwLockReadGuard<ST, T, LP>>
Attempt to convert back into an AsyncRwLockReadGuard.
Returns the AsyncRwLockReadGuard wrapped in Some if the
associated AsyncRwLock is still alive, `None otherwise.
Trait Implementations§
Source§impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> Clone for AsyncRwLockReadWeakGuard<ST, T, LP>
impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> Clone for AsyncRwLockReadWeakGuard<ST, T, LP>
Source§impl<ST: SyncTypes, OT, LP: SyncRcPtr<AsyncRwLock<ST, OT>>, TAG> From<AsyncRwLockReadWeakGuard<ST, OT, LP>> for AsyncRwLockReadWeakGuardForInner<ST, OT, LP, TAG>
impl<ST: SyncTypes, OT, LP: SyncRcPtr<AsyncRwLock<ST, OT>>, TAG> From<AsyncRwLockReadWeakGuard<ST, OT, LP>> for AsyncRwLockReadWeakGuardForInner<ST, OT, LP, TAG>
Source§fn from(value: AsyncRwLockReadWeakGuard<ST, OT, LP>) -> Self
fn from(value: AsyncRwLockReadWeakGuard<ST, OT, LP>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<ST, T, LP> Freeze for AsyncRwLockReadWeakGuard<ST, T, LP>where
Option<AsyncSemaphoreLeasesWeakGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>>: Freeze,
impl<ST, T, LP> RefUnwindSafe for AsyncRwLockReadWeakGuard<ST, T, LP>where
Option<AsyncSemaphoreLeasesWeakGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>>: RefUnwindSafe,
impl<ST, T, LP> Send for AsyncRwLockReadWeakGuard<ST, T, LP>where
Option<AsyncSemaphoreLeasesWeakGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>>: Send,
impl<ST, T, LP> Sync for AsyncRwLockReadWeakGuard<ST, T, LP>where
Option<AsyncSemaphoreLeasesWeakGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>>: Sync,
impl<ST, T, LP> Unpin for AsyncRwLockReadWeakGuard<ST, T, LP>where
Option<AsyncSemaphoreLeasesWeakGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>>: Unpin,
impl<ST, T, LP> UnsafeUnpin for AsyncRwLockReadWeakGuard<ST, T, LP>where
Option<AsyncSemaphoreLeasesWeakGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>>: UnsafeUnpin,
impl<ST, T, LP> UnwindSafe for AsyncRwLockReadWeakGuard<ST, T, LP>where
Option<AsyncSemaphoreLeasesWeakGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>>: UnwindSafe,
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