Skip to main content

ChunksStore

Trait ChunksStore 

Source
pub trait ChunksStore: Send + Sync {
    // Required methods
    fn append<'life0, 'async_trait>(
        &'life0 self,
        chunk: Chunk,
    ) -> Pin<Box<dyn Future<Output = Result<ChunkId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search_bm25<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        project: Option<&'life1 str>,
        query: &'life2 str,
        k: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredChunk>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn count<'life0, 'life1, 'async_trait>(
        &'life0 self,
        project: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Async chunks store.

Required Methods§

Source

fn append<'life0, 'async_trait>( &'life0 self, chunk: Chunk, ) -> Pin<Box<dyn Future<Output = Result<ChunkId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append a new chunk.

Source

fn search_bm25<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: Option<&'life1 str>, query: &'life2 str, k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredChunk>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

BM25 search.

project = None searches across every project; Some(p) scopes to one. k caps the number of hits.

Source

fn count<'life0, 'life1, 'async_trait>( &'life0 self, project: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Total chunk count, optionally scoped to a project.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§