pub trait LanguageBackend: Send + Sync {
// Required methods
fn mode(&self) -> LangMode;
fn build_candidate_keys(
&self,
text: &str,
budget: KeyBudget,
) -> Vec<SearchKey>;
fn expand_query(
&self,
query: &str,
budget: QueryBudget,
) -> Vec<QueryVariant>;
// Provided method
fn normalize_candidate(&self, text: &str) -> String { ... }
}Expand description
Language-specific candidate and query expansion.
Required Methods§
Sourcefn build_candidate_keys(&self, text: &str, budget: KeyBudget) -> Vec<SearchKey>
fn build_candidate_keys(&self, text: &str, budget: KeyBudget) -> Vec<SearchKey>
Builds additional language-specific search keys for candidate text.
Sourcefn expand_query(&self, query: &str, budget: QueryBudget) -> Vec<QueryVariant>
fn expand_query(&self, query: &str, budget: QueryBudget) -> Vec<QueryVariant>
Expands a user query into language-specific query variants.
Provided Methods§
Sourcefn normalize_candidate(&self, text: &str) -> String
fn normalize_candidate(&self, text: &str) -> String
Normalizes candidate display text before the base normalized key is added.
Extended-query exact matching reuses this key instead of re-folding the
original text per candidate, and skips it entirely when it is only a case-folded
copy of the display text, so an override must stay equivalent to
normalize::normalize for case- and width-insensitive comparison.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".