Trait Spawn
trait Spawn
The Spawn trait allows for pushing futures onto an executor that will
run them to completion.
Required Methods
fn spawn_obj(self: &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: &Self) -> Result<(), SpawnError>Determines whether the executor is able to spawn new tasks.
This method will return
Okwhen the executor is likely (but not guaranteed) to accept a subsequent spawn attempt. Likewise, anErrreturn means thatspawnis likely, but not guaranteed, to yield an error.