#[non_exhaustive]pub struct LoopShell {
pub kind: LoopKind,
pub has_condition: bool,
pub has_continue: bool,
pub declares_iterator: bool,
pub label: Option<String>,
}Expand description
Loop shell payload.
Models the static shape of a while/until, C-style for, or foreach
loop: its surface form, whether a static condition is present, whether a
continue block follows, whether the loop declares its own iterator, and
any controlling label inherited from an enclosing labeled statement.
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.kind: LoopKindLoop surface form.
has_condition: boolWhether the loop has a statically present condition expression.
while/until always have one; C-style for may omit it (for (;;));
foreach iterates a list rather than testing a condition, so this is
false.
has_continue: boolWhether a trailing continue { ... } block is present.
declares_iterator: boolWhether the loop binds its own iterator variable (foreach my $x).
label: Option<String>Controlling label from an enclosing LABEL: statement, if any.
Trait Implementations§
impl Eq for LoopShell
impl StructuralPartialEq for LoopShell
Auto Trait Implementations§
impl Freeze for LoopShell
impl RefUnwindSafe for LoopShell
impl Send for LoopShell
impl Sync for LoopShell
impl Unpin for LoopShell
impl UnsafeUnpin for LoopShell
impl UnwindSafe for LoopShell
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