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
impl Label
Sourcepub const ALL: [Self; 10]
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.
Sourcepub const fn as_str(self) -> &'static str
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.
Sourcepub const fn collection(self) -> bool
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.