syn

Module expr

source

Modules§

Structs§

  • One arm of a match expression: 0..=10 => { return true; }.
  • A slice literal expression: [a, b, c, d].
  • An assignment expression: a = compute().
  • An async block: async { ... }.
  • An await expression: fut.await.
  • A binary operation: a + b, a += b.
  • A blocked scope: { ... }.
  • A break, with an optional label to break and an optional expression.
  • A function call expression: invoke(a, b).
  • A cast expression: foo as f64.
  • A closure expression: |a, b| a + b.
  • A const block: const { ... }.
  • A continue, with an optional label.
  • Access of a named struct field (obj.k) or unnamed tuple struct field (obj.0).
  • A for loop: for pat in expr { ... }.
  • An expression contained within invisible delimiters.
  • An if expression with an optional else block: if expr { ... } else { ... }.
  • A square bracketed indexing expression: vector[2].
  • The inferred value of a const generic argument, denoted _.
  • A let guard: let Some(x) = opt.
  • A literal in place of an expression: 1, "foo".
  • Conditionless loop: loop { ... }.
  • A macro invocation expression: format!("{}", q).
  • A match expression: match n { Some(n) => {}, None => {} }.
  • A method call expression: x.foo::<T>(a, b).
  • A parenthesized expression: (a + b).
  • A path like std::mem::replace possibly containing generic parameters and a qualified self-type.
  • A range expression: 1..2, 1.., ..2, 1..=2, ..=2.
  • Address-of operation: &raw const place or &raw mut place.
  • A referencing operation: &a or &mut a.
  • An array literal constructed from one repeated element: [0u8; N].
  • A return, with an optional value to be returned.
  • A struct literal expression: Point { x: 1, y: 1 }.
  • A try-expression: expr?.
  • A try block: try { ... }.
  • A tuple expression: (a, b, c, d).
  • A unary operation: !x, *x.
  • An unsafe block: unsafe { ... }.
  • A while loop: while expr { ... }.
  • A yield expression: yield expr.
  • A field-value pair in a struct literal.
  • The index of an unnamed tuple struct field.
  • A lifetime labeling a for, while, or loop.

Enums§

  • A Rust expression.
  • A struct or tuple struct field accessed in a struct literal or field expression.
  • Mutability of a raw pointer (*const T, *mut T), in which non-mutable isn’t the implicit default.
  • Limit types of a range, inclusive or exclusive.