pub trait SpawnHandleExt<Out: 'static + Send>: SpawnHandle<Out> {
    // Required method
    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§

source

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.

Implementors§

source§

impl<T, Out> SpawnHandleExt<Out> for Twhere T: SpawnHandle<Out> + ?Sized, Out: 'static + Send,