pub struct Measured {
pub field: Ident,
pub by: Measure,
pub from: Option<Ident>,
pub ty: Type,
pub projection: Projection,
}Expand description
One MEASURE column: a field of this declaration, what folds a group’s rows into it, and the upstream column that fold is handed.
Fields§
§field: IdentThe field of this declaration being filled.
by: MeasureWhat folds the group into this column.
from: Option<Ident>The upstream column whose values the fold is handed, where the entry named one — carrying the span of the string that named it, so every claim the emission makes about the upstream lands where the author wrote it.
§None is a FOLD OVER THE ROWS, and it is a shape rather than a gap
A measure’s from says WHICH values become the slice a fold is handed. Where it is written,
that slice is the named column’s values; where it is not, the fold is handed the group’s ROWS
— which is exactly what counting wants, answering how many there are about items of every
type there is.
So the two states are two legal declarations and not a filled-or-missing seat, and which of
them a fold may take is Measure::owed’s answer: the grammar refuses counting a column and
refuses summing none, and leaves a fold the declaring crate wrote to say for itself. It is
never DEFAULTED to field — a measure’s own name is this declaration’s and
the column is the upstream’s, so a grammar that assumed the two agree would fold the wrong
column wherever they did not, silently. Grouped::from is written out for the same reason
even where the two spellings match.
ty: TypeThe field’s declared type.
projection: ProjectionHow an accessor hands this column back — Grouped::projection’s word at the other role.