Skip to main content

RunAsync

Trait RunAsync 

Source
pub trait RunAsync<C = ()> {
    type Output;

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

A command that is awaited: Run, as a future.

An implementation writes async fn run_async(self, context: C). The signature here is -> impl Future so that the trait implies no Send bound either way: whether a command’s future is Send is decided by what the command does.

Required Associated Types§

Source

type Output

What running the command produces, once awaited.

Required Methods§

Source

fn run_async(self, context: C) -> 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§