Trait concurrency_traits::MutexSized[][src]

pub trait MutexSized<'a>: Mutex<'a> + TryMutexSized<'a> {
    fn lock_func<O>(&'a self, func: impl FnOnce(&mut Self::Item) -> O) -> O { ... }
}

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

Provided methods

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

Runs the function on the value in the mutex.

Implementation

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

Loading content...

Implementations on Foreign Types

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

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

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

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

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

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

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

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

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

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

Loading content...

Implementors

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

Loading content...