[][src]Trait futures::task::Spawn

pub trait Spawn {
    fn spawn_obj(
        &mut self,
        future: FutureObj<'static, ()>
    ) -> Result<(), SpawnError>; default fn status(&self) -> Result<(), SpawnError> { ... } }
[]

The Spawn trait allows for pushing futures onto an executor that will run them to completion.

Required methods

Spawns a future that will be run to completion.

Errors

The executor may be unable to spawn tasks. Spawn errors should represent relatively rare scenarios, such as the executor having been shut down so that it is no longer able to accept tasks.

Provided methods

Determines whether the executor is able to spawn new tasks.

This method will return Ok when the executor is likely (but not guaranteed) to accept a subsequent spawn attempt. Likewise, an Err return means that spawn is likely, but not guaranteed, to yield an error.

Implementations on Foreign Types

impl<Sp> Spawn for Box<Sp> where
    Sp: Spawn + ?Sized
[src][]

Implementors

impl Spawn for LocalSpawner[src][]

impl Spawn for ThreadPool[src][]

default fn status(&self) -> Result<(), SpawnError>[src]

impl<'_> Spawn for &'_ ThreadPool[src][]

default fn status(&self) -> Result<(), SpawnError>[src]

impl<'a> Spawn for FuturesUnordered<FutureObj<'a, ()>>[src][]

default fn status(&self) -> Result<(), SpawnError>[src]

impl<Ex> Spawn for Executor01As03<Ex> where
    Ex: Executor<Compat<UnitError<FutureObj<'static, ()>>>> + Clone + Send + 'static, 
[src][]

default fn status(&self) -> Result<(), SpawnError>[src]

impl Spawn for LocalSpawner

impl Spawn for ThreadPool

impl<'_> Spawn for &'_ ThreadPool

impl Spawn for NoopSpawner

impl Spawn for PanicSpawner

impl Spawn for RecordSpawner

impl<'a> Spawn for FuturesUnordered<FutureObj<'a, ()>>

impl<Ex> Spawn for Executor01As03<Ex> where
    Ex: Executor01<Executor01Future>,
    Ex: Clone + Send + 'static,