Struct bracket::helper::each::Each[][src]

pub struct Each;
Expand description

Iterate an array or object.

Accepts a single argument of the target to iterate, if the target is not an array or object this will return an error.

Each iteration sets a new scope with the local variables:

  • @first: If this is the first iteration true.
  • @last: If this is the last iteration true.

Note that these variables are set even for objects where iteration order is not guaranteed which can be useful.

For objects the @key variable contains the name of the field; for arrays the @index variable contains the current zero-based index.

Trait Implementations

Function that is called when this helper is resolved by the renderer for a statement or block. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.