Trait concurrency_traits::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 { ... } }

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

Loading content...

Implementations on Foreign Types

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

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

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

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

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

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

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

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

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

Loading content...

Implementors

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

Loading content...