pub enum NodeKind {
Operator,
Entity,
Record,
Aggregate,
Fulltext,
Vector,
Blob,
}Expand description
WHICH NODE a declaration is — one word per derive, carried past validation because the emission reads it too.
One node holds ONE storage and the MACRO IS the storage declaration, so the word answers both halves of that law at once: which storage family this declaration was allowed to name, and whether the emission mints the marker that makes a second one unspellable.
NodeKind::Operator is the base and every other kind is it plus a store, which is the order
they are written in.
The last three are the DERIVED INDEXES, and what separates them from the RECORD FAMILY is not
their storage but their KEY: each mints no id at all and carries its upstream’s key instead,
which is NodeKind::derives_its_key below. That is why they arrived with upstream(…) and
could not have arrived before it — a kind with no way to name an upstream would have had no key
to carry.
NodeKind::Entity and NodeKind::Record are the RECORD FAMILY’s two upper rungs, and they
differ in the storage essence alone: an entity bears an identity, an operator’s whole compute
surface and a WIRE FACE, and holds no rows. It is the tier the 22 declarations that wrote no
storage block were already using without a word for it — measured on the way in — so it is the
rowless path given its own macro rather than a new code path.
NodeKind::Aggregate is the record family’s THIRD member and it names an upstream like a
derived index does, which is why it sits between the two halves rather than in either. Its
storage answers are the record’s to the letter — rows, bare store words, a wire face, a key it
mints — because its storage IS a record: the macro mints the (group…, measure…) row shape and
hands it to the record pass, the journal pattern. What is its own is the GRAMMAR that fills
those rows, and a grammar is not a storage fact.
That grammar has since ARRIVED and its EMISSION has not, which is the state worth stating rather
than leaving a reader to infer: #[ingraph::aggregate(…)] mints NodeKind::Aggregate, reads
the whole declaration and refuses every rule it breaks by name — and then refuses an ACCEPTED one
too, with a sentence saying the expansion that mounts the node is the task after it. So the word
rows below are reached by an author’s declaration now, and the only thing no caller reaches is an
emission. They were answered before either half existed, and answered truthfully, because they
are what the grammar got built AGAINST — a kind that reached a front end and only then discovered
its own storage law would have been discovering it a task too late.
Variants§
Operator
A graph node: it subscribes, it carries a watermark, and it owns no storage at all.
Entity
An operator that PUBLISHES — an identity-bearing node with a wire face and no rows.
Record
An entity holding the META STORE — rows, in the databases its store words name.
Aggregate
A record whose rows are a declared FOLD over ONE upstream: one row per group, recomputed WHOLE on every trigger.
It consumes the upstream’s TABLE rather than its messages, which is the whole safety argument — duplicate delivery is normal operation here and an incremental count could not inherit the keyed-replace theorem, so a trigger reads, groups, folds and upserts. Deletion falls out of that for free.
Fulltext
An operator holding a FULL-TEXT INDEX over an upstream’s messages.
Vector
An operator holding an EMBEDDING INDEX over an upstream’s messages.
Blob
An operator holding a FAMILY OF ARTIFACTS derived from an upstream’s messages.
Implementations§
Source§impl NodeKind
impl NodeKind
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The MACRO that declares it — the word a refusal names when it sends an author to another declaration, and the last segment of the attribute they write.
The bare word rather than the whole attribute, because a refusal spells the two differently:
one names the macro (declare them with the vector macro) and one quotes what the author
typed (#[ingraph::operator] supports structs only).
Sourcepub const fn noun(self) -> &'static str
pub const fn noun(self) -> &'static str
What a refusal CALLS one of these — record, operator, full-text index.
A front end’s sentences are the same sentences whichever node broke the rule, so the noun is the only part that varies and it lives with the vocabulary rather than being branched on in each message.
Sourcepub const fn plural(self) -> &'static str
pub const fn plural(self) -> &'static str
NodeKind::noun in the plural, for the sentences that speak about the KIND rather than
about one declaration of it.
Sourcepub const fn article(self) -> &'static str
pub const fn article(self) -> &'static str
The indefinite article NodeKind::noun takes.
Here rather than at each message, and it is not pedantry: a sentence assembled with the wrong one — a operator — is a refusal the reader trips over on their way to the rule, and the two facts are one fact about the word.
Sourcepub const fn storage_block(self) -> Option<&'static str>
pub const fn storage_block(self) -> Option<&'static str>
The record-level BLOCK this node’s own storage is declared in, or None for the kinds whose
storage is not a block at all.
The WORD rather than a boolean, because the useful refusal is the inverse: every storage block but this one is refused on this node, and a refusal that sends an author to the right declaration has to map the word back to the derive that takes it.
For the three derived indexes the word is the MACRO’s own, which is the storage law read back:
fulltext(…) on anything else names an index that is a fulltext node, and on a fulltext
node it names that node’s engines.
A RECORD ANSWERS None, and that is the unwrap read back. Rows used to live inside
persist(…); they are named BARE at the head now — #[ingraph::record(sqlite, postgres)] —
because storage is the record’s ESSENCE and an essence does not wrap. So a record has no
storage block for anything to be refused against, and every block in this vocabulary is refused
on it. NodeKind::holds_rows is what asks the question this used to answer for a record.
Sourcepub const fn holds_rows(self) -> bool
pub const fn holds_rows(self) -> bool
Whether this node holds ROWS — the record family’s top rung, and the only kind whose store words sit bare at the head.
Stated rather than derived from NodeKind::storage_block, which no longer answers it: the
unwrap took the record’s storage out of a block, so has a block called persist and holds
rows stopped being one question. Every refusal that used to compare the block name to
"persist" asks this instead.
Written as an exhaustive MATCH rather than a matches! for NodeKind::stores’ reason, and
the fourth kind is what made the difference visible: an aggregate holds rows, so silence here
would have refused its own store words at the head — the very words its grammar takes.
Sourcepub const fn election(self) -> Option<&'static str>
pub const fn election(self) -> Option<&'static str>
The FIELD MARKER this kind elects its subject with, or None for a kind that elects nothing.
knn on a vector and searchable on a fulltext, one law under two words: presence elects
the field, absence leaves it stored-not-indexed payload, and a declaration that marks none is
refused by name. A blob answers an ADDRESS rather than a ranking, so it has no subject to
elect and takes neither word; the record family declares no fields of this tier at all.
The WORD rather than a boolean, for NodeKind::storage_block’s reason: the refusals that
spend this have to NAME the marker — the one a declaration should have written, and the one it
wrote on a kind that does not take it.
§An AGGREGATE marks its fields and still answers None, which is a tier and not an oversight
An aggregate’s fields carry roles — one names a group column, one names a measure — so the reflex is to spell one of those words here. It would be the wrong tier. What this word names is the INDEX SUBJECT: the only reader is the derived-index grammar, and what it does with the answer is decide which field grows a corpus, an engine leg and a resource binding. An aggregate has none of those — its roles say which column is KEY and which is VALUE, which is the row shape, and the row shape is the record family’s tier. Answering a word here would enrol the kind in the engine machinery on the strength of a spelling.
The roles land in the grammar task, and their WORDS are that task’s to settle against the house register — the design leaves open which word the measure block takes and whether the block and the field marker share one. Nothing here is spent on them, so nothing here can pre-empt it.
Sourcepub const fn derives_its_key(self) -> bool
pub const fn derives_its_key(self) -> bool
Whether this node’s key is the UPSTREAM’s rather than its own — the derived-index half of the family.
The definitional split, and the one that decides which model a declaration becomes: a node that
mints an id emits a *Key type of its own and reaches
RecordModel, and one that carries an upstream’s key emits neither and reaches
IndexModel. The key is not its to mint is the ruling, and this
is the word for it.
Stated over the kinds rather than derived from NodeKind::storage_block, because the two are
independent facts that happen to agree today: a record stores and mints, an operator does
neither, and a kind that stored without minting or minted without storing would be a coherent
thing to add.
An AGGREGATE names an upstream and still answers false, which is the whole reason this
word is stated over kinds rather than read off the grammar. Naming an upstream is what the
derived indexes arrived with, so the shape looks like theirs; the KEY is not theirs. A derived
index carries the upstream’s key because every one of its entries is an entry ABOUT one
upstream row. An aggregate’s row is about a GROUP, and the group is a projection its own
declaration names — so the key it emits is its own, minted from the group columns, and it
reaches RecordModel like the rest of the record family. The key is not its to mint is not
true of it.
Sourcepub const fn dressable(self) -> bool
pub const fn dressable(self) -> bool
Whether this kind may wear graphql(…) — the DRESSING axis, which crosses the storage one
rather than following it.
A record and an entity both publish; an operator does not. That is the whole of what separates
the two rowless kinds, and it is a real separation rather than a spare word: a dressed rowless
node publishes its ADDRESS, which is what a search declaration over it projects through
(<<<Upstream as Transformer>::Graphql as Graphql>::Output as GraphqlOutput>::Key), and an
undressed one binds Graphql = () for which that projection does not resolve. The KEYS tier of
every election over an entity stands on this word.
The three derived indexes answer false here and take graphql(…) anyway: their block is
their own grammar’s, read by crate::index, and this predicate is record_options’ alone.
An AGGREGATE answers true and reaches the wire through the record publication path — the
storage sugar read forward, since a kind whose rows are a record’s rows publishes them the way
a record does. Written as an exhaustive MATCH rather than a matches! for
NodeKind::stores’ reason: this word gates whether graphql(…) is accepted at the head at
all, so a kind that took the answer by silence would have had its declared wire face refused.
Sourcepub const fn mints_a_message(self) -> bool
pub const fn mints_a_message(self) -> bool
Whether this kind’s declared type is itself a MESSAGE — a value a producer GIVES on an edge, and therefore a thing an acked give can be answered FOR.
The receipt = "…" word’s gate, and the whole of the re-key that put the word here: a receipt
is a property of what is GIVEN rather than of who receives it. One message asks one question
and every seat on the far end answers that same one, so the type belongs to the declaration
that MINTS the message — an entity is this framework’s own word for that (the message
node), a record is an entity with rows, and an aggregate is a record whose rows are a
fold. All three declare a type that travels.
The other four answer false, for two different reasons worth keeping apart. An OPERATOR is
the node family’s BASE: it computes, it publishes no address, and what goes on its out-edge is
its Operator::Out rather than itself — there is no operator value on any wire to be given.
The three DERIVED INDEXES are indexes OF somebody else’s messages and carry that upstream’s
key, which NodeKind::derives_its_key is the word for — so a receipt declared on one would
be an answer to a question another declaration asked.
Stated over the kinds as an exhaustive MATCH rather than derived from NodeKind::dressable,
which happens to agree today: publishes a wire address and is a message are two facts, and
a kind that flowed without dressing would be a coherent thing to add.
Sourcepub const fn stores(self) -> bool
pub const fn stores(self) -> bool
Whether this node holds a storage, and therefore whether its emission mints the one-storage
marker — see one_storage_marker.
It was DERIVED from NodeKind::storage_block while the two agreed, and the unwrap ended
that: a record’s storage is no longer a block, so deriving this would have silently stopped
marking the kind whose marker matters most. Stated over the kinds, exhaustively, so a kind
added later cannot take an answer by silence.
It is also the LANDING fact the convergence reads — Effect::Lands and the write lane beside
it, in emit::declared — and the ladder made that honest rather than only
preserving it. A record with no storage block used to answer true here, because the answer
was a fact about the KIND and every record’s kind said it stored; so a declaration that named
nowhere still claimed a write lane it did not have, and the validate walk never called it the
pure leaf it was. A record now HAS a store by construction and an entity is the rowless rung,
so the two readings of this word have stopped being able to disagree.