Skip to main content

SearchBackend

Trait SearchBackend 

Source
pub trait SearchBackend:
    Send
    + Sync
    + 'static {
    // Required method
    fn search<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        max_results: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, WebSearchError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Runs a search (SearchBackend): the top max_results results for query.

Required Methods§

Source

fn search<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, max_results: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, WebSearchError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Searches.

§Errors

When the search fails; the model sees web_search failed: <message>.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§