source: doc/papers/concurrency/examples/future.rs @ 331eacbe

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 331eacbe was 2aab69b, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

files added to concurrency paper

  • Property mode set to 100644
File size: 233 bytes
Line 
1use futures::executor::block_on;
2
3async fn hello_world() {
4    println!("hello, world!");
5}
6
7fn main() {
8    let future = hello_world(); // Nothing is printed
9    block_on(future); // `future` is run and "hello, world!" is printed
10}
Note: See TracBrowser for help on using the repository browser.