pub struct FlatIndex { /* private fields */ }Expand description
A brute-force flat vector index. Suitable for small-to-medium datasets. Can be replaced with HNSW later without changing the public API.
Implementations§
Trait Implementations§
Source§impl VectorIndex for FlatIndex
impl VectorIndex for FlatIndex
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
id: Uuid,
vector: &'life1 [f32],
payload: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 [f32],
limit: usize,
filters: Option<&'life2 MemoryFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
vector: Option<&'life2 [f32]>,
payload: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<f32>, Value)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 MemoryFilter>,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Value)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn reset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for FlatIndex
impl RefUnwindSafe for FlatIndex
impl Send for FlatIndex
impl Sync for FlatIndex
impl Unpin for FlatIndex
impl UnsafeUnpin for FlatIndex
impl UnwindSafe for FlatIndex
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