Trait criterion::async_executor::AsyncExecutor[][src]

pub trait AsyncExecutor {
    fn block_on<T>(&self, future: impl Future<Output = T>) -> T;
}

Plugin trait used to allow benchmarking on multiple different async runtimes.

Smol, Tokio and Async-std are supported out of the box, as is the current-thread runner from the Futures crate; it is recommended to use whichever runtime you use in production.

Required methods

fn block_on<T>(&self, future: impl Future<Output = T>) -> T[src]

Spawn the given future onto this runtime and block until it’s complete, returning the result.

Loading content...

Implementations on Foreign Types

impl AsyncExecutor for Runtime[src]

impl AsyncExecutor for &Runtime[src]

Loading content...

Implementors

impl AsyncExecutor for AsyncStdExecutor[src]

impl AsyncExecutor for FuturesExecutor[src]

impl AsyncExecutor for SmolExecutor[src]

Loading content...