Enum unrest_tmp_syn::ExprKind [] [src]

pub enum ExprKind {
    Box(ExprBox),
    InPlace(ExprInPlace),
    Array(ExprArray),
    Call(ExprCall),
    MethodCall(ExprMethodCall),
    Tup(ExprTup),
    Binary(ExprBinary),
    Unary(ExprUnary),
    Lit(Lit),
    Cast(ExprCast),
    Type(ExprType),
    If(ExprIf),
    IfLet(ExprIfLet),
    While(ExprWhile),
    WhileLet(ExprWhileLet),
    ForLoop(ExprForLoop),
    Loop(ExprLoop),
    Match(ExprMatch),
    Closure(ExprClosure),
    Block(ExprBlock),
    Assign(ExprAssign),
    AssignOp(ExprAssignOp),
    Field(ExprField),
    TupField(ExprTupField),
    Index(ExprIndex),
    Range(ExprRange),
    Path(ExprPath),
    AddrOf(ExprAddrOf),
    Break(ExprBreak),
    Continue(ExprContinue),
    Ret(ExprRet),
    Mac(Mac),
    Struct(ExprStruct),
    Repeat(ExprRepeat),
    Paren(ExprParen),
    Group(ExprGroup),
    Try(ExprTry),
    Catch(ExprCatch),
    Yield(ExprYield),
}

Variants

A box x expression.

E.g. 'place <- val' or in place { val }.

An array, e.g. [a, b, c, d].

A function call.

A method call (x.foo::<Bar, Baz>(a, b, c, d))

The Ident is the identifier for the method name. The vector of Tys are the ascripted type parameters for the method (within the angle brackets).

Thus, x.foo::<Bar, Baz>(a, b, c, d) is represented as ExprKind::MethodCall(foo, [Bar, Baz], [x, a, b, c, d]).

A tuple, e.g. (a, b, c, d).

A binary operation, e.g. a + b, a * b.

A unary operation, e.g. !x, *x.

A literal, e.g. 1, "foo".

A cast, e.g. foo as f64.

A type ascription, e.g. foo: f64.

An if block, with an optional else block

E.g., if expr { block } else { expr }

An if let expression with an optional else block

E.g., if let pat = expr { block } else { expr }

This is desugared to a match expression.

A while loop, with an optional label

E.g., 'label: while expr { block }

A while-let loop, with an optional label.

E.g., 'label: while let pat = expr { block }

This is desugared to a combination of loop and match expressions.

A for loop, with an optional label.

E.g., 'label: for pat in expr { block }

This is desugared to a combination of loop and match expressions.

Conditionless loop with an optional label.

E.g. 'label: loop { block }

A match block.

A closure (for example, move |a, b, c| a + b + c)

A block ({ ... } or unsafe { ... })

An assignment (a = foo())

An assignment with an operator

For example, a += 1.

Access of a named struct field (obj.foo)

Access of an unnamed field of a struct or tuple-struct

For example, foo.0.

An indexing operation (foo[2])

A range (1..2, 1.., ..2, 1...2, 1..., ...2)

Variable reference, possibly containing :: and/or type parameters, e.g. foo::bar::.

Optionally "qualified", E.g. <Vec<T> as SomeTrait>::SomeType.

A referencing operation (&a or &mut a)

A break, with an optional label to break, and an optional expression

A continue, with an optional label

A return, with an optional value to be returned

A macro invocation; pre-expansion

A struct literal expression.

For example, Foo {x: 1, y: 2}, or Foo {x: 1, .. base}, where base is the Option<Expr>.

An array literal constructed from one repeated element.

For example, [1; 5]. The first expression is the element to be repeated; the second is the number of times to repeat it.

No-op: used solely so we can pretty-print faithfully

No-op: used solely so we can pretty-print faithfully

A group represents a None-delimited span in the input TokenStream which affects the precidence of the resulting expression. They are used for macro hygiene.

expr?

A catch expression.

E.g. do catch { block }

A yield expression.

E.g. yield expr

Trait Implementations

impl Clone for ExprKind
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl From<ExprBox> for ExprKind
[src]

Performs the conversion.

impl From<ExprInPlace> for ExprKind
[src]

Performs the conversion.

impl From<ExprArray> for ExprKind
[src]

Performs the conversion.

impl From<ExprCall> for ExprKind
[src]

Performs the conversion.

impl From<ExprMethodCall> for ExprKind
[src]

Performs the conversion.

impl From<ExprTup> for ExprKind
[src]

Performs the conversion.

impl From<ExprBinary> for ExprKind
[src]

Performs the conversion.

impl From<ExprUnary> for ExprKind
[src]

Performs the conversion.

impl From<Lit> for ExprKind
[src]

Performs the conversion.

impl From<ExprCast> for ExprKind
[src]

Performs the conversion.

impl From<ExprType> for ExprKind
[src]

Performs the conversion.

impl From<ExprIf> for ExprKind
[src]

Performs the conversion.

impl From<ExprIfLet> for ExprKind
[src]

Performs the conversion.

impl From<ExprWhile> for ExprKind
[src]

Performs the conversion.

impl From<ExprWhileLet> for ExprKind
[src]

Performs the conversion.

impl From<ExprForLoop> for ExprKind
[src]

Performs the conversion.

impl From<ExprLoop> for ExprKind
[src]

Performs the conversion.

impl From<ExprMatch> for ExprKind
[src]

Performs the conversion.

impl From<ExprClosure> for ExprKind
[src]

Performs the conversion.

impl From<ExprBlock> for ExprKind
[src]

Performs the conversion.

impl From<ExprAssign> for ExprKind
[src]

Performs the conversion.

impl From<ExprAssignOp> for ExprKind
[src]

Performs the conversion.

impl From<ExprField> for ExprKind
[src]

Performs the conversion.

impl From<ExprTupField> for ExprKind
[src]

Performs the conversion.

impl From<ExprIndex> for ExprKind
[src]

Performs the conversion.

impl From<ExprRange> for ExprKind
[src]

Performs the conversion.

impl From<ExprPath> for ExprKind
[src]

Performs the conversion.

impl From<ExprAddrOf> for ExprKind
[src]

Performs the conversion.

impl From<ExprBreak> for ExprKind
[src]

Performs the conversion.

impl From<ExprContinue> for ExprKind
[src]

Performs the conversion.

impl From<ExprRet> for ExprKind
[src]

Performs the conversion.

impl From<Mac> for ExprKind
[src]

Performs the conversion.

impl From<ExprStruct> for ExprKind
[src]

Performs the conversion.

impl From<ExprRepeat> for ExprKind
[src]

Performs the conversion.

impl From<ExprParen> for ExprKind
[src]

Performs the conversion.

impl From<ExprGroup> for ExprKind
[src]

Performs the conversion.

impl From<ExprTry> for ExprKind
[src]

Performs the conversion.

impl From<ExprCatch> for ExprKind
[src]

Performs the conversion.

impl From<ExprYield> for ExprKind
[src]

Performs the conversion.

impl ToTokens for ExprKind
[src]

Write self to the given Tokens. Read more

Convert self directly into a Tokens object. Read more