Function spawn_future

pub fn spawn_future<R, F>(f: F) -> JoinHandle<R> 
where R: Send + 'static, F: Future<Output = R> + Send + 'static,
Expand description

Spawn a new infallible Future on the thread-default main context.

This can be called from any thread and will execute the future from the thread where main context is running, e.g. via a MainLoop.