Skip to main content

AsyncRwLockWriteGuard

Struct AsyncRwLockWriteGuard 

Source
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>

Source

pub fn get_rwlock(&self) -> LP::SyncRcPtrRef<'_>

Obtain the associated AsyncRwLock.

Source

pub fn into_rwlock(self) -> LP

Release the lock and return the associated AsyncRwLock.

Source

pub fn into_weak(self) -> AsyncRwLockWriteWeakGuard<ST, T, LP>

Convert into an AsyncRwLockWriteWeakGuard not hindering destruction of the associated AsyncRwLock.

Source

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.

Trait Implementations§

Source§

impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> Deref for AsyncRwLockWriteGuard<ST, T, LP>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<ST: SyncTypes, T: Send + Sync, LP: SyncRcPtr<AsyncRwLock<ST, T>>> DerefMut for AsyncRwLockWriteGuard<ST, T, LP>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<ST, T, LP> Freeze for AsyncRwLockWriteGuard<ST, T, LP>
where AsyncSemaphoreExclusiveAllGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: Freeze,

§

impl<ST, T, LP> RefUnwindSafe for AsyncRwLockWriteGuard<ST, T, LP>
where AsyncSemaphoreExclusiveAllGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: RefUnwindSafe,

§

impl<ST, T, LP> Send for AsyncRwLockWriteGuard<ST, T, LP>
where AsyncSemaphoreExclusiveAllGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: Send,

§

impl<ST, T, LP> Sync for AsyncRwLockWriteGuard<ST, T, LP>
where AsyncSemaphoreExclusiveAllGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: Sync,

§

impl<ST, T, LP> Unpin for AsyncRwLockWriteGuard<ST, T, LP>
where AsyncSemaphoreExclusiveAllGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: Unpin,

§

impl<ST, T, LP> UnsafeUnpin for AsyncRwLockWriteGuard<ST, T, LP>
where AsyncSemaphoreExclusiveAllGuard<ST, T, SyncRcPtrForInner<AsyncRwLock<ST, T>, LP, AsyncRwLockIndexInnerSemTag>>: UnsafeUnpin,

§

impl<ST, T, LP> UnwindSafe for AsyncRwLockWriteGuard<ST, T, LP>
where AsyncSemaphoreExclusiveAllGuard<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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.