Trait Executor

pub trait Executor {
    // Required methods
    fn new() -> Self;
    fn block_on<F>(&mut self, future: F) -> <F as Future>::Output
       where F: Future;
}
Expand description

Generic executor.

Required Methods§

fn new() -> Self

Create the implementor itself.

fn block_on<F>(&mut self, future: F) -> <F as Future>::Output
where F: Future,

Spawns a future object to run synchronously or asynchronously depending on the specific executor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl Executor for Runtime

§

fn new() -> Runtime

§

fn block_on<F>(&mut self, future: F) -> <F as Future>::Output
where F: Future,

Implementors§