Trait async_executors::iface::SpawnHandleExt
source · [−]pub trait SpawnHandleExt<Out: 'static + Send>: SpawnHandle<Out> {
fn spawn_handle(
&self,
future: impl Future<Output = Out> + Send + 'static
) -> Result<JoinHandle<Out>, SpawnError>;
}
Expand description
Convenience trait for passing in a generic future to SpawnHandle
. Much akin to Spawn
and SpawnExt
in the
futures library.
Required Methods
fn spawn_handle(
&self,
future: impl Future<Output = Out> + Send + 'static
) -> Result<JoinHandle<Out>, SpawnError>
fn spawn_handle(
&self,
future: impl Future<Output = Out> + Send + 'static
) -> Result<JoinHandle<Out>, SpawnError>
Spawn a future and return a JoinHandle that can be awaited for the output of the future.