pub enum ExprKind {
Show 47 variants
Literal(Literal),
Var {
def_id: HirId,
name: Symbol,
},
Binary {
op: BinOp,
left: Box<Expr>,
right: Box<Expr>,
},
Unary {
op: UnOp,
expr: Box<Expr>,
},
Call {
func: Box<Expr>,
args: Vec<Expr>,
},
MethodCall {
receiver: Box<Expr>,
method: Symbol,
args: Vec<Expr>,
},
Field {
expr: Box<Expr>,
field: Symbol,
field_idx: usize,
},
Index {
expr: Box<Expr>,
index: Box<Expr>,
},
MultiDimIndex {
expr: Box<Expr>,
indices: Vec<HirIndexComponent>,
},
Tuple {
elements: Vec<Expr>,
},
Array {
elements: Vec<Expr>,
},
ArrayRepeat {
element: Box<Expr>,
count: u64,
},
Struct {
def_id: HirId,
fields: Vec<FieldInit>,
variant_name: Option<Symbol>,
},
Block(Block),
If {
condition: Box<Expr>,
then_block: Block,
else_block: Option<Box<Expr>>,
},
Match {
expr: Box<Expr>,
arms: Vec<MatchArm>,
},
Loop {
body: Block,
},
While {
condition: Box<Expr>,
body: Block,
},
For {
pattern: Pattern,
iter: Box<Expr>,
body: Block,
},
Return {
value: Option<Box<Expr>>,
},
Break {
value: Option<Box<Expr>>,
},
Continue,
Assign {
target: Box<Expr>,
value: Box<Expr>,
},
Ref {
mutable: bool,
expr: Box<Expr>,
},
Deref {
expr: Box<Expr>,
},
Cast {
expr: Box<Expr>,
target_ty: Ty,
},
Spawn {
expr: Box<Expr>,
},
SpawnWithDeadline {
deadline: Box<Expr>,
body: Block,
},
TaskGroup {
body: Block,
},
TaskGroupAll {
body: Block,
},
Channel {
element_ty: Ty,
capacity: Box<Expr>,
},
Select {
arms: Vec<HirSelectArm>,
},
SelectBiased {
arms: Vec<HirSelectArm>,
},
Gpu {
body: Block,
},
Distributed {
body: Block,
},
EnergyBudgetBlock {
budget: EnergyBudgetConstraint,
body: Block,
},
ThermalAdapt {
arms: Vec<HirThermalArm>,
},
Await {
expr: Box<Expr>,
},
Try {
expr: Box<Expr>,
},
SpawnRemote {
node: Box<Expr>,
expr: Box<Expr>,
},
Cancelled,
Path {
segments: Vec<Symbol>,
},
Closure {
params: Vec<Param>,
return_ty: Ty,
body: Box<Expr>,
captures: Vec<Capture>,
is_move: bool,
},
Perform {
effect_name: Symbol,
operation: Symbol,
args: Vec<Expr>,
},
Handle {
body: Block,
handlers: Vec<HirEffectHandler>,
},
Parallel {
pattern: Pattern,
iter: Box<Expr>,
body: Block,
},
Build {
builder_ty: Ty,
body: Block,
},
}Variants§
Literal(Literal)
Literal value
Var
Variable reference (resolved to definition)
Binary
Binary operation
Unary
Unary operation
Call
Function call
MethodCall
Method call
Field
Field access
Index
Index
MultiDimIndex
Multi-dimensional index: arr[i, j], arr[1..5, ::2]
Tuple
Tuple
Array
Array
ArrayRepeat
Array repeat [value; count]
Struct
Struct literal (variant_name is set for enum variant struct literals like Enum::Variant { .. })
Block(Block)
Block
If
If expression
Match
Match expression
Loop
Loop
While
While loop
For
For loop
Return
Return
Break
Break
Continue
Continue
Assign
Assignment
Ref
Reference &x or &mut x
Deref
Dereference *x
Cast
Type cast x as T
Spawn
Spawn a task
SpawnWithDeadline
Spawn with deadline
TaskGroup
Task group (structured concurrency)
TaskGroupAll
Task group collecting all results
Channel
Channel creation
Select
Select (random among ready)
Fields
arms: Vec<HirSelectArm>SelectBiased
Biased select (first-listed priority)
Fields
arms: Vec<HirSelectArm>Gpu
GPU execution block
Distributed
Distributed execution block
EnergyBudgetBlock
Energy budget block: energy_budget(max_joules = 0.001) { … }
ThermalAdapt
Thermal adaptation: thermal_adapt { Cool => { … }, Hot => { … } }
Fields
arms: Vec<HirThermalArm>Await
Await expression: expr.await (extracts value from Future/Task)
Try
Try operator: expr?
SpawnRemote
Remote spawn
Cancelled
Check if current task is cancelled
Path
Qualified path (like EnumName::VariantName)
Closure
Closure expression
Perform
Perform an algebraic effect operation: perform IO::read()
Handle
Handle algebraic effects: handle { body } with { IO => handler }
Parallel
Parallel for loop: parallel for x in iter { body }
Build
Result builder expression: build TypeName { stmt1; stmt2; ... }