Module expr
Source - parsing 🔒
- printing 🔒
- Arm
- One arm of a
match
expression: 0..=10 => { return true; }
. - ExprArray
- A slice literal expression:
[a, b, c, d]
. - ExprAssign
- An assignment expression:
a = compute()
. - ExprAsync
- An async block:
async { ... }
. - ExprAwait
- An await expression:
fut.await
. - ExprBinary
- A binary operation:
a + b
, a += b
. - ExprBlock
- A blocked scope:
{ ... }
. - ExprBreak
- A
break
, with an optional label to break and an optional
expression. - ExprCall
- A function call expression:
invoke(a, b)
. - ExprCast
- A cast expression:
foo as f64
. - ExprClosure
- A closure expression:
|a, b| a + b
. - ExprConst
- A const block:
const { ... }
. - ExprContinue
- A
continue
, with an optional label. - ExprField
- Access of a named struct field (
obj.k
) or unnamed tuple struct
field (obj.0
). - ExprForLoop
- A for loop:
for pat in expr { ... }
. - ExprGroup
- An expression contained within invisible delimiters.
- ExprIf
- An
if
expression with an optional else
block: if expr { ... } else { ... }
. - ExprIndex
- A square bracketed indexing expression:
vector[2]
. - ExprInfer
- The inferred value of a const generic argument, denoted
_
. - ExprLet
- A
let
guard: let Some(x) = opt
. - ExprLit
- A literal in place of an expression:
1
, "foo"
. - ExprLoop
- Conditionless loop:
loop { ... }
. - ExprMacro
- A macro invocation expression:
format!("{}", q)
. - ExprMatch
- A
match
expression: match n { Some(n) => {}, None => {} }
. - ExprMethodCall
- A method call expression:
x.foo::<T>(a, b)
. - ExprParen
- A parenthesized expression:
(a + b)
. - ExprPath
- A path like
std::mem::replace
possibly containing generic
parameters and a qualified self-type. - ExprRange
- A range expression:
1..2
, 1..
, ..2
, 1..=2
, ..=2
. - ExprRawAddr
- Address-of operation:
&raw const place
or &raw mut place
. - ExprReference
- A referencing operation:
&a
or &mut a
. - ExprRepeat
- An array literal constructed from one repeated element:
[0u8; N]
. - ExprReturn
- A
return
, with an optional value to be returned. - ExprStruct
- A struct literal expression:
Point { x: 1, y: 1 }
. - ExprTry
- A try-expression:
expr?
. - ExprTryBlock
- A try block:
try { ... }
. - ExprTuple
- A tuple expression:
(a, b, c, d)
. - ExprUnary
- A unary operation:
!x
, *x
. - ExprUnsafe
- An unsafe block:
unsafe { ... }
. - ExprWhile
- A while loop:
while expr { ... }
. - ExprYield
- A yield expression:
yield expr
. - FieldValue
- A field-value pair in a struct literal.
- Index
- The index of an unnamed tuple struct field.
- Label
- A lifetime labeling a
for
, while
, or loop
.
- Expr
- A Rust expression.
- Member
- A struct or tuple struct field accessed in a struct literal or field
expression.
- PointerMutability
- Mutability of a raw pointer (
*const T
, *mut T
), in which non-mutable
isn’t the implicit default. - RangeLimits
- Limit types of a range, inclusive or exclusive.