pub enum Measure {
Counting,
Summing,
Declared(Path),
}Expand description
WHAT FOLDS a group’s rows into one measure column.
§The axis is CLOSED on the framework’s side and OPEN past it
A bare word is one of the framework’s own shipped folds, and that vocabulary is closed because a word is a promise this crate can write the whole binding — which it can only keep for a fold it SHIPS. A QUOTED PATH is every other fold there is: a type the declaring crate wrote, named the way this grammar names every type it did not mint, with no vocabulary to be admitted to.
That is the round’s own law read at one more position — MINT BARE, REFER QUOTED — and it is why the two forms are one enum rather than two words: an author choosing between a shipped fold and their own is choosing a value for one entry, not writing a different entry.
The axis is about the fold’s ORIGIN and about nothing else, so it is orthogonal to the entry’s
two spellings: both halves are written the same way at fold = … inside the full form, and the
sugar <field> = <fold> takes both too — where the fold owes the entry no
column, which is the one thing the short spelling has no seat to say.
§The SHIPPED SPELLINGS are the design’s, and the house register disagrees with them
Every other closed VALUE vocabulary in this grammar is a bare short NOUN — semantics(fold(sum))
and fold(max), dedup(hash) and dedup(eq), the five tracing levels, the four execution
worlds — and counting/summing are the first gerunds in it. The design law one grammar over
(a key names the KIND of the value it takes; same kind, different reach, one word) would make
this position’s word for a total sum, which is the word semantics(fold(…)) already spells a
fold with.
The names stand as the closed design wrote them: the design reserved the BLOCK word for the
grammar task’s census and named these two itself, and the fold seam that mints the citizens is
its own task. The measurement is recorded here rather than acted on, and it is one line to act
on — SHIPPED and shipped are the whole of it.
Variants§
Counting
counting — how many rows the group holds.
Summing
summing — the total of the upstream column this measure folds.
WHICH column is Measured::from, and the entry names it or is refused: the fold reads one
and the framework knows it does, so a summing with nowhere to read from is an entry with a
word left out. See owed for the axis that decides it.
Declared(Path)
A fold the declaring crate wrote, as measure(<field> = "path::to::Fold") or the full form’s
fold = "path::to::Fold" named it.
Nothing here resolves it, which is the mechanism rather than a limitation: two macro expansions cannot see each other, so the path is EMITTED and rustc resolves it at the span of the string the author wrote.
Implementations§
Source§impl Measure
impl Measure
Sourcepub const SHIPPED: [&'static str; 2]
pub const SHIPPED: [&'static str; 2]
The framework’s shipped folds, in the order a refusal lists them.
The near-miss list for a bare word inside MEASURE is read off this, so the words a
suggestion offers and the words the sentence names cannot drift apart.
Sourcepub const fn owed(&self) -> Owed
pub const fn owed(&self) -> Owed
What this fold OWES its entry, which is what the from seat is checked against.
One arm per citizen and no default arm, so a third shipped fold cannot be added without its author deciding what it reads — which is the whole of what the entry’s grammar needs to know about it.
Sourcepub fn shipped(word: &str) -> Option<Self>
pub fn shipped(word: &str) -> Option<Self>
The shipped fold a bare word names, or None where the word is none of them.
Sourcepub fn as_written(&self) -> String
pub fn as_written(&self) -> String
The word this fold was written as — a shipped one’s own spelling, or the declared path’s.