Skip to main content

blocking

Function blocking 

Source
pub async fn blocking<F, T>(f: F) -> Result<T>
where F: FnOnce() -> Result<T> + Send + 'static, T: Send + 'static,
Expand description

Run f on a blocking worker, flattening the join error into io::Error.

A join error means the worker panicked or was cancelled. There is no meaningful filesystem answer in that case, so it surfaces as io::ErrorKind::Other rather than being unwrapped into a second panic on the caller’s thread.