pub trait SparseStore:
Send
+ Sync
+ 'static {
// Required methods
fn insert_sparse<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject_id: Uuid,
kind: SubstrateKind,
namespace: &'life1 str,
field: &'life2 str,
vector: SparseVector,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn insert_batch<'life0, 'async_trait>(
&'life0 self,
records: Vec<SparseRecord>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn search_sparse<'life0, 'async_trait>(
&'life0 self,
request: SparseSearchRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<SparseSearchHit>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Sparse vector storage and lexical-semantic search capability.
Required Methods§
Sourcefn insert_sparse<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject_id: Uuid,
kind: SubstrateKind,
namespace: &'life1 str,
field: &'life2 str,
vector: SparseVector,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn insert_sparse<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject_id: Uuid,
kind: SubstrateKind,
namespace: &'life1 str,
field: &'life2 str,
vector: SparseVector,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Insert a single sparse vector for a subject.
Sourcefn insert_batch<'life0, 'async_trait>(
&'life0 self,
records: Vec<SparseRecord>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_batch<'life0, 'async_trait>(
&'life0 self,
records: Vec<SparseRecord>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert a batch of sparse vector records.
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete the sparse vector for a subject.
Sourcefn search_sparse<'life0, 'async_trait>(
&'life0 self,
request: SparseSearchRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<SparseSearchHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search_sparse<'life0, 'async_trait>(
&'life0 self,
request: SparseSearchRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<SparseSearchHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Search over sparse vectors using a sparse query.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".