Trait concurrency_traits::AsyncMutexSized [−][src]
pub trait AsyncMutexSized<'a>: Sized + AsyncMutex<'a> + TryMutexSized<'a> { fn lock_async_func<F>(
&'a self,
func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>>
where
F: Future, { ... } }
The functions for AsyncMutex
that only work for sized types.
Separated to allow AsyncMutex
to be a trait object.
Provided methods
fn lock_async_func<F>(
&'a self,
func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>> where
F: Future,
[src]
&'a self,
func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>> where
F: Future,
Locks the mutex and runs func on it asynchronously
Implementation
Should be overwritten by implementors if can be more optimal than creating a guard
Implementations on Foreign Types
impl<'__a, 'a, T> AsyncMutexSized<'__a> for &'a T where
T: AsyncMutexSized<'__a>,
[src]
impl<'__a, 'a, T> AsyncMutexSized<'__a> for &'a T where
T: AsyncMutexSized<'__a>,
[src]impl<'__a, 'a, T> AsyncMutexSized<'__a> for &'a mut T where
T: AsyncMutexSized<'__a>,
[src]
impl<'__a, 'a, T> AsyncMutexSized<'__a> for &'a mut T where
T: AsyncMutexSized<'__a>,
[src]impl<'__a, T> AsyncMutexSized<'__a> for ManuallyDrop<T> where
T: AsyncMutexSized<'__a>,
[src]
impl<'__a, T> AsyncMutexSized<'__a> for ManuallyDrop<T> where
T: AsyncMutexSized<'__a>,
[src]impl<'__a, T> AsyncMutexSized<'__a> for AssertUnwindSafe<T> where
T: AsyncMutexSized<'__a>,
[src]
impl<'__a, T> AsyncMutexSized<'__a> for AssertUnwindSafe<T> where
T: AsyncMutexSized<'__a>,
[src]impl<'__a, T> AsyncMutexSized<'__a> for Rc<T> where
T: AsyncMutexSized<'__a>,
[src]
impl<'__a, T> AsyncMutexSized<'__a> for Rc<T> where
T: AsyncMutexSized<'__a>,
[src]impl<'__a, T> AsyncMutexSized<'__a> for Arc<T> where
T: AsyncMutexSized<'__a>,
[src]
impl<'__a, T> AsyncMutexSized<'__a> for Arc<T> where
T: AsyncMutexSized<'__a>,
[src]impl<'__a, T> AsyncMutexSized<'__a> for Box<T> where
T: AsyncMutexSized<'__a>,
[src]
impl<'__a, T> AsyncMutexSized<'__a> for Box<T> where
T: AsyncMutexSized<'__a>,
[src]impl<'__a, 'a, T> AsyncMutexSized<'__a> for Cow<'a, T> where
T: AsyncMutexSized<'__a> + Clone,
[src]
impl<'__a, 'a, T> AsyncMutexSized<'__a> for Cow<'a, T> where
T: AsyncMutexSized<'__a> + Clone,
[src]Implementors
impl<'a, T, M> AsyncMutexSized<'a> for CustomMutex<T, M> where
T: 'a,
M: RawAsyncMutex + 'a,
[src]
impl<'a, T, M> AsyncMutexSized<'a> for CustomMutex<T, M> where
T: 'a,
M: RawAsyncMutex + 'a,
[src]