pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
// Required method
extern "rust-call" fn async_call(
&self,
args: Args,
) -> Self::CallRefFuture<'_>;
}Expand description
An async-aware version of the Fn trait.
All async fn and functions returning futures implement this trait.
Required Methods§
Sourceextern "rust-call" fn async_call(
&self,
args: Args,
) -> Self::CallRefFuture<'_>
🔬This is a nightly-only experimental API. (async_fn_traits)This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".