pub struct CompletionRegistry {
pub default_matcher: Option<MatcherId>,
pub default_rankers: Vec<RankerId>,
pub default_annotators: Vec<AnnotatorId>,
pub cache: GeneratorCache,
/* private fields */
}Fields§
§default_matcher: Option<MatcherId>Default matcher used by every pipeline unless overridden
per-slot. User config (post-§5.12) sets this via
cmdline.matcher = "match:fuzzy".
default_rankers: Vec<RankerId>Default rankers, in chain order. Earlier rankers establish
baseline order; later rankers refine within. Slice
3c.unify.ranker-stack replaced Option<RankerId> with
Vec<RankerId> so dimensions (e.g. ScoreRanker then
MruRanker) compose without either becoming aware of the
other. Empty list ⇒ no rankers ⇒ Pipeline::for_generator
returns None (a configuration error).
default_annotators: Vec<AnnotatorId>Annotators that run on every candidate, in registration order. v1 has no priority field; plugins that need a specific position re-register existing annotators after their own.
cache: GeneratorCacheCache backing every generator that opts in via cache_key.
Implementations§
Source§impl CompletionRegistry
impl CompletionRegistry
pub fn new() -> Self
pub fn register_generator( &mut self, name: &str, doc: &str, generator: impl CandidateGenerator + 'static, ) -> GeneratorId
pub fn register_matcher( &mut self, name: &str, doc: &str, m: impl CandidateMatcher + 'static, ) -> MatcherId
pub fn register_ranker( &mut self, name: &str, doc: &str, r: impl CandidateRanker + 'static, ) -> RankerId
pub fn register_annotator( &mut self, name: &str, doc: &str, a: impl CandidateAnnotator + 'static, ) -> AnnotatorId
Sourcepub fn register_source(&mut self, reg: SourceRegistration)
pub fn register_source(&mut self, reg: SourceRegistration)
Slice 3c.unify.source-registration-bundle (7c).
Register a crate::SourceRegistration bundle —
substrate for picker + cmdline-completion + plugin
sources. Keys on SourceSpec::id; a
duplicate id overwrites the previous entry (last
registration wins, matching the convention that user
init.rs overrides built-ins).
No host wiring in 7c — 7d’s registry cutover migrates
:picker <name> lookup from PickerRegistry to
Self::source_by_id. Until then, registrations land
here but nothing consumes them in production code.
Sourcepub fn source_by_id(&self, id: &str) -> Option<&SourceRegistration>
pub fn source_by_id(&self, id: &str) -> Option<&SourceRegistration>
Look up a registered source by its id.
Sourcepub fn sources(&self) -> impl Iterator<Item = &SourceRegistration>
pub fn sources(&self) -> impl Iterator<Item = &SourceRegistration>
Iterate all registered sources in HashMap order.
Callers that need deterministic ordering should sort by
spec.id themselves; v1 doesn’t dictate ordering at
the registry layer.
Sourcepub fn source_count(&self) -> usize
pub fn source_count(&self) -> usize
Number of registered sources.