pub fn block_on<F, T>(future: F) -> TExpand description
Block on a future to completion 阻塞等待future完成
This function will block the current thread until the future completes. 此函数将阻塞当前线程直到future完成。
§Example / 示例
ⓘ
use hiver_runtime::task::block_on;
block_on(async {
println!("Hello from async!");
});Note: This creates a temporary runtime for the execution. 注意:这会创建一个临时运行时来执行。