Trait concurrency_traits::mutex::TimeoutMutexSized[][src]

pub trait TimeoutMutexSized<'a>: Sized + TimeoutMutex<'a> + TryMutexSized<'a> {
    fn lock_timeout_func<O>(
        &'a self,
        timeout: Duration,
        func: impl FnOnce(Option<&mut Self::Item>) -> O
    ) -> O { ... } }
Expand description

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

Provided methods

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

Attempts to lock the mutex before timeout has passed and runs func on the result

Implementation

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

Implementors

impl<'a, T, M> TimeoutMutexSized<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawTimeoutMutex + 'a, 
[src]

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