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

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

Loading content...

Implementations on Foreign Types

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

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

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

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

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

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

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

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

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

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

Loading content...

Implementors

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

Loading content...