Trait fibers::Executor [] [src]

pub trait Executor: Sized {
    type Handle: Spawn + Clone + Send + 'static;
    fn handle(&self) -> Self::Handle;
    fn run_once(&mut self) -> Result<()>;

    fn spawn<F>(&self, future: F) where F: Future<Item=(), Error=()> + Send + 'static { ... }
    fn spawn_fn<F, T>(&self, f: F) where F: FnOnce() -> T + Send + 'static,
              T: IntoFuture<Item=(), Error=()> + Send + 'static,
              T::Future: Send
{ ... } fn spawn_monitor<F, T, E>(&self, f: F) -> Monitor<T, E> where F: Future<Item=T, Error=E> + Send + 'static,
              T: Send + 'static,
              E: Send + 'static
{ ... } fn run_fiber<T, E>(&mut self,
                       monitor: Monitor<T, E>)
                       -> Result<Result<T, MonitorError<E>>> { ... } fn run(self) -> Result<()> { ... } }

The Executor trait allows for spawning and executing fibers.

Associated Types

The handle type of the executor.

Required Methods

Returns the handle of the executor.

Runs one one unit of works.

Provided Methods

Spawns a fiber which will execute given future.

Equivalent to self.spawn(futures::lazy(|| f())).

Spawns a fiber and returns a future to monitor it's execution result.

Runs until the monitored fiber exits.

Runs infinitely until an error happens.

Implementors