[][src]Trait async_executors::LocalSpawnHandle

pub trait LocalSpawnHandle {
    fn spawn_handle_local<Fut, Out>(
        &self,
        future: Fut
    ) -> Result<JoinHandle<Out>, SpawnError>
    where
        Fut: Future<Output = Out> + 'static,
        Out: 'static
; }
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, 

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.

Loading content...

Implementations on Foreign Types

impl<T> LocalSpawnHandle for Box<T> where
    T: LocalSpawnHandle
[src]

impl<T> LocalSpawnHandle for Arc<T> where
    T: LocalSpawnHandle
[src]

impl<T> LocalSpawnHandle for Rc<T> where
    T: LocalSpawnHandle
[src]

impl<'_, T> LocalSpawnHandle for &'_ T where
    T: LocalSpawnHandle
[src]

impl<'_, T> LocalSpawnHandle for &'_ mut T where
    T: LocalSpawnHandle
[src]

impl<T> LocalSpawnHandle for Instrumented<T> where
    T: LocalSpawnHandle
[src]

impl<T> LocalSpawnHandle for WithDispatch<T> where
    T: LocalSpawnHandle
[src]

impl LocalSpawnHandle for LocalSpawner[src]

Loading content...

Implementors

impl LocalSpawnHandle for Bindgen[src]

impl LocalSpawnHandle for TokioCt[src]

Loading content...