Trait concurrency_traits::AsyncTimeoutRwLockSized[][src]

pub trait AsyncTimeoutRwLockSized<'a>: Sized + AsyncTimeoutRwLock<'a> + AsyncRwLockSized<'a> {
    fn read_timeout_async_func<F>(
        &'a self,
        timeout: Duration,
        func: impl FnOnce(Option<&Self::Item>) -> F + 'a
    ) -> Pin<Box<dyn Future<Output = F::Output> + 'a>>
    where
        F: Future
, { ... }
fn write_timeout_async_func<F>(
        &'a self,
        timeout: Duration,
        func: impl FnOnce(Option<&mut Self::Item>) -> F + 'a
    ) -> Pin<Box<dyn Future<Output = F::Output> + 'a>>
    where
        F: Future
, { ... } }

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

Provided methods

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

Reads form the lock with a timeout running func on the result asynchronously

Implementation

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

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

Writes to the lock with a timeout running func on the result asynchronously

Implementation

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

Loading content...

Implementors

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

Loading content...