pub struct Engine {
pub word: Ident,
pub road: Road,
pub stored: bool,
pub resource: Option<Path>,
pub options: TokenStream,
pub rrf: bool,
pub lanes: Vec<DeclaredLane>,
}Expand description
ONE engine block as a field declared it — the word, and whatever it carried.
Fields§
§word: IdentThe word, carrying its own span — where every refusal about this block lands.
road: RoadThe FROM-ROAD this block declares — Road::Identity where it declared none.
stored: boolstored — this engine KEEPS the original value, retrievable.
false unless the word was written, and the cheap default is the ruled one: only the computed
result is guaranteed SEARCHABLE, and retrieval is opt-in. What it reaches in the shipped engine
is tantivy’s STORED flag on the body field.
resource: Option<Path>resource = "path::To::Resource" — the RESOURCE this leg is written to, as the declaration
POINTED at it.
§It POINTS; it does not TYPE. type = retired to get here
The word this replaces named an ENGINE directly, which put the kind of a store in two places:
on the declaration that wrote the type, and on whatever the deployment actually opened. Kind
is said once, at the resource — #[ingraph::resource(tantivy)] pub struct Ft; — and every
other position POINTS at that declaration. So what a leg holds is the path of a resource, and
the engine underneath it is the resource’s own business.
§What POINTING buys that TYPING did not
A slot’s package still publishes knobs in the store’s own currencies — a floor is a
<Ft as FulltextEngine>::Score and a search input is that store’s own — and the projection is
unchanged in shape: it simply runs off the RESOURCE type rather than off an engine type.
Two facts come free with the move:
- the KIND CHECK is the projection itself.
<Ft as FulltextEngine>::ScoreisE0277at the path the author wrote whenFtis a vector resource, so named → kind-verified needs no marker trait and no check anyone can forget to run; - two resources of ONE KIND are two TYPES and therefore two
TypeIds, which is what lets a deployment run two stores of the same engine and keeps a door citizen’sShared<R>lookup unambiguous. A word bound to a type could not say that.
§None is the ordinary state, and it is the SOLE-DEFAULT’s condition
An unpointed leg contributes no variant and a slot whose legs are all unpointed grows no
engine seat at all — the presence law, unchanged. What is new is that saying nothing is no
longer only a fallback: a deployment declaring exactly ONE resource of this leg’s kind binds
it by that fact alone, and zero or several is a START-UP refusal listing the candidates. See
the binding laws on FieldEngines.
REFER-QUOTED, so the path resolves at the span its author wrote and a path naming nothing is
E0412 there rather than inside an expansion.
options: TokenStreamThe block’s contents, UNINTERPRETED, and empty where the word was written bare.
§Verbatim, and it could not be otherwise
hnsw(ef = 200) names a knob of an engine this crate has never heard of. Reading it would mean
carrying every engine’s option set here — the maintenance an open vocabulary exists to avoid —
and refusing what it could not read would close the vocabulary through the back door. So the
tokens are carried to the binding and interpreted by whoever owns the engine, which is the same
division the framework already draws around a backend’s own words.
A proc_macro2::TokenStream rather than parsed pairs, therefore, and the spans inside it are
the author’s own — so an engine that refuses one of its knobs refuses it where it was written.
§It is the block MINUS the framework’s own words, and that is not a hole in the argument
road and stored are written inside these parentheses and are
taken out of what is carried. The division is the same one the outer walk already draws: a
FRAMEWORK word has one meaning wherever it appears, and an engine’s knob has whatever meaning
its engine gives it. Reading ef = 200 would mean carrying every engine’s option set here;
reading stored means carrying one word whose meaning the framework defines, and whose whole
point is that it means the same thing to every engine that has a doc store.
The price is stated rather than hidden: an engine with a knob of its own called stored,
join, multi, from, try_from, resource or lanes cannot spell it here, because the
framework claimed the spelling first. That is the ordinary cost of a shared namespace, and it
is bounded by seven words.
rrf: boolrrf = <bool> — whether this leg enters the FUSED ROAD of the slot it holds.
§It is LEADERBOARD MEMBERSHIP and nothing else
A fanned slot writes every declared engine at once. What that fan is FOR is two different
things and the declaration could not say which: a leaderboard, where each engine’s ranking is
separate evidence and the fold joins them; or REDUNDANCY, where the same content lives in
several stores and a read comes from one of them. rrf = false is the second — the leg is
written and is not a route.
§TRUE by absence, per the de-Option law
A bool rather than an Option<bool>: there is no third state. The default is the shape a
fan already had before the word existed, so a declaration that says nothing keeps exactly the
slot it had — which is what makes the word purely additive.
§ORTHOGONAL to resource, and all four quadrants mean something
resource = is ADDRESSABILITY (and the Score projection a package publishes floors in);
rrf = is leaderboard membership. A pointed leg outside the leaderboard is directly readable
and does not rank; an unpointed leg inside it ranks and cannot be named by a request; a leg
that is neither is written for redundancy alone.
lanes: Vec<DeclaredLane>lanes(zh(accepts(cmn)), en, rest(catch_all)) — the PARTITIONS this leg’s corpus is cut into,
in declaration order, and EMPTY where the word was not written.
§Presence is the whole state, and absence is the corpus that always was
An empty list is a declaration that said nothing about lanes, and what it mints is nothing: the
slot takes Lanes’ own default, which is ONE lane keyed
und. So the word is purely additive — a leg that never wrote it emits, indexes and answers
exactly as it did before the word existed.
§The KEY and the ALIASES are read; the ANALYZER is not here
A lane’s EXISTENCE shapes the slot, so it is a compile-time fact and this grammar reads it. Its
INSTANCE is a value a deployment builds at boot, so a tokenizer = "…" written inside a lane
is the ENGINE’s knob and rides options with every other one — the same
partition the block around it already draws, one grain down. That division is the ruling’s own:
a lane’s existence is a declaration fact, its instance an assembly one.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn bare(word: Ident) -> Self
pub fn bare(word: Ident) -> Self
A block written BARE — tantivy with no parentheses at all.
The most common shape by far, and the one every default is defined against: the identity road,
nothing kept, NOTHING POINTED AT, no knobs carried, no lanes cut, and IN the fused road. A named
constructor rather than a Default, because the WORD is not defaultable and a partial default
would be the thing that quietly disagrees with the grammar when an eighth framework word
arrives.
Sourcepub fn shipped(&self) -> Option<EngineKind>
pub fn shipped(&self) -> Option<EngineKind>
The shipped engine this word names, or None for a word bound at the graph root.