[−][src]Trait futures_task::Spawn
The Spawn
trait allows for pushing futures onto an executor that will
run them to completion.
Required methods
pub fn spawn_obj(
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&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
pub fn status(&self) -> Result<(), SpawnError>
[src]
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: ?Sized + Spawn> Spawn for Box<Sp>
[src]
pub fn spawn_obj(
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status(&self) -> Result<(), SpawnError>
[src]
impl<Sp: ?Sized + Spawn> Spawn for Rc<Sp>
[src]
pub fn spawn_obj(
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status(&self) -> Result<(), SpawnError>
[src]
impl<Sp: ?Sized + Spawn> Spawn for Arc<Sp>
[src]
pub fn spawn_obj(
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status(&self) -> Result<(), SpawnError>
[src]
Implementors
impl<Sp: ?Sized + Spawn, '_> Spawn for &'_ Sp
[src]
pub fn spawn_obj(
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status(&self) -> Result<(), SpawnError>
[src]
impl<Sp: ?Sized + Spawn, '_> Spawn for &'_ mut Sp
[src]
pub fn spawn_obj(
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>