pub fn block_on<F, T>(future: F) -> T where
F: Future<Output = T>,
Spawns a task and blocks the current thread on its result.
Calling this function is similar to spawning a thread and immediately joining it, except an
asynchronous task will be spawned.
use async_std::task;
fn main() {
task::block_on(async {
println!("Hello, world!");
})
}