pub enum Statement {
Show 14 variants
Expression(Expression),
Return(Option<Expression>),
Block(Vec<Statement>),
Try(TryStatement),
Throw(Expression),
If {
condition: Expression,
then_branch: Box<Statement>,
else_branch: Option<Box<Statement>>,
},
While {
condition: Expression,
body: Box<Statement>,
},
DoWhile {
condition: Expression,
body: Box<Statement>,
},
For {
init: Option<Box<Statement>>,
condition: Option<Expression>,
update: Option<Expression>,
body: Box<Statement>,
},
ForEach {
item_type: String,
item_name: String,
iterable: Expression,
body: Box<Statement>,
},
Switch {
selector: Expression,
cases: Vec<SwitchCase>,
default: Option<Vec<Statement>>,
},
Break,
Continue,
LocalVariable {
type: String,
name: String,
initializer: Option<Expression>,
},
}Expand description
Statement.
Variants§
Expression(Expression)
Expression statement.
Return(Option<Expression>)
Return statement.
Block(Vec<Statement>)
Block statement.
Try(TryStatement)
Try statement.
Throw(Expression)
Throw statement.
If
If statement.
Fields
§
condition: ExpressionCondition expression.
While
While loop.
DoWhile
Do-while loop.
For
For loop.
Fields
§
condition: Option<Expression>Condition expression.
§
update: Option<Expression>Update expression.
ForEach
For-each loop.
Fields
§
iterable: ExpressionIterable expression.
Switch
Switch statement.
Break
Break statement.
Continue
Continue statement.
LocalVariable
Local variable declaration statement.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Statement
impl<'de> Deserialize<'de> for Statement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
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