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]
&'a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
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]
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 T where
T: TryMutexSized<'__a>,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'__a, 'a, T> TryMutexSized<'__a> for &'a mut T where
T: TryMutexSized<'__a>,
[src]
impl<'__a, 'a, T> TryMutexSized<'__a> for &'a mut T where
T: TryMutexSized<'__a>,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'__a, T> TryMutexSized<'__a> for ManuallyDrop<T> where
T: TryMutexSized<'__a>,
[src]
impl<'__a, T> TryMutexSized<'__a> for ManuallyDrop<T> where
T: TryMutexSized<'__a>,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'__a, T> TryMutexSized<'__a> for AssertUnwindSafe<T> where
T: TryMutexSized<'__a>,
[src]
impl<'__a, T> TryMutexSized<'__a> for AssertUnwindSafe<T> where
T: TryMutexSized<'__a>,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'__a, T> TryMutexSized<'__a> for Rc<T> where
T: TryMutexSized<'__a>,
[src]
impl<'__a, T> TryMutexSized<'__a> for Rc<T> where
T: TryMutexSized<'__a>,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'__a, T> TryMutexSized<'__a> for Arc<T> where
T: TryMutexSized<'__a>,
[src]
impl<'__a, T> TryMutexSized<'__a> for Arc<T> where
T: TryMutexSized<'__a>,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'__a, T> TryMutexSized<'__a> for Box<T> where
T: TryMutexSized<'__a>,
[src]
impl<'__a, T> TryMutexSized<'__a> for Box<T> where
T: TryMutexSized<'__a>,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'__a, 'a, T> TryMutexSized<'__a> for Cow<'a, T> where
T: TryMutexSized<'__a> + Clone,
[src]
impl<'__a, 'a, T> TryMutexSized<'__a> for Cow<'a, T> where
T: TryMutexSized<'__a> + Clone,
[src]fn try_lock_func<O>(
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'__a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
impl<'a, T> TryMutexSized<'a> for Pin<T> where
T: Deref,
T::Target: TryMutexSized<'a>,
[src]
impl<'a, T> TryMutexSized<'a> for Pin<T> where
T: Deref,
T::Target: TryMutexSized<'a>,
[src]fn try_lock_func<O>(
&'a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
Implementors
impl<'a, T, M> TryMutexSized<'a> for CustomMutex<T, M> where
T: 'a,
M: RawTryMutex + 'a,
[src]
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]
&'a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O