pub enum EngineKind {
Tantivy,
Fs,
}Expand description
An engine ingraph itself ships — the words that SELF-BIND under a feature of the framework’s
own.
§Why a table at all, when the vocabulary is open
Three facts are true of a shipped word and of no other, and each of them is a refusal or an emission that has to know:
- it names a CONCRETE type this crate can spell, so the impls naming one ride
gate— the record side’s law, applied to the engine axis; - it is a KIND, and kind is said ONCE — at the resource. So the word at an ELECTION is a named
refusal whichever kind it serves, and
servesis what lets that sentence say what the word actually holds. (It was a kind-GUARDED refusal while the word self-bound at the election; the resource axis dropped the guard and kept the reading.) - it is ALREADY BOUND, so
engines(tantivy = "…")at a graph root is a refusal — rebinding a shipped word would give one word two meanings in one program.
A word outside this table is none of those things and is refused for none of them.
§It has TWO members, and that is a measurement rather than a stub
ingraph ships exactly two engine implementations: TantivyFulltext under feature = "tantivy",
and the local-filesystem blob store under NO feature at all. There is no VectorEngine
implementation in this workspace — lance appears in this repository only in prose and in the
unbuilt legacy/ reference — so the vector side of the grammar is served entirely by the open
half, which is the strongest argument the open half has.
Variants§
Implementations§
Source§impl EngineKind
impl EngineKind
Sourcepub const fn serves(self) -> NodeKind
pub const fn serves(self) -> NodeKind
WHICH KIND of declaration this engine serves.
A full-text engine holds documents and a vector engine holds coordinates, and the two seams are
different traits. It is read in two places and means the same thing in both: the BLOB walk
refuses a word of another family outright, and the ELECTION’s retirement sentence — which
refuses every shipped word, its own kind included — spends it to say what the word holds and
therefore which #[ingraph::resource(…)] declaration to write instead.
Sourcepub fn gate(self) -> Option<Ident>
pub fn gate(self) -> Option<Ident>
The CONDITIONAL-EXPANSION gate this engine’s concrete impls ride — if_tantivy, reached on
ingraph’s __private::gate shelf.
Mechanical from as_str, exactly as
DatabaseKind::gate is: the word the declaration writes, the word the
framework’s feature carries and the word the gate is named after are ONE word, so the three
cannot drift into naming different engines.
This is the MEASURED mechanism of ruling 2, mirrored rather than reinvented. What it buys is
what it buys on the record side: a declaration naming two engines in a build carrying one is
bound to the one, and the other has no impl at all — E0277 for a party that asks and silence
for one that does not.
§None for an engine under no feature
fs is at the root under nothing — a backend that needs no feature having no gate to carry,
which is ingraph’s own sentence about it — so there is no if_fs and a caller that wrapped
its impls in one would name a macro that does not exist. An engine with no feature is always
compiled in, which is the same answer the gate would have given, reached without inventing one.