Trait concurrency_traits::mutex::TryMutexSized[][src]

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

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

Provided methods

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

Runs the function the value in the mutex if available immediately.

Implementation

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

Implementations on Foreign Types

impl<'a, T> TryMutexSized<'a> for Mutex<T> where
    T: 'a, 
[src]

Implementors

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

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