pub enum Statement {
Expression(Expression),
Let {
name: String,
binding: Binding,
declared_type: Option<Type>,
value: Expression,
},
Assign(Expression, Expression),
Return(Option<Expression>),
Label {
name: String,
parameters: Vec<Parameter>,
initial_arguments: Vec<Expression>,
},
Jump {
label: String,
arguments: Vec<Expression>,
},
MultiReplace {
bindings: Vec<Option<(String, Binding)>>,
targets: Vec<Expression>,
values: Vec<Expression>,
},
Defer(Box<Self>),
}Expand description
Statement nodes within a block.
Variants§
Expression(Expression)
Expression evaluated for side effects.
Let
Local variable declaration.
Fields
§
value: ExpressionInitializer expression.
Assign(Expression, Expression)
Assignment to a place expression.
Return(Option<Expression>)
Return from the current function.
Label
Label definition (jump target with parameters).
Fields
§
initial_arguments: Vec<Expression>Initial arguments passed when entering the label.
Jump
Jump to a label with arguments.
MultiReplace
Simultaneous multi-replacement with optional old-value capture.
Fields
§
targets: Vec<Expression>Place expressions to assign to.
§
values: Vec<Expression>New values (evaluated before any assignment).
Defer(Box<Self>)
Deferred statement, executed at the end of the enclosing block (LIFO).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more