Skip to main content

SyncCompletionSource

Trait SyncCompletionSource 

Source
pub trait SyncCompletionSource:
    Send
    + Sync
    + Debug {
    // Required method
    fn produce(&self, ctx: &InsertContext<'_>) -> Vec<RawCandidate>;
}
Expand description

Cheap, blocking completion source. Implementations walk the buffer / a small registry / a cached symbol table and return the matching RawCandidates in a single call. The aggregator invokes Self::produce once per refilter (once per popup- query change). Sources strictly more expensive than ~100 us per call should be AsyncCompletionSources instead.

This is the post-§12 successor to the v1 crate::insert::InsertSource trait – new sources should target this trait; existing impls migrate per the slice plan (CSM.4 – CSM.7).

Required Methods§

Source

fn produce(&self, ctx: &InsertContext<'_>) -> Vec<RawCandidate>

Produce raw candidates for the supplied context. Cheap (microseconds); the aggregator calls this whenever the popup’s query string changes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl SyncCompletionSource for BufferWordsSource

CSM.4: the new mode-driven trait surface. Same produce() body as the legacy InsertSource impl; carried as a peer during the migration so the existing hardcoded path keeps working while the mode-contributed path lights up. The hardcoded call will retire once every source has migrated (CSM.8 wraps it up).

Source§

impl SyncCompletionSource for PathCompletionSource