pub trait VectorStore: Send + Sync {
// Required methods
fn insert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: &'life2 Embedding,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 Embedding,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hit>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save(&self, path: &Path) -> Result<(), StoreError>;
fn load(&mut self, path: &Path) -> Result<(), StoreError>;
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Required Methods§
fn insert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: &'life2 Embedding,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 Embedding,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hit>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save(&self, path: &Path) -> Result<(), StoreError>
fn load(&mut self, path: &Path) -> Result<(), StoreError>
fn len(&self) -> usize
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".