Enum ra_ap_hir_def::expr::Expr[][src]

pub enum Expr {
Show variants Missing, Path(Path), If { condition: ExprId, then_branch: ExprId, else_branch: Option<ExprId>, }, Block { id: BlockId, statements: Vec<Statement>, tail: Option<ExprId>, label: Option<LabelId>, }, Loop { body: ExprId, label: Option<LabelId>, }, While { condition: ExprId, body: ExprId, label: Option<LabelId>, }, For { iterable: ExprId, pat: PatId, body: ExprId, label: Option<LabelId>, }, Call { callee: ExprId, args: Vec<ExprId>, }, MethodCall { receiver: ExprId, method_name: Name, args: Vec<ExprId>, generic_args: Option<Box<GenericArgs>>, }, Match { expr: ExprId, arms: Vec<MatchArm>, }, Continue { label: Option<Name>, }, Break { expr: Option<ExprId>, label: Option<Name>, }, Return { expr: Option<ExprId>, }, Yield { expr: Option<ExprId>, }, RecordLit { path: Option<Box<Path>>, fields: Vec<RecordLitField>, spread: Option<ExprId>, }, Field { expr: ExprId, name: Name, }, Await { expr: ExprId, }, Try { expr: ExprId, }, TryBlock { body: ExprId, }, Async { body: ExprId, }, Const { body: ExprId, }, Cast { expr: ExprId, type_ref: Interned<TypeRef>, }, Ref { expr: ExprId, rawness: Rawness, mutability: Mutability, }, Box { expr: ExprId, }, UnaryOp { expr: ExprId, op: UnaryOp, }, BinaryOp { lhs: ExprId, rhs: ExprId, op: Option<BinaryOp>, }, Range { lhs: Option<ExprId>, rhs: Option<ExprId>, range_type: RangeOp, }, Index { base: ExprId, index: ExprId, }, Lambda { args: Vec<PatId>, arg_types: Vec<Option<Interned<TypeRef>>>, ret_type: Option<Interned<TypeRef>>, body: ExprId, }, Tuple { exprs: Vec<ExprId>, }, Unsafe { body: ExprId, }, MacroStmts { tail: ExprId, }, Array(Array), Literal(Literal),
}

Variants

Missing

This is produced if the syntax tree does not have a required expression piece.

Path(Path)
If
Show fields

Fields of If

condition: ExprIdthen_branch: ExprIdelse_branch: Option<ExprId>
Block
Show fields

Fields of Block

id: BlockIdstatements: Vec<Statement>tail: Option<ExprId>label: Option<LabelId>
Loop
Show fields

Fields of Loop

body: ExprIdlabel: Option<LabelId>
While
Show fields

Fields of While

condition: ExprIdbody: ExprIdlabel: Option<LabelId>
For
Show fields

Fields of For

iterable: ExprIdpat: PatIdbody: ExprIdlabel: Option<LabelId>
Call
Show fields

Fields of Call

callee: ExprIdargs: Vec<ExprId>
MethodCall
Show fields

Fields of MethodCall

receiver: ExprIdmethod_name: Nameargs: Vec<ExprId>generic_args: Option<Box<GenericArgs>>
Match
Show fields

Fields of Match

expr: ExprIdarms: Vec<MatchArm>
Continue
Show fields

Fields of Continue

label: Option<Name>
Break
Show fields

Fields of Break

expr: Option<ExprId>label: Option<Name>
Return
Show fields

Fields of Return

expr: Option<ExprId>
Yield
Show fields

Fields of Yield

expr: Option<ExprId>
RecordLit
Show fields

Fields of RecordLit

path: Option<Box<Path>>fields: Vec<RecordLitField>spread: Option<ExprId>
Field
Show fields

Fields of Field

expr: ExprIdname: Name
Await
Show fields

Fields of Await

expr: ExprId
Try
Show fields

Fields of Try

expr: ExprId
TryBlock
Show fields

Fields of TryBlock

body: ExprId
Async
Show fields

Fields of Async

body: ExprId
Const
Show fields

Fields of Const

body: ExprId
Cast
Show fields

Fields of Cast

expr: ExprIdtype_ref: Interned<TypeRef>
Ref
Show fields

Fields of Ref

expr: ExprIdrawness: Rawnessmutability: Mutability
Box
Show fields

Fields of Box

expr: ExprId
UnaryOp
Show fields

Fields of UnaryOp

expr: ExprIdop: UnaryOp
BinaryOp
Show fields

Fields of BinaryOp

lhs: ExprIdrhs: ExprIdop: Option<BinaryOp>
Range
Show fields

Fields of Range

lhs: Option<ExprId>rhs: Option<ExprId>range_type: RangeOp
Index
Show fields

Fields of Index

base: ExprIdindex: ExprId
Lambda
Show fields

Fields of Lambda

args: Vec<PatId>arg_types: Vec<Option<Interned<TypeRef>>>ret_type: Option<Interned<TypeRef>>body: ExprId
Tuple
Show fields

Fields of Tuple

exprs: Vec<ExprId>
Unsafe
Show fields

Fields of Unsafe

body: ExprId
MacroStmts
Show fields

Fields of MacroStmts

tail: ExprId
Array(Array)
Literal(Literal)

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.