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
Statement.
Represents various C# statements that can appear within a method body or block.
Variants§
Expression(Expression)
Expression statement.
Return(Option<Expression>)
Return statement.
Block(Vec<Statement>)
Block statement.
If
If statement.
Fields
§
condition: ExpressionThe condition expression.
While
While loop.
For
For loop.
Fields
§
condition: Option<Expression>The condition expression.
§
update: Option<Expression>The update expression.
Foreach
Foreach loop.
Fields
§
iterable: ExpressionThe iterable expression.
LocalVariable
Local variable declaration.
Fields
§
initializer: Option<Expression>The optional initializer expression.
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 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