[][src]Trait fibers::Executor

pub trait Executor: Sized {
    type Handle: Spawn + Clone + Send + 'static;
    fn handle(&self) -> Self::Handle;
fn run_once(&mut self) -> Result<()>; fn run_fiber<T, E>(
        &mut self,
        monitor: Monitor<T, E>
    ) -> Result<Result<T, MonitorError<E>>> { ... }
fn run_future<F: Future>(
        &mut self,
        future: F
    ) -> Result<Result<F::Item, F::Error>> { ... }
fn run(self) -> Result<()> { ... } }

The Executor trait allows for spawning and executing fibers.

Associated Types

type Handle: Spawn + Clone + Send + 'static

The handle type of the executor.

Loading content...

Required methods

fn handle(&self) -> Self::Handle

Returns the handle of the executor.

fn run_once(&mut self) -> Result<()>

Runs one one unit of works.

Loading content...

Provided methods

fn run_fiber<T, E>(
    &mut self,
    monitor: Monitor<T, E>
) -> Result<Result<T, MonitorError<E>>>

Runs until the monitored fiber exits.

fn run_future<F: Future>(
    &mut self,
    future: F
) -> Result<Result<F::Item, F::Error>>

Runs until the future is ready.

fn run(self) -> Result<()>

Runs infinitely until an error happens.

Loading content...

Implementors

impl Executor for InPlaceExecutor[src]

type Handle = InPlaceExecutorHandle

impl Executor for ThreadPoolExecutor[src]

type Handle = ThreadPoolExecutorHandle

Loading content...