Trait iced_web::executor::Executor[][src]

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

A type that can run futures.

Required methods

pub fn new() -> Result<Self, Error>[src]

Creates a new Executor.

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

Spawns a future in the Executor.

Loading content...

Provided methods

pub fn enter<R>(&self, f: impl FnOnce() -> R) -> R[src]

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...

Implementors

impl Executor for Null[src]

Loading content...