Skip to main content

RunAsync

Trait RunAsync 

Source
pub trait RunAsync {
    type Output;

    // Required method
    fn run_async(self) -> impl Future<Output = Self::Output>;
}
Expand description

An async command: Run, awaited.

The signature is -> impl Future rather than async fn so that no Send bound is implied either way — an implementation still writes async fn run_async(self), and whether its future is Send is decided by what the command does rather than by this trait. See the module docs.

Required Associated Types§

Source

type Output

What running the command produces, once awaited.

Required Methods§

Source

fn run_async(self) -> impl Future<Output = Self::Output>

Carry out the command.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§