pub struct InMemoryVectorStore { /* private fields */ }Expand description
In-memory vector store backed by a simple Vec with linear scan search.
Intended for unit tests and prototyping — not suitable for production workloads.
Implementations§
Source§impl InMemoryVectorStore
impl InMemoryVectorStore
Sourcepub fn with_metric(default_metric: SimilarityMetric) -> Self
pub fn with_metric(default_metric: SimilarityMetric) -> Self
Create a new empty in-memory vector store with the metric used for new collections.
Sourcepub fn with_options(
default_metric: SimilarityMetric,
limits: VectorStoreLimits,
) -> Self
pub fn with_options( default_metric: SimilarityMetric, limits: VectorStoreLimits, ) -> Self
Create a new empty in-memory vector store with explicit safety limits.
Trait Implementations§
Source§impl Default for InMemoryVectorStore
impl Default for InMemoryVectorStore
Source§impl VectorStore for InMemoryVectorStore
impl VectorStore for InMemoryVectorStore
Source§fn ensure_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 str,
dimensions: usize,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ensure_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 str,
dimensions: usize,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Ensure a collection exists, creating it if necessary.
Source§fn upsert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
id: &'life2 str,
vector: Vec<f32>,
payload: PointPayload,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upsert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
id: &'life2 str,
vector: Vec<f32>,
payload: PointPayload,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Insert or update a vector point.
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 str,
vector: Vec<f32>,
limit: usize,
filter: Option<SearchFilter>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 str,
vector: Vec<f32>,
limit: usize,
filter: Option<SearchFilter>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search for similar vectors.
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