pub enum Statement {
Expression(Expression),
Return(Option<Expression>),
Block(Vec<Statement>),
If {
condition: Expression,
then_branch: Box<Statement>,
else_branch: Option<Box<Statement>>,
},
While {
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>,
},
LocalVariable {
type: String,
name: String,
initializer: Option<Expression>,
},
Break,
Continue,
}Expand description
语句
Variants§
Expression(Expression)
表达式语句
Return(Option<Expression>)
返回语句
Block(Vec<Statement>)
块语句
If
条件判断
While
While 循环
For
For 循环
Foreach
Foreach 循环
LocalVariable
变量声明语句
Break
Break
Continue
Continue
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