Skip to main content

Label

Enum Label 

Source
pub enum Label {
    Scalar,
    String,
    Bytes,
    Enum,
    Flags,
    Bool,
    Duration,
    List,
    Set,
    Quantified,
}
Expand description

An interpretation the FRAMEWORK names — the words a declaration may write bare.

The vocabulary law in one type: what a declaration WRITES is a label, what it RESOLVES to is a marker. So the words are here and the type-level artifacts they reach — ScalarMarker, the *FilterMarker family traits, DefaultMarker — keep the other name, because nobody writes them.

A CLOSED vocabulary, for the reason DatabaseKind’s is closed: these are the markers this framework ships a word for, and one it does not is reached by Marker::Path rather than by a word this list would have to grow. Nothing about the surface is closed by closing this.

§A word earns its place by DISAGREEING with the inference

The list carried the two COLLECTION words alone, and the argument for stopping there was that a value reading is at most one per type: if a String could only ever be text, string on one would be a second spelling of the default and no declaration could need it.

The marker layer is where that premise broke. A value reading is one trait per FAMILY — ScalarFilterMarker, StringFilterMarker, BytesFilterMarker and their siblings — so a type may answer several and mean all of them. Vec<u8> is a byte string and a list of small integers; a downstream identifier can answer the string family and the enumeration one both. The INFERENCE picks one, because a DefaultMarker row names one; a word is how a column picks another, which is a declaration no other short form reaches.

So the rule stands and its answer changed: six value families and three collection positions.

The third collection word is the one that earns its place against a COLLECTION default rather than against a value one. A Vec<Tag> infers list, and quantified is how a column says its element has no literal form worth publishing — a different question from is this ordered, and one no other short form reaches.

§What still has no word

value has none, and that absence IS the rule still holding — it would name whatever the type’s own row says, which is what omitting the option already means.

nullable has none for the same reason one level out: an Option<T> column infers whatever T’s own reading says an Option of it is — the null test for a value family, the collection itself for a collection one — from one blanket that reaches every T, so the word could only ever restate the default. A column that wants the INNER reading changed says so with the inner word, and the outer reading follows it.

That blanket is where a COLLECTION-classified column would land too, if the word did not route around it first — see Label::collection. The two agree on the answer and differ in what they can SEE: a word is tokens, and the blanket is types.

map has none because the framework ships no map filter for one to name.

Variants§

§

Scalar

A NUMBER: one totally ordered value, which is what makes gt and its neighbours mean something.

§

String

TEXT: one string of characters, which is what makes the substring and affix questions mean something.

§

Bytes

A BYTE STRING: one opaque run of bytes, searched as bytes and never as characters.

§

Enum

An ENUMERATION: a closed vocabulary, so membership is the whole question.

§

Flags

A FLAGS SET: a closed vocabulary of BITS, so a value is a SUBSET and the questions are set-theoretic.

The enumeration’s sister and never a case of it: the two share equality and nothing else, and the mask words a flags column answers are questions an enum has no way to ask.

§

Bool

A BOOLEAN: two values, so an ordering operator would name every row or none.

§

Duration

A DURATION: an elapsed span, which carries a lexical form no number has.

§

List

An ORDERED collection: order and duplicates carry meaning.

§

Set

An UNORDERED collection: neither does.

§

Quantified

A collection asked ONLY through quantifiers — some element satisfies this, and this many.

The third collection word, and it disagrees with the other two about the ELEMENT rather than about the column’s order: the wide readings hold the element in seven of their filter’s slots and so put its literal form on the wire, where this one holds it in none. A collection of pairs carrying a float is what it was cut for — see ingraph’s QuantifiedFilter, where each departing operator is named with the reason it could not be answered honestly.

Implementations§

Source§

impl Label

Source

pub const ALL: [Self; 10]

Every interpretation with a word, in the order a refusal lists them: the six VALUE families first and the two collection positions last, which is the order ingraph’s marker module declares the markers themselves in.

Source

pub const fn as_str(self) -> &'static str

The word a declaration writes.

enum is a Rust KEYWORD and is the word anyway: this vocabulary names READINGS, and what rustc reserves for its own grammar has nothing to say about them. The cost is a line in the grammar that reads it — ingraph-derive’s marker takes the token as any identifier — and nothing here.

Source

pub const fn item(self) -> &'static str

The framework type the word is short for.

Source

pub const fn collection(self) -> bool

Whether the word names a COLLECTION POSITION rather than a VALUE family — the split this vocabulary’s own note already counts, asked rather than re-derived from the list.

§A collection has no null state

It is the one place the two halves are not interchangeable. An edge table has ONE observable for a column that holds nothing — no rows — where the Rust type spells two, None beside Some(<empty>); a distinction no storage can keep must not be declarable as though it could. So a field the declaration classified here resolves as if it had been declared BARE: empty and absent are one state, in both directions, and is it empty is count: { eq: 0 }, which every backend answers alike. polarsync settles the same question the same way — its schema translates an Option<Vec<T>> field to Vec<T>.

crate::emit’s filter_of is where the routing happens, and this is what it asks.

An exhaustive match rather than a matches!, because the answer is part of what adding a word to this vocabulary MEANS: a word that compiled without deciding would take the value answer by silence. flags was the ninth and answered here; quantified is the tenth and answers here too — a collection whose filter publishes two operators is still a collection, and what makes the Option transparent is the storage rather than the vocabulary.

Trait Implementations§

Source§

impl Clone for Label

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 Copy for Label

Source§

impl Debug for Label

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Label

Source§

impl Hash for Label

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Label

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Label

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Label

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Label

Auto Trait Implementations§

§

impl Freeze for Label

§

impl RefUnwindSafe for Label

§

impl Send for Label

§

impl Sync for Label

§

impl Unpin for Label

§

impl UnsafeUnpin for Label

§

impl UnwindSafe for Label

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.