rust-lang / async-book

Asynchronous Programming in Rust
https://rust-lang.github.io/async-book/index.html
MIT License
1.79k stars 241 forks source link

`.await` explanation #183

Open alecandido opened 1 year ago

alecandido commented 1 year ago

In both sections 1.3. async/.await Primer and 3. async/.await there is no actual explanation of how .await is supposed to work.

The only attempt is in Why Pinning, in which it is written:

To understand why this is necessary, we need to remember how async/.await works.

Even though it is trying to recall something that has never been explained before...

The funny bit is that the async book is also the reference mentioned by the std docs about the keywords: https://doc.rust-lang.org/std/keyword.await.html While a more proper reference would have been The Reference: https://doc.rust-lang.org/reference/expressions/await-expr.html