# A final proposal for await syntax

**URL:** <https://internals.rust-lang.org/t/a-final-proposal-for-await-syntax/10021>\
**Category:** language design\
**Created:** [May 6, 2019, 2:36pm UTC](https://internals.rust-lang.org/t/a-final-proposal-for-await-syntax/10021 "2019-05-06T14:36:19Z")\
**Posts on this page:** 1\
**Showing post:** 105

<div class="post-metadata">

**Author:** ![newpavlov](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/newpavlov/32/3290_2.png) [@newpavlov](https://internals.rust-lang.org/u/newpavlov)\
**Post date:** [May 8, 2019, 6:12am UTC](https://internals.rust-lang.org/t/a-final-proposal-for-await-syntax/10021/105 "2019-05-08T06:12:31Z")

</div>

> [@mgeisler](#):
>
> There can be no `.for` since for-loops aren’t expressions

This may [change](https://internals.rust-lang.org/t/pre-rfc-generator-integration-with-for-loops/6625) in future, plus I think using chained `for` as a more powerful `for_each` (you can `return` and `break`) is not a bad use-case.

Another keyword which may be used in chaining is `yield` if we'll get generators with resume argument.

And `if` chaining may be extended to support `if let`, which will make it more powerful.

Also I personally wouldn't exclude keywords which evaluate to `!` or `()` right away. It may be worth to keep whole expression in "reverse" order to minimize number of cognitive context switches:

```rust
// I will use @ instead of dot in this example
connection
    .handshake()
    @await
    @if let Handshake::Success(body) {
        body
    } else {
        return Err("handshake failure");
    }
    .get_body()
    @await?
    .process()
    @return;

```

---

_[View the full topic](https://internals.rust-lang.org/t/a-final-proposal-for-await-syntax/10021)._
