pub struct ForExpr {
pub intro: ForIntro,
pub key_expr: Option<Expression>,
pub value_expr: Expression,
pub grouping: bool,
pub cond: Option<ForCond>,
/* private fields */
}Expand description
A for expression is a construct for constructing a collection by projecting the items from another collection.
Fields§
§intro: ForIntroThe for expression introduction, containing an optional key var, value var and the
collection expression that is iterated.
key_expr: Option<Expression>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.
value_expr: ExpressionAn expression that is evaluated once for each value in the source collection.
grouping: boolIndicates 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.
cond: Option<ForCond>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.
Implementations§
Trait Implementations§
source§impl From<ForExpr> for Expression
impl From<ForExpr> for Expression
impl Eq for ForExpr
Auto Trait Implementations§
impl Freeze for ForExpr
impl RefUnwindSafe for ForExpr
impl Send for ForExpr
impl Sync for ForExpr
impl Unpin for ForExpr
impl UnwindSafe for ForExpr
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)