pub enum StmtKind {
Show 17 variants
Labeled {
label: Ident,
body: Box<Stmt>,
},
Case {
value: Expr,
upper: Option<Expr>,
body: Box<Stmt>,
},
Default {
body: Box<Stmt>,
},
Compound(Block),
Expr(Option<Expr>),
If {
cond: Expr,
then_branch: Box<Stmt>,
else_branch: Option<Box<Stmt>>,
},
Switch {
cond: Expr,
body: Box<Stmt>,
},
While {
cond: Expr,
body: Box<Stmt>,
},
DoWhile {
body: Box<Stmt>,
cond: Expr,
},
For {
init: ForInit,
cond: Option<Expr>,
step: Option<Expr>,
body: Box<Stmt>,
},
Goto(Ident),
GotoPtr(Expr),
Continue,
Break,
Return(Option<Expr>),
Asm(Box<AsmStmt>),
Error,
}Expand description
The shape of a Stmt.
Variants§
Labeled
label: stmt
Case
case expr: stmt, and GNU’s case low ... high: stmt.
Fields
Default
default: stmt
Compound(Block)
{ … }
Expr(Option<Expr>)
expr; or the null statement ;.
If
if (cond) then else otherwise
Fields
Switch
switch (cond) body
While
while (cond) body
DoWhile
do body while (cond);
For
for (init; cond; step) body
Fields
Goto(Ident)
goto label;
GotoPtr(Expr)
GNU’s computed goto *expr;, whose operand is a label address.
Continue
continue;
Break
break;
Return(Option<Expr>)
return expr;
Asm(Box<AsmStmt>)
GNU’s inline assembly statement, basic or extended; see AsmStmt.
Error
Produced by error recovery.
Trait Implementations§
impl StructuralPartialEq for StmtKind
Auto Trait Implementations§
impl Freeze for StmtKind
impl RefUnwindSafe for StmtKind
impl Send for StmtKind
impl Sync for StmtKind
impl Unpin for StmtKind
impl UnsafeUnpin for StmtKind
impl UnwindSafe for StmtKind
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