pub fn run_with_builder<F, T>(
builder: Builder,
blocking_fn: F,
) -> Result<(impl Future<Output = T>, JoinHandle<()>)>Expand description
Executes a task in a new thread configured by a Builder,
returning a Result wrapping a Future to .await the result and a
JoinHandle to join on the thread.
See the crate-level documentation for details. Unlike run(), this function:
- Receives a
thread::Builderto configure the thread. - Returns an
io::Resultto report any failure in creating the thread. - Returns a
thread::JoinHandleto join on the thread synchronously, in addition to theFutureto.awaitthe result.
ยงErrors
Returns Err if it fails to spawn a thread.