pub struct SimVectorBackend { /* private fields */ }Expand description
In-memory vector backend for deterministic simulation testing.
Features:
- Deterministic similarity computation
- Fault injection support
- No external dependencies
Implementations§
Source§impl SimVectorBackend
impl SimVectorBackend
Sourcepub fn with_faults(seed: u64, fault_injector: Arc<FaultInjector>) -> Self
pub fn with_faults(seed: u64, fault_injector: Arc<FaultInjector>) -> Self
Create with fault injection enabled.
Trait Implementations§
Source§impl Clone for SimVectorBackend
impl Clone for SimVectorBackend
Source§fn clone(&self) -> SimVectorBackend
fn clone(&self) -> SimVectorBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl VectorBackend for SimVectorBackend
impl VectorBackend for SimVectorBackend
Source§fn store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: &'life2 [f32],
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: &'life2 [f32],
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store an embedding for an entity. Read more
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
limit: usize,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<VectorSearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
limit: usize,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<VectorSearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search for similar embeddings. Read more
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an embedding.
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if an embedding exists.
Auto Trait Implementations§
impl Freeze for SimVectorBackend
impl RefUnwindSafe for SimVectorBackend
impl Send for SimVectorBackend
impl Sync for SimVectorBackend
impl Unpin for SimVectorBackend
impl UnwindSafe for SimVectorBackend
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