Rust · Concept
async and await
Rust's async keyword creates a future from a function, closure, or block. The code runs when the future is awaited or polled, not when it is created.
Last updated
Syntax
async fn name(parameters) -> ReturnType { ... }
async { ... }
async || { ... }In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
awaitFutureasync blocksasync functionsasync closuresasynchronous runtimes