Skip to main content

SearchProvider

Trait SearchProvider 

Source
pub trait SearchProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn search(&self, query: &str, limit: usize) -> Result<Vec<SearchResult>>;
}
Expand description

Unified sync interface for search backends producing ranked results.

Required Methods§

Source

fn name(&self) -> &'static str

Human-readable backend name.

Source

fn search(&self, query: &str, limit: usize) -> Result<Vec<SearchResult>>

Run a query, returning up to limit ranked results.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§