AsyncFnOnce in std::ops - Rust (original) (raw)

Trait AsyncFnOnce

1.85.0 · Source

pub trait AsyncFnOnce<Args>

where
    Args: Tuple,

{
    type CallOnceFuture: Future<Output = Self::Output>;
    type Output;

    // Required method
    extern "rust-call" fn async_call_once(
        self,
        args: Args,
    ) -> Self::CallOnceFuture;
}

Expand description

An async-aware version of the FnOnce trait.

All async fn and functions returning futures implement this trait.

Source

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

Source

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

Output type of the called closure’s future.

Source

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

Call the AsyncFnOnce, returning a future which may move out of the called closure.