pub enum Stmt {
LocalDecl(LocalDecl),
Assign(AssignStmt),
Expr(Expr),
If(IfStmt),
While(WhileStmt),
For(ForStmt),
Return(Option<Expr>),
Break,
Continue,
Block(Block),
}Expand description
One statement. Statements that contain expressions own the Expr
directly — no Rc/Box indirection at the top level.
Variants§
LocalDecl(LocalDecl)
<type> <name> [= <init>]; or <type> <name>[<n>];
Assign(AssignStmt)
<lhs> [op]= <rhs>; with the same =/+=/-=/*=//=/%= set
the lexer recognises.
Expr(Expr)
<expr>; — statement form of an expression (typically a call).
If(IfStmt)
if (<cond>) <then> [else <else>]
While(WhileStmt)
while (<cond>) <body> and do <body> while (<cond>);
For(ForStmt)
for (<init>; <cond>; <step>) <body>
Return(Option<Expr>)
return [<expr>];
Break
break;
Continue
continue;
Block(Block)
{ ... }
Trait Implementations§
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnwindSafe for Stmt
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