Trait fibers::executor::Executor
[−]
[src]
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
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.
Provided Methods
fn run_fiber<T, E>(
&mut self,
monitor: Monitor<T, E>
) -> Result<Result<T, MonitorError<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>>
&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.
Implementors
impl Executor for InPlaceExecutor
impl Executor for ThreadPoolExecutor