pub async fn spawn_blocking<F, T>(f: F) -> TExpand description
Spawns a blocking operation and returns a Future that yields until completion.
This function runs the provided closure on the runtime blocking pool when
a current Cx is available, and falls back to a dedicated thread when
no runtime context is set.
§Type Bounds
F: FnOnce() -> T + Send + 'static- The closure must be sendable to another threadT: Send + 'static- The return value must be sendable back
§Cancel Safety
If this future is dropped before completion, the blocking operation continues to run but its result is discarded.
§Panics
If the blocking operation panics, the panic is captured and re-raised when the future is awaited.