pub struct AsyncTagLockTable<T>{ /* private fields */ }Expand description
A table of per-tag async locks, sharable across tasks.
Implementations§
Source§impl<T> AsyncTagLockTable<T>
impl<T> AsyncTagLockTable<T>
Sourcepub async fn lock_tag(&self, tag: T) -> AsyncTagLockGuard<T>
pub async fn lock_tag(&self, tag: T) -> AsyncTagLockGuard<T>
Acquire the lock for tag, waiting until it is free.
Blocks until this tag’s lock is free; other tags never block this one. The returned guard holds the tag until dropped, at which point the tag’s entry is removed if no guards remain.
Sourcepub fn try_lock_tag(&self, tag: T) -> Option<AsyncTagLockGuard<T>>
pub fn try_lock_tag(&self, tag: T) -> Option<AsyncTagLockGuard<T>>
Try to acquire the lock for tag without waiting, or None if it is already held.
Never blocks. On success the guard holds the tag until dropped.
Trait Implementations§
Source§impl<T> Clone for AsyncTagLockTable<T>
impl<T> Clone for AsyncTagLockTable<T>
Source§fn clone(&self) -> AsyncTagLockTable<T>
fn clone(&self) -> AsyncTagLockTable<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for AsyncTagLockTable<T>
impl<T> Debug for AsyncTagLockTable<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for AsyncTagLockTable<T>
impl<T> !UnwindSafe for AsyncTagLockTable<T>
impl<T> Freeze for AsyncTagLockTable<T>
impl<T> Send for AsyncTagLockTable<T>where
T: Send,
impl<T> Sync for AsyncTagLockTable<T>where
T: Send,
impl<T> Unpin for AsyncTagLockTable<T>
impl<T> UnsafeUnpin for AsyncTagLockTable<T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more