Curriculum Production Rust Async basics
Async basics
Rust async is explicit: async fn returns a future, .await yields within an executor, and most real async code is runtime-specific. This theme stays runtime-light and focuses on the mental model. Planned exercises: 1. choose async fn. 2. recognise .await. 3. choose Result in async functions. 4. fill an async call. 5. fill an awaited result. 6. write a small async helper signature. 7. compose two awaited operations. 8. translate TS promise code. 9. fix a future that was created but never awaited.
Exercises
9 ready
01
pick one
Declare an async function returning i32 with value 42.
02
pick one
Inside an async fn, call another async fn inner() and bind
03
pick one
A fallible async function either succeeds with an i32 or
04
fill blanks
Fill the modifier that turns a synchronous fn declaration
05
fill blanks
Fill the POSTFIX suffix that turns a Future expression into
06
pick one
Pick the BODY for async fn double(x: i32) -> i32 that
07
pick one
Inside async fn run() -> i32, compose TWO awaited calls
08
pick one
Translate console.log(await shout("hi")) to Rust where
09
pick one
This line fails to compile because compute is async: