pub trait DocumentStore: Send + Sync {
// Required methods
fn add_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
) -> Pin<Box<dyn Future<Output = Result<String, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn add_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
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 delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + 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;
}Expand description
Document store trait
Required Methods§
Sourcefn add_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
) -> Pin<Box<dyn Future<Output = Result<String, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn add_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
) -> Pin<Box<dyn Future<Output = Result<String, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Adds a document
Sourcefn add_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn add_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Adds documents in bulk
Sourcefn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
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_document<'life0, 'life1, 'async_trait>(
&'life0 self,
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 document
Sourcefn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
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_document<'life0, 'life1, 'async_trait>(
&'life0 self,
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 document
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".