pub fn block_on<F>(task: impl IntoFuture<IntoFuture = F>) -> F::Outputwhere
F: Future,Expand description
Blocks the thread until the task future finishes.
The crate futures-lite is used to execute the task.
ยงExamples
Test a run call:
use zng_task as task;
pub fn run_ok() {
let r = task::block_on(task::run(async { foo(32).await }));
r.expect("foo(32) was not Ok");
}