pub enum Statement {
VarDecl {
name: String,
ty: Type,
init: Option<Expression>,
storage: StorageClass,
},
Expr(Expression),
Block(Block),
If {
condition: Expression,
then_branch: Box<Statement>,
else_branch: Option<Box<Statement>>,
},
For {
init: Option<Box<Statement>>,
condition: Option<Expression>,
update: Option<Expression>,
body: Box<Statement>,
},
While {
condition: Expression,
body: Box<Statement>,
},
Return(Option<Expression>),
Break,
Continue,
SyncThreads,
}
Expand description
Statement types
Variants§
VarDecl
Variable declaration
Expr(Expression)
Expression statement
Block(Block)
Block statement
If
If statement
For
For loop
While
While loop
Return(Option<Expression>)
Return statement
Break
Break statement
Continue
Continue statement
SyncThreads
Synchronization
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
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