pub trait VectorDbClient: Send + Sync {
// Required methods
fn ensure_collection(
&self,
name: &str,
vector_size: u64,
) -> impl Future<Output = Result<(), VectorDbError>> + Send;
fn upsert_points(
&self,
collection: &str,
points: Vec<VectorPoint>,
consistency: WriteConsistency,
) -> impl Future<Output = Result<(), VectorDbError>> + Send;
fn search(
&self,
collection: &str,
query: Vec<f32>,
limit: u64,
tenant_filter: Option<u64>,
) -> impl Future<Output = Result<Vec<SearchResult>, VectorDbError>> + Send;
fn delete_points(
&self,
collection: &str,
ids: Vec<u64>,
) -> impl Future<Output = Result<(), VectorDbError>> + Send;
}Expand description
Minimal async interface used by higher-level code.
Required Methods§
Sourcefn ensure_collection(
&self,
name: &str,
vector_size: u64,
) -> impl Future<Output = Result<(), VectorDbError>> + Send
fn ensure_collection( &self, name: &str, vector_size: u64, ) -> impl Future<Output = Result<(), VectorDbError>> + Send
Ensures a collection exists.
Sourcefn upsert_points(
&self,
collection: &str,
points: Vec<VectorPoint>,
consistency: WriteConsistency,
) -> impl Future<Output = Result<(), VectorDbError>> + Send
fn upsert_points( &self, collection: &str, points: Vec<VectorPoint>, consistency: WriteConsistency, ) -> impl Future<Output = Result<(), VectorDbError>> + Send
Upserts points.
Sourcefn search(
&self,
collection: &str,
query: Vec<f32>,
limit: u64,
tenant_filter: Option<u64>,
) -> impl Future<Output = Result<Vec<SearchResult>, VectorDbError>> + Send
fn search( &self, collection: &str, query: Vec<f32>, limit: u64, tenant_filter: Option<u64>, ) -> impl Future<Output = Result<Vec<SearchResult>, VectorDbError>> + Send
Searches for similar points.
Sourcefn delete_points(
&self,
collection: &str,
ids: Vec<u64>,
) -> impl Future<Output = Result<(), VectorDbError>> + Send
fn delete_points( &self, collection: &str, ids: Vec<u64>, ) -> impl Future<Output = Result<(), VectorDbError>> + Send
Deletes points.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl VectorDbClient for MockVectorDbClient
Available on crate features
mock only.Computes cosine similarity between two f32 vectors.