pub struct InMemoryVectorStorage { /* private fields */ }Expand description
In-memory vector storage implementation
Provides fast vector storage using in-memory HashMap. Suitable for temporary storage, testing, and small-scale applications.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryVectorStorage
impl Default for InMemoryVectorStorage
Source§impl VectorStorage for InMemoryVectorStorage
impl VectorStorage for InMemoryVectorStorage
Source§fn store_vector(
&mut self,
vector: &[f32],
metadata: Option<Value>,
) -> Result<u64, HnswError>
fn store_vector( &mut self, vector: &[f32], metadata: Option<Value>, ) -> Result<u64, HnswError>
Store a vector with optional metadata Read more
Source§fn store_vector_with_id(
&mut self,
id: u64,
vector: Vec<f32>,
metadata: Option<Value>,
) -> Result<(), HnswError>
fn store_vector_with_id( &mut self, id: u64, vector: Vec<f32>, metadata: Option<Value>, ) -> Result<(), HnswError>
Store vector with explicit ID Read more
Source§fn get_vector(&self, id: u64) -> Result<Option<Vec<f32>>, HnswError>
fn get_vector(&self, id: u64) -> Result<Option<Vec<f32>>, HnswError>
Retrieve vector by ID Read more
Source§fn get_vector_with_metadata(
&self,
id: u64,
) -> Result<Option<(Vec<f32>, Value)>, HnswError>
fn get_vector_with_metadata( &self, id: u64, ) -> Result<Option<(Vec<f32>, Value)>, HnswError>
Retrieve vector with metadata Read more
Source§fn store_batch(&mut self, batch: VectorBatch) -> Result<Vec<u64>, HnswError>
fn store_batch(&mut self, batch: VectorBatch) -> Result<Vec<u64>, HnswError>
Store multiple vectors in batch Read more
Source§fn get_statistics(&self) -> Result<VectorStorageStats, HnswError>
fn get_statistics(&self) -> Result<VectorStorageStats, HnswError>
Get storage statistics Read more
fn as_sqlite_connection(&self) -> Option<(&Connection, i64)>
Auto Trait Implementations§
impl Freeze for InMemoryVectorStorage
impl RefUnwindSafe for InMemoryVectorStorage
impl Send for InMemoryVectorStorage
impl Sync for InMemoryVectorStorage
impl Unpin for InMemoryVectorStorage
impl UnsafeUnpin for InMemoryVectorStorage
impl UnwindSafe for InMemoryVectorStorage
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more