Module ructe::Template_syntax::b_Loops [] [src]

A ructe @for loop works works just as a rust for loop, iterating over anything that implements std::iter::IntoIterator, such as a Vec or a slice.

Loops

Rust-like loops are supported like this:

<ul>@for item in items {
  <li>@item</li>
}</ul>

Note that the thing to loop over (items, in the example) is a rust expression, while the contents of the block is template code.