Trait concurrency_traits::AsyncRwLock[][src]

pub trait AsyncRwLock<'a>: TryRwLock<'a> {
    type AsyncReadGuard: Deref<Target = Self::Item>;
    type AsyncWriteGuard: DerefMut<Target = Self::Item>;
    type ReadFuture: Future<Output = Self::AsyncReadGuard>;
    type WriteFuture: Future<Output = Self::AsyncWriteGuard>;
    fn read_async(&'a self) -> Self::ReadFuture;
fn write_async(&'a self) -> Self::WriteFuture; }

A generic async reader-writer lock trait

Implementation

It is recommended to implement AsyncRwLockSized if the implement-ee can be sized.

Associated Types

type AsyncReadGuard: Deref<Target = Self::Item>[src]

The read guard for async reading

type AsyncWriteGuard: DerefMut<Target = Self::Item>[src]

The write guard for async writing

type ReadFuture: Future<Output = Self::AsyncReadGuard>[src]

The future returned by read_async

type WriteFuture: Future<Output = Self::AsyncWriteGuard>[src]

The future returned by write_async

Loading content...

Required methods

fn read_async(&'a self) -> Self::ReadFuture[src]

Reads the lock asynchronously, giving a future that will contain the read lock

fn write_async(&'a self) -> Self::WriteFuture[src]

Writes to the lock asynchronously, giving a future that will contain the write lock

Loading content...

Implementations on Foreign Types

impl<'__a, 'a, T: ?Sized> AsyncRwLock<'__a> for &'a T where
    T: AsyncRwLock<'__a>, 
[src]

impl<'__a, 'a, T: ?Sized> AsyncRwLock<'__a> for &'a mut T where
    T: AsyncRwLock<'__a>, 
[src]

impl<'__a, T: ?Sized> AsyncRwLock<'__a> for ManuallyDrop<T> where
    T: AsyncRwLock<'__a>, 
[src]

impl<'__a, T> AsyncRwLock<'__a> for AssertUnwindSafe<T> where
    T: AsyncRwLock<'__a>, 
[src]

impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Rc<T> where
    T: AsyncRwLock<'__a>, 
[src]

impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Arc<T> where
    T: AsyncRwLock<'__a>, 
[src]

impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Box<T> where
    T: AsyncRwLock<'__a>, 
[src]

impl<'__a, 'a, T> AsyncRwLock<'__a> for Cow<'a, T> where
    T: AsyncRwLock<'__a> + Clone
[src]

impl<'a, T> AsyncRwLock<'a> for Pin<T> where
    T: Deref,
    T::Target: AsyncRwLock<'a>, 
[src]

Loading content...

Implementors

impl<'a, T, R> AsyncRwLock<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawAsyncRwLock + 'a, 
[src]

type AsyncReadGuard = CustomReadGuard<'a, T, R>

type AsyncWriteGuard = CustomWriteGuard<'a, T, R>

type ReadFuture = Pin<Box<dyn Future<Output = Self::AsyncReadGuard> + 'a>>

type WriteFuture = Pin<Box<dyn Future<Output = Self::AsyncWriteGuard> + 'a>>

Loading content...