Skip to main content

CompletionRegistry

Struct CompletionRegistry 

Source
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: GeneratorCache

Cache backing every generator that opts in via cache_key.

Implementations§

Source§

impl CompletionRegistry

Source

pub fn new() -> Self

Source

pub fn register_generator( &mut self, name: &str, doc: &str, generator: impl CandidateGenerator + 'static, ) -> GeneratorId

Source

pub fn register_matcher( &mut self, name: &str, doc: &str, m: impl CandidateMatcher + 'static, ) -> MatcherId

Source

pub fn register_ranker( &mut self, name: &str, doc: &str, r: impl CandidateRanker + 'static, ) -> RankerId

Source

pub fn register_annotator( &mut self, name: &str, doc: &str, a: impl CandidateAnnotator + 'static, ) -> AnnotatorId

Source

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.

Source

pub fn source_by_id(&self, id: &str) -> Option<&SourceRegistration>

Look up a registered source by its id.

Source

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.

Source

pub fn source_count(&self) -> usize

Number of registered sources.

Source

pub fn generator(&self, id: GeneratorId) -> Option<&RegisteredGenerator>

Source

pub fn matcher(&self, id: MatcherId) -> Option<&RegisteredMatcher>

Source

pub fn ranker(&self, id: RankerId) -> Option<&RegisteredRanker>

Source

pub fn annotator(&self, id: AnnotatorId) -> Option<&RegisteredAnnotator>

Source

pub fn generator_by_name(&self, name: &str) -> Option<&RegisteredGenerator>

Source

pub fn matcher_by_name(&self, name: &str) -> Option<&RegisteredMatcher>

Source

pub fn ranker_by_name(&self, name: &str) -> Option<&RegisteredRanker>

Source

pub fn annotator_by_name(&self, name: &str) -> Option<&RegisteredAnnotator>

Source

pub fn generator_count(&self) -> usize

Trait Implementations§

Source§

impl Debug for CompletionRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CompletionRegistry

Source§

fn default() -> CompletionRegistry

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more