[−][src]Trait async_executors::LocalSpawnHandle
This is supported on
feature="spawn_handle"
only.Let's you spawn and get a JoinHandle to await the output of a future.
This trait is not object safe, see LocalSpawnHandleOs for a best effort object safe one.
Performance
For tokio and async-std this is generally faster than LocalSpawnExt::spawn_local, since it's better aligned with the underlying API and doesn't require extra boxing.
Required methods
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
This is supported on
feature="spawn_handle"
only.Spawn a future and return a JoinHandle that can be awaited for the output of the future.
Implementations on Foreign Types
impl<T> LocalSpawnHandle for Box<T> where
T: LocalSpawnHandle,
[src]
T: LocalSpawnHandle,
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl<T> LocalSpawnHandle for Arc<T> where
T: LocalSpawnHandle,
[src]
T: LocalSpawnHandle,
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl<T> LocalSpawnHandle for Rc<T> where
T: LocalSpawnHandle,
[src]
T: LocalSpawnHandle,
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl<'_, T> LocalSpawnHandle for &'_ T where
T: LocalSpawnHandle,
[src]
T: LocalSpawnHandle,
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl<'_, T> LocalSpawnHandle for &'_ mut T where
T: LocalSpawnHandle,
[src]
T: LocalSpawnHandle,
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl<T> LocalSpawnHandle for Instrumented<T> where
T: LocalSpawnHandle,
[src]
T: LocalSpawnHandle,
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl<T> LocalSpawnHandle for WithDispatch<T> where
T: LocalSpawnHandle,
[src]
T: LocalSpawnHandle,
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl LocalSpawnHandle for LocalSpawner
[src]
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
Implementors
impl LocalSpawnHandle for Bindgen
[src]
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
impl LocalSpawnHandle for TokioCt
[src]
fn spawn_handle_local<Fut, Out>(
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,
[src]
&self,
future: Fut
) -> Result<JoinHandle<Out>, SpawnError> where
Fut: Future<Output = Out> + 'static,
Out: 'static,