Skip to main content

Module engine

Module engine 

Source
Expand description

WHERE an elected field is written — the engine blocks, and the (field × engine) slots they are. WHERE an elected field is written: the engine blocks a declaration wears, and the SLOT each one names.

#[ingraph(knn, lance, hnsw(ef = 200), fanout)]
pub image: Embedding<f32, 768>,

One field, one election, and beside it the engines that hold it. The words are BARE and they carry their own options, because on an index field the ENGINE IS THE STORE — there is no second axis for a persist(…) wrapper to namespace against, which is the whole of why the record’s shape is not repeated here.

§The semantics are the RECORD’s, measured and mirrored rather than reinvented

Several blocks are declared PORTABILITY, and the default is SINGLE-WRITE. That is not a new rule: it is what persist(sqlite, postgres) already means, and the record side answers which one is live in two layers that this module mirrors exactly —

layerthe record sidehere
COMPILE — declared ∩ compiled-in__private::gate::if_<db>! around every impl naming a concrete backendEngineKind::gate, around every impl naming a concrete engine
CALL — which store this call writesthe METHOD NAME (insert_postgres), the driver staying a type parameterthe SLOT (field × engine), the engine staying a type parameter

The record side’s own words for the second layer: an expansion may not spell sqlx::Sqlite, so the method NAME is where the database is chosen and the type parameter is where the driver is. Read back here, the SLOT is where the engine is chosen and the type parameter is where the engine handle is — which is the shape a derived index’s emitted retrieve already had before this round, carrying __INGRAPH_ENGINE__ as a method parameter.

So declare many, build one, and write through whichever door the deployment opened is inherited whole. fanout is the ONE departure, and it is a marker precisely because it departs.

§The vocabulary is OPEN, and EngineKind is not the vocabulary

DatabaseKind is CLOSED — a database the framework does not ship an emitter for has nothing to be opened — and the engine axis is the opposite case, which is why the two tables look alike and mean different things. A database needs an emitter here; an engine needs only an implementation of a trait ingraph already publishes, and third parties are expected to bring them. EngineKind is therefore the SHIPPED table — the words that self-bind under their own feature — and a word outside it is an ordinary declared word whose binding is the graph root’s engines(…).

Structs§

DeclaredLane
ONE LANE, as a lanes(…) block wrote it — the framework’s half of one entry.
Engine
ONE engine block as a field declared it — the word, and whatever it carried.
EngineBinding
ONE engines(<word> = "path::To::Engine") entry on a graph root — a WORD bound to a CONCRETE TYPE.
FieldEngines
ONE elected field’s engines, and whether all of them are live at once.
Slot
ONE SLOT: a field and the engine that holds it.

Enums§

EngineKind
An engine ingraph itself ships — the words that SELF-BIND under a feature of the framework’s own.
Road
THE FROM-ROAD one engine block declares: how the elected field’s value becomes THIS engine’s document text.