Skip to main content

GithubSearchBackend

Trait GithubSearchBackend 

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

A pluggable GitHub-search backend.

The default OctocrabGithubSearch hits the real API. Tests inject a stub so the tool’s arg-parsing + formatting can be exercised offline.

Required Methods§

Source

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

Run a search of kind for query (already scoped), up to k results.

§Errors

Returns an error if the upstream GitHub call fails (e.g. a 403 rate limit).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§