pub struct InMemoryVectorStore { /* private fields */ }Expand description
An in-memory VectorStore, for tests and for running a pipeline before
a real store is provisioned.
Brute-force search: every record’s vector is scored against the query, so cost is linear in collection size. That is the right trade for a few thousand records and the wrong one for a few million — this is not a substitute for a real index.
Implementations§
Source§impl InMemoryVectorStore
impl InMemoryVectorStore
pub fn new() -> InMemoryVectorStore
Trait Implementations§
Source§impl Default for InMemoryVectorStore
impl Default for InMemoryVectorStore
Source§fn default() -> InMemoryVectorStore
fn default() -> InMemoryVectorStore
Returns the “default value” for a type. Read more
Source§impl VectorStore for InMemoryVectorStore
impl VectorStore for InMemoryVectorStore
Source§fn get_collection(
&self,
name: &str,
definition: VectorStoreCollectionDefinition,
) -> Result<Box<dyn VectorCollection>, Error>
fn get_collection( &self, name: &str, definition: VectorStoreCollectionDefinition, ) -> Result<Box<dyn VectorCollection>, Error>
Open a collection by name against
definition. Read moreSource§fn list_collection_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryVectorStore: 'async_trait,
fn list_collection_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryVectorStore: 'async_trait,
Every collection name in the store.
Source§fn collection_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn collection_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Whether a collection exists. Defaults to a
Self::list_collection_names scan, which every store supports;
override where the provider has a cheaper direct check.Auto Trait Implementations§
impl Freeze for InMemoryVectorStore
impl RefUnwindSafe for InMemoryVectorStore
impl Send for InMemoryVectorStore
impl Sync for InMemoryVectorStore
impl Unpin for InMemoryVectorStore
impl UnsafeUnpin for InMemoryVectorStore
impl UnwindSafe for InMemoryVectorStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more