[][src]Trait iced_native::executor::Executor

pub trait Executor {
    fn new() -> Result<Self, Error>;
fn spawn(&self, future: impl Send + Future<Output = ()> + 'static); fn enter<R>(&self, f: impl FnOnce() -> R) -> R { ... } }

A type that can run futures.

Required methods

fn new() -> Result<Self, Error>

Creates a new Executor.

fn spawn(&self, future: impl Send + Future<Output = ()> + 'static)

Spawns a future in the Executor.

Loading content...

Provided methods

fn enter<R>(&self, f: impl FnOnce() -> R) -> R

Runs the given closure inside the Executor.

Some executors, like tokio, require some global state to be in place before creating futures. This method can be leveraged to set up this global state, call a function, restore the state, and obtain the result of the call.

Loading content...

Implementations on Foreign Types

impl Executor for Runtime[src]

impl Executor for ThreadPool[src]

Loading content...

Implementors

impl Executor for AsyncStd[src]

impl Executor for Null[src]

Loading content...