Skip to main content

AsyncRwLockWriteFuture

Struct AsyncRwLockWriteFuture 

Source
pub struct AsyncRwLockWriteFuture<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> { /* private fields */ }
Expand description

Asynchronous wait for exclusive locking of an AsyncRwLock.

To be obtained through AsyncRwLock::write().

§Note on lifetime management

An AsyncRwLockWriteFuture 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>>> AsyncRwLockWriteFuture<ST, T, LP>

Source

pub fn get_rwlock(&self) -> Option<LP>

Trait Implementations§

Source§

impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> Future for AsyncRwLockWriteFuture<ST, T, LP>

Source§

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 AsyncRwLockWriteGuard 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.

Source§

type Output = Result<AsyncRwLockWriteGuard<ST, T, LP>, AsyncRwLockError>

The type of value produced on completion.
Source§

impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> Unpin for AsyncRwLockWriteFuture<ST, T, LP>

Auto Trait Implementations§

§

impl<ST, T, LP> Freeze for AsyncRwLockWriteFuture<ST, T, LP>
where AsyncSemaphoreExclusiveAllFuture<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: Freeze,

§

impl<ST, T, LP> RefUnwindSafe for AsyncRwLockWriteFuture<ST, T, LP>
where AsyncSemaphoreExclusiveAllFuture<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: RefUnwindSafe,

§

impl<ST, T, LP> Send for AsyncRwLockWriteFuture<ST, T, LP>
where AsyncSemaphoreExclusiveAllFuture<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: Send,

§

impl<ST, T, LP> Sync for AsyncRwLockWriteFuture<ST, T, LP>
where AsyncSemaphoreExclusiveAllFuture<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: Sync,

§

impl<ST, T, LP> UnsafeUnpin for AsyncRwLockWriteFuture<ST, T, LP>
where AsyncSemaphoreExclusiveAllFuture<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: UnsafeUnpin,

§

impl<ST, T, LP> UnwindSafe for AsyncRwLockWriteFuture<ST, T, LP>
where AsyncSemaphoreExclusiveAllFuture<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F> IntoFuture for F
where F: Future,

Source§

type Output = <F as Future>::Output

The output that the future will produce on completion.
Source§

type IntoFuture = F

Which kind of future are we turning this into?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.