Expand description
Exposing awaits that sit inside larger statements.
An await in a match scrutinee, an if condition, or a call argument is evaluated before the
rest of its statement anyway. Hoisting it into its own binding (let __psync_s1 = x.await;)
keeps the evaluation order but turns it into a node that can overlap with other work, while
the remainder of the statement stays where it was.
Functionsยง
- awaits ๐
- condition ๐
- For loop fission: split
if c {..}/if let p = c {..}/match c {..}whose branches await but whose conditioncdoes not intolet __psync_cN = c;and the statement reading it. - is_
compound_ ๐assign - operands ๐
- Hoist the awaited operands of a call, method call, assignment, array, tuple or
vec!into bindings, together with any earlier operands that are not pure, so they still evaluate in order. Also hoists an awaited method receiver (x.await?.items()), which evaluates first.freshnumbers the new bindings. - scrutinee ๐
- Split
match e.await {..},if let p = e.await {..},if e.await {..}, the same forms as aletinitializer, andlet p = e.await else {..}intolet __psync_sN = e.await;and the statement reading__psync_sN.