pub enum StmtKind {
Let {
mutable: bool,
pattern: Pattern,
type_ann: Option<TypeAnn>,
value: Expr,
},
ExprStmt {
expr: Expr,
has_semi: bool,
},
FnDecl {
name: String,
params: Vec<Param>,
body: Vec<Stmt>,
},
For {
label: Option<String>,
pattern: Pattern,
iter: Expr,
body: Vec<Stmt>,
},
While {
label: Option<String>,
cond: Expr,
body: Vec<Stmt>,
},
WhileLet {
label: Option<String>,
pattern: Pattern,
expr: Expr,
body: Vec<Stmt>,
},
Loop {
label: Option<String>,
body: Vec<Stmt>,
},
Break {
label: Option<String>,
value: Option<Expr>,
},
Continue {
label: Option<String>,
},
Use {
path: Vec<String>,
imports: UseImports,
},
Return {
value: Option<Expr>,
},
Assign {
target: AssignTarget,
op: AssignOp,
value: Expr,
},
}Variants§
Let
let [mut] pattern [: type] = expr;
ExprStmt
Expression statement (with trailing semicolon = discards value)
FnDecl
fn name(params) { body }
For
['label:] for pattern in expr { body }
While
['label:] while cond { body }
WhileLet
['label:] while let pattern = expr { body }
Loop
['label:] loop { body }
Break
break ['label] [expr];
Continue
continue ['label];
Use
use module::{name1, name2} or use module::*
Return
return [expr];
Assign
Assignment: lhs = rhs; or lhs += rhs;
Trait Implementations§
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