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
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
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 T where
T: AsyncRwLock<'__a>,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'__a, 'a, T: ?Sized> AsyncRwLock<'__a> for &'a mut T where
T: AsyncRwLock<'__a>,
[src]
impl<'__a, 'a, T: ?Sized> AsyncRwLock<'__a> for &'a mut T where
T: AsyncRwLock<'__a>,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for ManuallyDrop<T> where
T: AsyncRwLock<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for ManuallyDrop<T> where
T: AsyncRwLock<'__a>,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'__a, T> AsyncRwLock<'__a> for AssertUnwindSafe<T> where
T: AsyncRwLock<'__a>,
[src]
impl<'__a, T> AsyncRwLock<'__a> for AssertUnwindSafe<T> where
T: AsyncRwLock<'__a>,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Rc<T> where
T: AsyncRwLock<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Rc<T> where
T: AsyncRwLock<'__a>,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Arc<T> where
T: AsyncRwLock<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Arc<T> where
T: AsyncRwLock<'__a>,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Box<T> where
T: AsyncRwLock<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncRwLock<'__a> for Box<T> where
T: AsyncRwLock<'__a>,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'__a, 'a, T> AsyncRwLock<'__a> for Cow<'a, T> where
T: AsyncRwLock<'__a> + Clone,
[src]
impl<'__a, 'a, T> AsyncRwLock<'__a> for Cow<'a, T> where
T: AsyncRwLock<'__a> + Clone,
[src]type AsyncReadGuard = T::AsyncReadGuard
type AsyncWriteGuard = T::AsyncWriteGuard
type ReadFuture = T::ReadFuture
type WriteFuture = T::WriteFuture
fn read_async(&'__a self) -> Self::ReadFuture
[src]
fn write_async(&'__a self) -> Self::WriteFuture
[src]
impl<'a, T> AsyncRwLock<'a> for Pin<T> where
T: Deref,
T::Target: AsyncRwLock<'a>,
[src]
impl<'a, T> AsyncRwLock<'a> for Pin<T> where
T: Deref,
T::Target: AsyncRwLock<'a>,
[src]type AsyncReadGuard = <T::Target as AsyncRwLock<'a>>::AsyncReadGuard
type AsyncWriteGuard = <T::Target as AsyncRwLock<'a>>::AsyncWriteGuard
type ReadFuture = <T::Target as AsyncRwLock<'a>>::ReadFuture
type WriteFuture = <T::Target as AsyncRwLock<'a>>::WriteFuture
fn read_async(&'a self) -> Self::ReadFuture
[src]
fn write_async(&'a self) -> Self::WriteFuture
[src]
Implementors
impl<'a, T, R> AsyncRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncRwLock + 'a,
[src]
impl<'a, T, R> AsyncRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncRwLock + 'a,
[src]