pub struct AsyncRwLockReadFuture<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> { /* private fields */ }Expand description
Asynchronous wait for non-exclusive locking of an AsyncRwLock.
To be obtained through AsyncRwLock::read().
§Note on lifetime management
An AsyncRwLockReadFuture instance will only maintain a weak reference
(i.e. a WeakSyncRcPtr) to the associated
AsyncRwLock instance and thus, would not hinder its deallocation. In
case the lock gets dropped before the future had a chance to acquire it, its
poll() would return AsyncRwLockError::StaleRwLock.
Implementations§
Source§impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> AsyncRwLockReadFuture<ST, T, LP>
impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> AsyncRwLockReadFuture<ST, T, LP>
Sourcepub fn get_rwlock(&self) -> Option<LP>
pub fn get_rwlock(&self) -> Option<LP>
Obtain the associated AsyncRwLock.
Return the associated AsyncRwLock wrapped in Some if still
alive, None otherwise.
Trait Implementations§
Source§impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> Future for AsyncRwLockReadFuture<ST, T, LP>
impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> Future for AsyncRwLockReadFuture<ST, T, LP>
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Poll for a locking grant of the associated AsyncRwLock.
Upon future completion, either a AsyncRwLockReadGuard is returned
or, if the associated AsyncRwLock had been dropped in the
meanwhile, an error of AsyncRwLockError::StaleRwLock.
The future must not get polled any further once completed.