Function thread_future

Source
pub fn thread_future<F, R>(f: F) -> ThreadFuture<R>
where R: Send + 'static, F: FnOnce() -> R + Send + 'static,
Expand description

Run a synchronous function in a separate thread and return its result as a Future.

ยงNote

If the given function panics then so will this future.