pub enum Stmt {
Show 22 variants
Block(Block),
Empty,
Expression(Expr),
Local(LocalDecl),
Type(Box<TypeDecl>),
If {
condition: Expr,
then_branch: Box<Stmt>,
else_branch: Option<Box<Stmt>>,
},
While {
condition: Expr,
body: Box<Stmt>,
},
DoWhile {
body: Box<Stmt>,
condition: Expr,
},
For {
init: ForInit,
condition: Option<Expr>,
update: Vec<Expr>,
body: Box<Stmt>,
},
EnhancedFor {
binding: ForBinding,
iterable: Expr,
body: Box<Stmt>,
},
Switch(Switch),
Try(TryStmt),
Synchronized {
monitor: Expr,
body: Block,
},
Return(Option<Expr>),
Throw(Expr),
Break(Option<String>),
Continue(Option<String>),
Yield(Expr),
BreakValue(Expr),
Labeled {
label: String,
statement: Box<Stmt>,
},
Assert {
condition: Expr,
detail: Option<Expr>,
},
Commented {
comments: Vec<Comment>,
statement: Box<Stmt>,
},
}Variants§
Block(Block)
Empty
Expression(Expr)
Local(LocalDecl)
Type(Box<TypeDecl>)
If
While
DoWhile
For
EnhancedFor
Switch(Switch)
Try(TryStmt)
Synchronized
Return(Option<Expr>)
Throw(Expr)
Break(Option<String>)
Continue(Option<String>)
Yield(Expr)
BreakValue(Expr)
Java 12 preview only. Distinct from a labeled break.
Labeled
Assert
Commented
Implementations§
Trait Implementations§
Source§impl JavaSource for Stmt
impl JavaSource for Stmt
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Forget for Stmt
impl Freeze for Stmt
impl Move for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnsafeUnpin 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