#[non_exhaustive]pub struct ForeachStmt {
pub expr: Expr,
pub key: Option<Expr>,
pub value: Expr,
pub by_ref: bool,
pub body: Box<Stmt>,
pub uses_alternative: bool,
}Expand description
A foreach loop.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.expr: ExprThe iterated expression.
key: Option<Expr>The key target, if any.
value: ExprThe value target.
by_ref: booltrue when the value is taken by reference: foreach ($a as &$v).
body: Box<Stmt>The loop body.
uses_alternative: boolWhether the foreach: ... endforeach; syntax is used.
Implementations§
Trait Implementations§
Source§impl Clone for ForeachStmt
impl Clone for ForeachStmt
Source§impl Debug for ForeachStmt
impl Debug for ForeachStmt
Auto Trait Implementations§
impl Freeze for ForeachStmt
impl RefUnwindSafe for ForeachStmt
impl Send for ForeachStmt
impl Sync for ForeachStmt
impl Unpin for ForeachStmt
impl UnsafeUnpin for ForeachStmt
impl UnwindSafe for ForeachStmt
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