pub trait ChunkedDocumentStoreTrait: Send + Sync {
Show 16 methods
// Required methods
fn add_parent_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
chunk_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(String, Vec<String>), VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn add_parent_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
chunk_size: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<String>)>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_parent_document<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_chunk_document<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_chunks_for_parent<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_chunk_documents_for_parent<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Document>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn delete_parent_document<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn parent_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn chunk_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_all_chunks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn add_parent_document_blocking(
&self,
document: Document,
chunk_size: usize,
) -> Result<(String, Vec<String>), VectorStoreError>;
fn get_parent_document_blocking(
&self,
parent_id: &str,
) -> Result<Option<Document>, VectorStoreError>;
fn get_chunk_blocking(
&self,
chunk_id: &str,
) -> Result<Option<ChunkDocument>, VectorStoreError>;
fn blocking_get_chunks_for_parent(
&self,
parent_id: &str,
) -> Result<Vec<ChunkDocument>, VectorStoreError>;
}Expand description
Document store trait supporting a parent-child structure
This trait defines a unified interface for the back-reference store, supporting:
- MongoDB (production)
- InMemory (development/test)
- Redis (cache layer, reserved)
- SQLite (local storage, reserved)
Required Methods§
Sourcefn add_parent_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
chunk_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(String, Vec<String>), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn add_parent_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
chunk_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(String, Vec<String>), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sourcefn add_parent_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
chunk_size: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<String>)>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn add_parent_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
chunk_size: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<String>)>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Adds Parent documents in bulk
Sourcefn get_parent_document<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_parent_document<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Gets a Parent document
Sourcefn get_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Gets a single Chunk
Sourcefn get_chunk_document<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_chunk_document<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Gets a single Chunk (as a Document)
Sourcefn get_chunks_for_parent<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_chunks_for_parent<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Gets all Chunks of a Parent
Sourcefn get_chunk_documents_for_parent<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_chunk_documents_for_parent<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Gets all Chunks of a Parent (as Documents)
Sourcefn delete_parent_document<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn delete_parent_document<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Deletes a Parent document and all of its Chunks
Sourcefn parent_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn parent_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets the Parent document count
Sourcefn chunk_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn chunk_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets the Chunk document count
Sourcefn get_all_chunks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_all_chunks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkDocument>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets all Chunks
Sourcefn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Clears all data
Sourcefn add_parent_document_blocking(
&self,
document: Document,
chunk_size: usize,
) -> Result<(String, Vec<String>), VectorStoreError>
fn add_parent_document_blocking( &self, document: Document, chunk_size: usize, ) -> Result<(String, Vec<String>), VectorStoreError>
Adds a Parent document (blocking version)
Sourcefn get_parent_document_blocking(
&self,
parent_id: &str,
) -> Result<Option<Document>, VectorStoreError>
fn get_parent_document_blocking( &self, parent_id: &str, ) -> Result<Option<Document>, VectorStoreError>
Gets a Parent document (blocking version)
Sourcefn get_chunk_blocking(
&self,
chunk_id: &str,
) -> Result<Option<ChunkDocument>, VectorStoreError>
fn get_chunk_blocking( &self, chunk_id: &str, ) -> Result<Option<ChunkDocument>, VectorStoreError>
Gets a single Chunk (blocking version)
Sourcefn blocking_get_chunks_for_parent(
&self,
parent_id: &str,
) -> Result<Vec<ChunkDocument>, VectorStoreError>
fn blocking_get_chunks_for_parent( &self, parent_id: &str, ) -> Result<Vec<ChunkDocument>, VectorStoreError>
Gets all Chunks of a Parent (blocking version)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".