Skip to main content

CandidateSink

Trait CandidateSink 

Source
pub trait CandidateSink: Send + Sync {
    // Required method
    fn push(&self, candidate: RawCandidate);

    // Provided method
    fn mark_incomplete(&self) { ... }
}
Expand description

Host-supplied mailbox an AsyncCompletionSource pushes candidates into. The host’s lattice-ui-tui impl wraps a tokio::sync::mpsc::UnboundedSender<SinkEvent> so the per-frame drain merges async-source pushes into InsertCompletionState::raw; a WASM-plugin host wraps whatever its runtime provides.

push is fire-and-forget: a closed channel (popup dismissed) silently drops the candidate. Sources should rely on cancellation, not push success, to know when to stop.

Required Methods§

Source

fn push(&self, candidate: RawCandidate)

Provided Methods§

Source

fn mark_incomplete(&self)

CSM.8b: async source signals that the result set is server-truncated and the host should re-fire on subsequent keystrokes (LSP isIncomplete: true). Default impl is a no-op so sources that don’t need the signal (snippets, plugins with bounded result sets) don’t have to care. The LSP source calls this once per produce_async invocation when any server reported isIncomplete.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§