Enum AstStatement
pub enum AstStatement {
Show 15 variants
Expression(AstExpression),
Labeled {
node_id: AstNodeId,
label_name: String,
stmt: Box<AstStatement>,
},
Compound(AstBlock),
Null,
If {
node_id: AstNodeId,
controlling_expr: AstExpression,
then_stmt: Box<AstStatement>,
else_stmt: Option<Box<AstStatement>>,
},
Switch {
node_id: AstNodeId,
controlling_expr: AstExpression,
body: Box<AstStatement>,
},
Case {
switch_node_id: AstNodeId,
constant_expr: AstExpression,
stmt: Box<AstStatement>,
},
Default {
switch_node_id: AstNodeId,
stmt: Box<AstStatement>,
},
While {
node_id: AstNodeId,
controlling_expr: AstExpression,
body: Box<AstStatement>,
},
DoWhile {
node_id: AstNodeId,
body: Box<AstStatement>,
controlling_expr: AstExpression,
},
For {
node_id: AstNodeId,
init: Box<AstForInitializer>,
controlling_expr: Option<AstExpression>,
post_expr: Option<AstExpression>,
body: Box<AstStatement>,
},
Break {
enclosing_stmt_node_id: AstNodeId,
},
Continue {
loop_node_id: AstNodeId,
},
Goto {
node_id: AstNodeId,
label_name: String,
},
Return {
node_id: AstNodeId,
expr: Option<AstExpression>,
},
}Expand description
A statement.
Variants§
Expression(AstExpression)
Labeled
Compound(AstBlock)
Null
If
Fields
§
controlling_expr: AstExpression§
then_stmt: Box<AstStatement>§
else_stmt: Option<Box<AstStatement>>Switch
Case
Default
While
DoWhile
For
Fields
§
init: Box<AstForInitializer>§
controlling_expr: Option<AstExpression>§
post_expr: Option<AstExpression>§
body: Box<AstStatement>Break
Continue
Goto
Return
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AstStatement
impl RefUnwindSafe for AstStatement
impl Send for AstStatement
impl Sync for AstStatement
impl Unpin for AstStatement
impl UnwindSafe for AstStatement
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