pub struct InMemoryStore { /* private fields */ }Expand description
In-memory vector store
Implementations§
Source§impl InMemoryStore
impl InMemoryStore
Trait Implementations§
Source§impl Default for InMemoryStore
impl Default for InMemoryStore
Source§impl VectorStore for InMemoryStore
impl VectorStore for InMemoryStore
Source§fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Vec<f32>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Vec<f32>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert a record with its embedding
Source§fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
limit: usize,
filters: Option<&'life2 Filters>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
limit: usize,
filters: Option<&'life2 Filters>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Search for similar vectors
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a single record by ID
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + 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<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a record by ID
Source§fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Option<Vec<f32>>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Option<Vec<f32>>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a record
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all records with optional filters
Source§fn delete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
) -> Pin<Box<dyn Future<Output = Result<usize, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
) -> Pin<Box<dyn Future<Output = Result<usize, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete all records matching filters
Source§fn collection_exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn collection_exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if collection/index exists
Source§fn create_collection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_collection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create collection/index if it doesn’t exist
Auto Trait Implementations§
impl !Freeze for InMemoryStore
impl RefUnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnwindSafe for InMemoryStore
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more