pub enum Stmt {
Assign(u32, Expr),
If(Expr, Vec<Stmt>, Vec<Stmt>),
Loop {
cond: Option<Expr>,
body: Vec<Stmt>,
step: Vec<Stmt>,
test_first: bool,
},
Break,
Continue,
Return,
}Expand description
One statement of a function body.
Variants§
Assign(u32, Expr)
slot = expr; the expression already has the slot’s type.
If(Expr, Vec<Stmt>, Vec<Stmt>)
if (cond) then else otherwise (a case statement is built as a chain).
Loop
A loop. With test_first the condition is tested before every
iteration (while, for); without it, after every iteration but not
before the first (do ... while). step runs after each iteration,
also one ended by continue (a for’s step expressions). No cond is
an endless loop (forever, for (;;)).
Fields
Break
break.
Continue
continue.
Return
return: the result variable already holds the value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stmt
impl<'de> Deserialize<'de> for Stmt
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 Eq for Stmt
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnsafeUnpin for Stmt
impl UnwindSafe for Stmt
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.