Trait concurrency_traits::AsyncRwLockSized[][src]

pub trait AsyncRwLockSized<'a>: Sized + AsyncRwLock<'a> + TryRwLockSized<'a> {
    fn read_async_func<F>(
        &'a self,
        func: impl FnOnce(&Self::Item) -> F + 'a
    ) -> Pin<Box<dyn Future<Output = F::Output> + 'a>>
    where
        F: Future
, { ... }
fn write_async_func<F>(
        &'a self,
        func: impl FnOnce(&mut Self::Item) -> F + 'a
    ) -> Pin<Box<dyn Future<Output = F::Output> + 'a>>
    where
        F: Future
, { ... } }

The functions for AsyncRwLock that only work for sized types. Separated to allow AsyncRwLock to be a trait object.

Provided methods

fn read_async_func<F>(
    &'a self,
    func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>> where
    F: Future
[src]

Reads from the lock and runs func on the result asynchronously

Implementation

Should be overwritten by implementors if can be more optimal than creating a guard

fn write_async_func<F>(
    &'a self,
    func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>> where
    F: Future
[src]

Writes to the lock and runs func on the result asynchronously

Implementation

Should be overwritten by implementors if can be more optimal than creating a guard

Loading content...

Implementations on Foreign Types

impl<'__a, 'a, T> AsyncRwLockSized<'__a> for &'a T where
    T: AsyncRwLockSized<'__a>, 
[src]

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

impl<'__a, T> AsyncRwLockSized<'__a> for ManuallyDrop<T> where
    T: AsyncRwLockSized<'__a>, 
[src]

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

impl<'__a, T> AsyncRwLockSized<'__a> for Rc<T> where
    T: AsyncRwLockSized<'__a>, 
[src]

impl<'__a, T> AsyncRwLockSized<'__a> for Arc<T> where
    T: AsyncRwLockSized<'__a>, 
[src]

impl<'__a, T> AsyncRwLockSized<'__a> for Box<T> where
    T: AsyncRwLockSized<'__a>, 
[src]

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

Loading content...

Implementors

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

Loading content...