Skip to content

struct

ForBlock

pub struct ForBlock {
    pub binding: String,
    pub iterable: Path,
    pub body: Vec<Node>,
    pub expr: Option<Expr>,
}

for binding in iterable { … }

Fields

binding

pub binding: String

The name each item is bound to.

iterable

pub iterable: Path

The list, when it's a path; otherwise expr holds it and this is _.

body

pub body: Vec<Node>

Nodes repeated for each item.

expr

pub expr: Option<Expr>

A list that isn't a path: for p in posts |> take(3).

Trait implementations