Skip to content

Instantly share code, notes, and snippets.

@HeroicKatora
Created February 22, 2019 13:36
Show Gist options
  • Save HeroicKatora/3dec0f34483c285cb8e33bb4dd9e3d9f to your computer and use it in GitHub Desktop.
Save HeroicKatora/3dec0f34483c285cb8e33bb4dd9e3d9f to your computer and use it in GitHub Desktop.
Await syntax summary
A hopefully complete list of all proposed syntaxes:
await!(fut)
await fut
await? fut
await fut?
await(fut)
await{ fut }
fut await
fut.await
maybe with prefix `await fut` through unified macro
and `val.match`
fut(await)
fut.await()
fut.await!()
maybe with prefix `await fut` through unified macro
fut#
fut@
fut$
fut!
fut@await
fut...
fut~
<--fut
(not quite sure what exactly)
go fut
fut->
|> fut
fut.[it]
`it` being a keyword refering to an implicit argument to `[]` block
fut^^
fut>>>
A not quite arbitrary selection of relevant comparison posts:
<https://aturon.github.io/2018/04/24/async-borrowing/> On why postfix is not about combinators
<https://github.com/rust-lang/rust/issues/57640#issuecomment-455361619> future of result vs. result of future
<https://github.com/rust-lang/rust/issues/57640#issuecomment-455749122> chaining visibility comparison
<https://github.com/rust-lang/rust/issues/57640#issuecomment-455763530> extended comparison table
<https://github.com/rust-lang/rust/issues/57640#issuecomment-455836523> comparison on reqwest use case
<https://github.com/rust-lang/rust/issues/57640#issuecomment-455846086> real world example transformation await!() to pre/postfix
<https://github.com/rust-lang/rust/issues/57640#issuecomment-456625030> links to arguments for/against prefix/postfix/macro
<https://github.com/rust-lang/rust/issues/57640#issuecomment-456672228> list of goals and evaluation summary
<https://github.com/rust-lang/rust/issues/57640#issuecomment-457101180> prosa summary of postfix vs. prefix
<https://github.com/rust-lang/rust/issues/57640#issuecomment-457457727> prefix survey in C# code and Rust comparison
<https://github.com/rust-lang/rust/issues/57640#issuecomment-457503195> specific sigil vs postfix comparison
<https://github.com/rust-lang/rust/issues/57640#issuecomment-457976527> reminder to focus semantic, not only syntactic, differences
<https://github.com/rust-lang/rust/issues/57640#issuecomment-458022676> chaining appears seldomly used in async code currently
<https://github.com/rust-lang/rust/issues/57640#issuecomment-461679267> summary&response to criticisms of postfix @
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment