Skip to main content

off_thread

Function off_thread 

Source
pub async fn off_thread<T, F>(work: F) -> Result<T, Error>
where F: FnOnce() -> Result<T, Error> + Send + 'static, T: Send + 'static,
Available on crate feature async only.
Expand description

Runs blocking configuration work without blocking the caller’s executor.

See load_async for where the work goes.

§Errors

Whatever work returns, plus ErrorKind::Backend if it never produced a result.