pub struct InMemoryVectorStore {
pub entries: Mutex<Vec<EmbeddingEntry>>,
}Expand description
In-memory VectorStore implementation for testing. Uses cosine similarity for nearest-neighbour search.
Fields§
§entries: Mutex<Vec<EmbeddingEntry>>Implementations§
Trait Implementations§
Source§impl Default for InMemoryVectorStore
impl Default for InMemoryVectorStore
Source§impl VectorStore for InMemoryVectorStore
impl VectorStore for InMemoryVectorStore
fn store_embeddings(&self, entries: &[EmbeddingEntry]) -> Result<()>
fn search_nearest( &self, query_vec: &[f32], limit: usize, ) -> Result<Vec<(String, f64)>>
fn has_embeddings(&self) -> bool
fn count(&self) -> Result<usize>
fn remove_embeddings(&self, qualified_names: &[&str]) -> Result<()>
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