Skip to main content

Measured

Struct Measured 

Source
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: Ident

The field of this declaration being filled.

§by: Measure

What 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: Type

The field’s declared type.

§projection: Projection

How an accessor hands this column back — Grouped::projection’s word at the other role.

Trait Implementations§

Source§

impl Clone for Measured

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 Measured

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.