Trait concurrency_traits::TimeoutRwLockSized[][src]

pub trait TimeoutRwLockSized<'a>: Sized + TimeoutRwLock<'a> + RwLockSized<'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 { ... } }

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

Loading content...

Implementations on Foreign Types

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

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

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

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

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

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

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

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

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

Loading content...

Implementors

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

Loading content...