pub enum RepeatCount<'d> {
Expr(Expression<'d>),
Const(u64),
Size(Expression<'d>),
NestedSize {
arr: Expression<'d>,
path: Vec<NestStep<'d>>,
},
Inherited(Expression<'d>),
}Expand description
A counted loop’s iteration count: a repeat (N) loop’s count
expression, a foreach loop’s static element count, or the number of
elements a queue or dynamic array has when its foreach starts.
Variants§
Expr(Expression<'d>)
Const(u64)
Size(Expression<'d>)
The size of this queue / dynamic array expression.
NestedSize
The size of the queue / dynamic array reached from arr by the
enclosing foreach indices path (a[i][j] of foreach (a[i, j, k]) over int a[2][3][]), read when the loop is entered.
Inherited(Expression<'d>)
A count the forking process already evaluated: the counter slot is
copied in at the spawn (InheritedSlot::Counter), never
initialized here. 0 is the count expression, which sizes the slot.
Implementations§
Source§impl<'d> RepeatCount<'d>
impl<'d> RepeatCount<'d>
Sourcepub fn expr(&self) -> Option<Expression<'d>>
pub fn expr(&self) -> Option<Expression<'d>>
The expression the count is computed from, if the count is not a
constant (for Size, the collection).
Trait Implementations§
Source§impl<'d> Clone for RepeatCount<'d>
impl<'d> Clone for RepeatCount<'d>
Auto Trait Implementations§
impl<'d> !RefUnwindSafe for RepeatCount<'d>
impl<'d> !UnwindSafe for RepeatCount<'d>
impl<'d> Freeze for RepeatCount<'d>
impl<'d> Send for RepeatCount<'d>
impl<'d> Sync for RepeatCount<'d>
impl<'d> Unpin for RepeatCount<'d>
impl<'d> UnsafeUnpin for RepeatCount<'d>
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