pub trait AsyncFn<Args>: AsyncFnMut<Args>where
Args: Tuple,{
// Required method
extern "rust-call" fn async_call(
&self,
args: Args,
) -> Self::CallRefFuture<'_>;
}
An async-aware version of the Fn trait.
All async fn and functions returning futures implement this trait.
extern "rust-call" fn async_call(
&self,
args: Args,
) -> Self::CallRefFuture<'_>async_fn_traits)
Call the AsyncFn, returning a future which may borrow from the called closure.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
impl<A, F> AsyncFn<A> for &Fwhere
A: Tuple,
F: AsyncFn<A> + ?Sized,impl<Args, F, A> AsyncFn<Args> for Box<F, A>where
Args: Tuple,
F: AsyncFn<Args> + ?Sized,
A: Allocator,
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/ops/trait.AsyncFn.html