Skip to main content

LocalSpawnHandle

Trait LocalSpawnHandle 

Source
pub trait LocalSpawnHandle<Out: 'static> {
    // Required method
    fn spawn_handle_local_obj(
        &self,
        future: LocalFutureObj<'static, Out>,
    ) -> Result<JoinHandle<Out>, SpawnError>;
}
Expand description

This is similar to SpawnHandle except that it allows spawning !Send futures. Please see the docs on SpawnHandle.

Required Methods§

Source

fn spawn_handle_local_obj( &self, future: LocalFutureObj<'static, Out>, ) -> Result<JoinHandle<Out>, SpawnError>

Spawn a future and return a JoinHandle that can be awaited for the output of the future.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Out: 'static, LSH: LocalSpawnHandle<Out> + ?Sized> LocalSpawnHandle<Out> for &LSH

Source§

fn spawn_handle_local_obj( &self, future: LocalFutureObj<'static, Out>, ) -> Result<JoinHandle<Out>, SpawnError>

Source§

impl<Out: 'static, LSH: LocalSpawnHandle<Out> + ?Sized> LocalSpawnHandle<Out> for &mut LSH

Source§

fn spawn_handle_local_obj( &self, future: LocalFutureObj<'static, Out>, ) -> Result<JoinHandle<Out>, SpawnError>

Source§

impl<Out: 'static, LSH: LocalSpawnHandle<Out> + ?Sized> LocalSpawnHandle<Out> for Arc<LSH>

Source§

fn spawn_handle_local_obj( &self, future: LocalFutureObj<'static, Out>, ) -> Result<JoinHandle<Out>, SpawnError>

Source§

impl<Out: 'static, LSH: LocalSpawnHandle<Out> + ?Sized> LocalSpawnHandle<Out> for Rc<LSH>

Source§

fn spawn_handle_local_obj( &self, future: LocalFutureObj<'static, Out>, ) -> Result<JoinHandle<Out>, SpawnError>

Source§

impl<Out: 'static, LSH: LocalSpawnHandle<Out>> LocalSpawnHandle<Out> for Box<LSH>

Source§

fn spawn_handle_local_obj( &self, future: LocalFutureObj<'static, Out>, ) -> Result<JoinHandle<Out>, SpawnError>

Implementors§

Source§

impl<Out: 'static> LocalSpawnHandle<Out> for AsyncStd

Available on crate feature async_std only.