Trait tracing::stdlib::ops::AsyncFn

source ·
pub trait AsyncFn<Args>: AsyncFnMut<Args>
where Args: Tuple,
{ type CallFuture<'a>: Future<Output = Self::Output> where Self: 'a; // Required method extern "rust-call" fn async_call( &self, args: Args ) -> Self::CallFuture<'_>; }
🔬This is a nightly-only experimental API. (async_fn_traits)
Expand description

An async-aware version of the Fn trait.

All async fn and functions returning futures implement this trait.

Required Associated Types§

source

type CallFuture<'a>: Future<Output = Self::Output> where Self: 'a

🔬This is a nightly-only experimental API. (async_fn_traits)

Future returned by AsyncFn::async_call.

Required Methods§

source

extern "rust-call" fn async_call( &self, args: Args ) -> Self::CallFuture<'_>

🔬This is a nightly-only experimental API. (async_fn_traits)

Call the AsyncFn, returning a future which may borrow from the called closure.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<A, F> AsyncFn<A> for &F
where A: Tuple, F: AsyncFn<A> + ?Sized,

§

type CallFuture<'a> = <F as AsyncFn<A>>::CallFuture<'a> where &F: 'a

source§

impl<Args, F, A> AsyncFn<Args> for Box<F, A>
where Args: Tuple, F: AsyncFn<Args> + ?Sized, A: Allocator,

§

type CallFuture<'a> = <F as AsyncFn<Args>>::CallFuture<'a> where Box<F, A>: 'a