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
语句
Variants§
Expression(Expression)
表达式语句
Return(Option<Expression>)
返回语句
Block(Vec<Statement>)
块语句
Try(TryStatement)
Try 语句
Throw(Expression)
Throw 语句
If
条件判断
While
While 循环
DoWhile
Do-While 循环
For
For 循环
ForEach
For-Each 循环
Switch
Switch 语句
Break
Break 语句
Continue
Continue 语句
LocalVariable
变量声明语句
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 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