Trait concurrency_traits::AsyncRwLockSized [−][src]
pub trait AsyncRwLockSized<'a>: Sized + AsyncRwLock<'a> + TryRwLockSized<'a> { fn read_async_func<F>(
&'a self,
func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>>
where
F: Future, { ... } fn write_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 AsyncRwLock
that only work for sized types.
Separated to allow AsyncRwLock
to be a trait object.
Provided methods
fn read_async_func<F>(
&'a self,
func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>> where
F: Future,
[src]
&'a self,
func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = F::Output> + 'a>> where
F: Future,
Reads from the lock and runs func
on the result asynchronously
Implementation
Should be overwritten by implementors if can be more optimal than creating a guard
fn write_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,
Writes to the lock and runs func
on the result asynchronously
Implementation
Should be overwritten by implementors if can be more optimal than creating a guard
Implementations on Foreign Types
impl<'__a, 'a, T> AsyncRwLockSized<'__a> for &'a T where
T: AsyncRwLockSized<'__a>,
[src]
impl<'__a, 'a, T> AsyncRwLockSized<'__a> for &'a T where
T: AsyncRwLockSized<'__a>,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
impl<'__a, 'a, T> AsyncRwLockSized<'__a> for &'a mut T where
T: AsyncRwLockSized<'__a>,
[src]
impl<'__a, 'a, T> AsyncRwLockSized<'__a> for &'a mut T where
T: AsyncRwLockSized<'__a>,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
impl<'__a, T> AsyncRwLockSized<'__a> for ManuallyDrop<T> where
T: AsyncRwLockSized<'__a>,
[src]
impl<'__a, T> AsyncRwLockSized<'__a> for ManuallyDrop<T> where
T: AsyncRwLockSized<'__a>,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
impl<'__a, T> AsyncRwLockSized<'__a> for AssertUnwindSafe<T> where
T: AsyncRwLockSized<'__a>,
[src]
impl<'__a, T> AsyncRwLockSized<'__a> for AssertUnwindSafe<T> where
T: AsyncRwLockSized<'__a>,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
impl<'__a, T> AsyncRwLockSized<'__a> for Rc<T> where
T: AsyncRwLockSized<'__a>,
[src]
impl<'__a, T> AsyncRwLockSized<'__a> for Rc<T> where
T: AsyncRwLockSized<'__a>,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
impl<'__a, T> AsyncRwLockSized<'__a> for Arc<T> where
T: AsyncRwLockSized<'__a>,
[src]
impl<'__a, T> AsyncRwLockSized<'__a> for Arc<T> where
T: AsyncRwLockSized<'__a>,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
impl<'__a, T> AsyncRwLockSized<'__a> for Box<T> where
T: AsyncRwLockSized<'__a>,
[src]
impl<'__a, T> AsyncRwLockSized<'__a> for Box<T> where
T: AsyncRwLockSized<'__a>,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
impl<'__a, 'a, T> AsyncRwLockSized<'__a> for Cow<'a, T> where
T: AsyncRwLockSized<'__a> + Clone,
[src]
impl<'__a, 'a, T> AsyncRwLockSized<'__a> for Cow<'a, T> where
T: AsyncRwLockSized<'__a> + Clone,
[src]fn read_async_func<F>(
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
fn write_async_func<F>(
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
[src]
&'__a self,
func: impl FnOnce(&mut Self::Item) -> F + '__a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + '__a>> where
F: Future,
Implementors
impl<'a, T, R> AsyncRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncRwLock + 'a,
[src]
impl<'a, T, R> AsyncRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncRwLock + 'a,
[src]fn read_async_func<F>(
&'a self,
func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
[src]
&'a self,
func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
fn write_async_func<F>(
&'a self,
func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
[src]
&'a self,
func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,