Enum Stmt
pub(in elab) enum Stmt {
Let {
name: String,
name_span: SourceSpan,
ownership: OwnershipMode,
mode: AssignMode,
value: Expr,
},
Assign {
target: AssignTarget,
mode: AssignMode,
value: Expr,
},
If {
condition: Expr,
then_block: Block,
else_block: Option<Block>,
},
For {
binding: Binding,
iterable: Expr,
body: Block,
},
While {
condition: Expr,
body: Block,
},
Match {
value: Expr,
arms: Vec<MatchArm>,
},
Meta {
body: MetaBlock,
},
Expr {
expr: Expr,
has_semi: bool,
},
}Expand description
Runtime statement.
Variants§
Let
Binding declaration statement.
Fields
§
name_span: SourceSpanSource span covering the binding name token.
§
ownership: OwnershipModeOwnership mode assigned to the local binding.
§
mode: AssignModeAssignment mode used to initialize the binding.
Assign
Assignment to an existing binding or field path.
Fields
§
target: AssignTargetAssignment target path.
§
mode: AssignModeAssignment mode used to initialize the binding.
If
Conditional statement.
Fields
For
Collection iteration statement.
Fields
While
Loop that repeats while the condition is true.
Fields
Match
Enum match statement.
Fields
Meta
Embedded meta block statement.
Expr
Standalone expression statement.
Trait Implementations§
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more