pub enum Statement {
Expression(Expression),
Let {
name: String,
binding: Binding,
declared_type: Option<Type>,
value: Expression,
line: u32,
},
Assign(Expression, Expression),
Return(Option<Expression>),
Label {
name: String,
parameters: Vec<Parameter>,
initial_arguments: Vec<Expression>,
},
Jump {
label: String,
arguments: Vec<Expression>,
},
While {
condition: Expression,
body: Block,
},
Defer(Box<Self>),
}Expand description
A statement (no value produced).
Variants§
Expression(Expression)
Expression evaluated for side effects.
Let
Variable binding (let/ref/var).
Fields
§
value: ExpressionInitializer expression.
Assign(Expression, Expression)
Assignment (target := value).
Return(Option<Expression>)
Early return with optional value.
Label
Label definition for structured jumps.
Fields
§
initial_arguments: Vec<Expression>Initial argument values.
Jump
Jump to a label with arguments.
While
While loop.
Defer(Box<Self>)
Deferred statement executed on scope exit.
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