[−][src]Trait futures::task::Spawn
The Spawn
trait allows for pushing futures onto an executor that will
run them to completion.
Required Methods
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
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
fn status(&self) -> Result<(), SpawnError>
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.
Implementors
impl Spawn for TokioDefaultSpawner
[src]
impl Spawn for TokioDefaultSpawner
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
fn status(&self) -> Result<(), SpawnError>
[src]
fn status(&self) -> Result<(), SpawnError>
impl Spawn for LocalSpawner
[src]
impl Spawn for LocalSpawner
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
fn status(&self) -> Result<(), SpawnError>
[src]
fn status(&self) -> Result<(), SpawnError>
impl Spawn for ThreadPool
[src]
impl Spawn for ThreadPool
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
fn status(&self) -> Result<(), SpawnError>
[src]
fn status(&self) -> Result<(), SpawnError>
impl<'a> Spawn for FuturesUnordered<FutureObj<'a, ()>>
[src]
impl<'a> Spawn for FuturesUnordered<FutureObj<'a, ()>>
fn spawn_obj(
&mut self,
future_obj: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
fn spawn_obj(
&mut self,
future_obj: FutureObj<'static, ()>
) -> Result<(), SpawnError>
fn status(&self) -> Result<(), SpawnError>
[src]
fn status(&self) -> Result<(), SpawnError>
impl<Ex> Spawn for Executor01As03<Ex> where
Ex: Executor<Compat<UnitError<FutureObj<'static, ()>>>> + Clone + Send + 'static,
[src]
impl<Ex> Spawn for Executor01As03<Ex> where
Ex: Executor<Compat<UnitError<FutureObj<'static, ()>>>> + Clone + Send + 'static,