hcl_edit ::expr Struct ForExpr Copy item path Source pub struct ForExpr {
pub intro: ForIntro ,
pub key_expr: Option <Expression >,
pub value_expr: Expression ,
pub grouping: bool ,
pub cond: Option <ForCond >,
}
Expand description A for expression is a construct for constructing a collection by projecting the items from
another collection.
The for
expression introduction, containing an optional key var, value var and the
collection expression that is iterated.
An expression that is evaluated once for each key in the source collection. If set, the
result of the for
expression will be an object. Otherwise, the result will be an array.
An expression that is evaluated once for each value in the source collection.
Indicates whether grouping mode is enabled. In grouping mode, each value in the resulting
object is a list of all of the values that were produced against each distinct key. This is
ignored if key_expr
is None
.
An optional filter expression. Elements for which the condition evaluates to true
will
be evaluated as normal, while if false
the element will be skipped.
Creates a new ForExpr
from a for
expression introduction and a result value
expression.
Performs copy-assignment from
source
.
Read more Formats the value using the given formatter.
Read more Returns a reference to the object’s
Decor
.
Returns a mutable reference to the object’s
Decor
.
Decorate the object with decor
in-place.
Decorate the object with decor
and return the modified value.
Converts to this type from the input type.
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Obtains the span information. This only returns
Some
if the value was emitted by the
parser.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dst
.
Read more Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more 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.