Skip to main content

Measure

Enum Measure 

Source
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

Source

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.

Source

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.

Source

pub fn shipped(word: &str) -> Option<Self>

The shipped fold a bare word names, or None where the word is none of them.

Source

pub fn as_written(&self) -> String

The word this fold was written as — a shipped one’s own spelling, or the declared path’s.

Trait Implementations§

Source§

impl Clone for Measure

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Measure

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.