Async Await Example
use futures::executor::block_on; async fn hello_world() { println!("hello, world!"); } async fn async_main(){ let future = hello_world(); // Nothing is printed let a = future.await; } fn main() { block_on(async_main()); }
use futures::executor::block_on; async fn hello_world() { println!("hello, world!"); } async fn async_main(){ let future = hello_world(); // Nothing is printed let a = future.await; } fn main() { block_on(async_main()); }