Trait concurrency_traits::rw_lock::TimeoutRwLockSized[][src]

pub trait TimeoutRwLockSized<'a>: Sized + TimeoutRwLock<'a> + TryRwLockSized<'a> {
    fn read_timeout_func<O>(
        &'a self,
        timeout: Duration,
        func: impl FnOnce(Option<&Self::Item>) -> O
    ) -> O { ... }
fn write_timeout_func<O>(
        &'a self,
        timeout: Duration,
        func: impl FnOnce(Option<&mut Self::Item>) -> O
    ) -> O { ... } }
Expand description

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

Provided methods

fn read_timeout_func<O>(
    &'a self,
    timeout: Duration,
    func: impl FnOnce(Option<&Self::Item>) -> O
) -> O
[src]

Reads from the lock with a timeout running func on the result

Implementation

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

fn write_timeout_func<O>(
    &'a self,
    timeout: Duration,
    func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]

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

Implementation

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

Implementors

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

fn read_timeout_func<O>(
    &'a self,
    timeout: Duration,
    func: impl FnOnce(Option<&Self::Item>) -> O
) -> O
[src]

fn write_timeout_func<O>(
    &'a self,
    timeout: Duration,
    func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]