Trait futures::task::LocalSpawn [−][src]
The LocalSpawn
is similar to Spawn
, but allows spawning futures
that don’t implement Send
.
Required methods
pub fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: LocalFutureObj<'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_local(&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> LocalSpawn for &'_ Sp where
Sp: LocalSpawn + ?Sized,
[src]
Sp: LocalSpawn + ?Sized,
pub fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status_local(&self) -> Result<(), SpawnError>
[src]
impl<Sp> LocalSpawn for Arc<Sp> where
Sp: LocalSpawn + ?Sized,
[src]
Sp: LocalSpawn + ?Sized,
pub fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status_local(&self) -> Result<(), SpawnError>
[src]
impl<Sp> LocalSpawn for Box<Sp, Global> where
Sp: LocalSpawn + ?Sized,
[src]
Sp: LocalSpawn + ?Sized,
pub fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status_local(&self) -> Result<(), SpawnError>
[src]
impl<'_, Sp> LocalSpawn for &'_ mut Sp where
Sp: LocalSpawn + ?Sized,
[src]
Sp: LocalSpawn + ?Sized,
pub fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status_local(&self) -> Result<(), SpawnError>
[src]
impl<Sp> LocalSpawn for Rc<Sp> where
Sp: LocalSpawn + ?Sized,
[src]
Sp: LocalSpawn + ?Sized,
pub fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status_local(&self) -> Result<(), SpawnError>
[src]
Implementors
impl LocalSpawn for LocalSpawner
[src]
pub fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
pub fn status_local(&self) -> Result<(), SpawnError>
[src]
impl<'_> LocalSpawn for FuturesUnordered<LocalFutureObj<'_, ()>>
[src]
pub fn spawn_local_obj(
&self,
future_obj: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&self,
future_obj: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>