pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub async fn connect(
dst: String,
api_key: Option<String>,
user_id: Option<String>,
) -> Result<Self, Box<dyn Error>>
pub async fn connect( dst: String, api_key: Option<String>, user_id: Option<String>, ) -> Result<Self, Box<dyn Error>>
Sourcepub async fn create_collection(
&mut self,
name: String,
dimension: u32,
metric: String,
) -> Result<String, Status>
pub async fn create_collection( &mut self, name: String, dimension: u32, metric: String, ) -> Result<String, Status>
Creates a new collection.
§Errors
Returns error if the collection already exists or if network fails.
Sourcepub async fn list_collections(
&mut self,
) -> Result<Vec<CollectionSummary>, Status>
pub async fn list_collections( &mut self, ) -> Result<Vec<CollectionSummary>, Status>
Lists all collections with their metadata (dimension, metric, count).
§Errors
Returns error on network failure.
Sourcepub async fn get_collection_stats(
&mut self,
name: String,
) -> Result<CollectionStatsResponse, Status>
pub async fn get_collection_stats( &mut self, name: String, ) -> Result<CollectionStatsResponse, Status>
Gets statistics for a collection.
§Errors
Returns error if the collection does not exist or network fails.
Sourcepub async fn rebuild_index(&mut self, name: String) -> Result<String, Status>
pub async fn rebuild_index(&mut self, name: String) -> Result<String, Status>
Rebuilds the index for a collection. This is a resource-intensive operation.
§Errors
Returns error if the collection does not exist or operation fails.
Sourcepub async fn rebuild_index_with_filter(
&mut self,
name: String,
key: String,
op: String,
value: f64,
) -> Result<String, Status>
pub async fn rebuild_index_with_filter( &mut self, name: String, key: String, op: String, value: f64, ) -> Result<String, Status>
Rebuilds index with optional metadata-based pruning filter.
§Errors
Returns error if operation fails.
Sourcepub async fn trigger_vacuum(&mut self) -> Result<String, Status>
pub async fn trigger_vacuum(&mut self) -> Result<String, Status>
Sourcepub async fn trigger_reconsolidation(
&mut self,
collection: String,
target_vector: Vec<f64>,
learning_rate: f64,
) -> Result<String, Status>
pub async fn trigger_reconsolidation( &mut self, collection: String, target_vector: Vec<f64>, learning_rate: f64, ) -> Result<String, Status>
Triggers background memory reconsolidation (AI Sleep Mode / Flow Matching SGD).
§Errors
Returns error if the operation fails.
Sourcepub async fn insert(
&mut self,
id: u32,
vector: Vec<f64>,
metadata: HashMap<String, String>,
collection: Option<String>,
) -> Result<bool, Status>
pub async fn insert( &mut self, id: u32, vector: Vec<f64>, metadata: HashMap<String, String>, collection: Option<String>, ) -> Result<bool, Status>
Sourcepub async fn insert_f32(
&mut self,
id: u32,
vector: &[f32],
metadata: HashMap<String, String>,
collection: Option<String>,
) -> Result<bool, Status>
pub async fn insert_f32( &mut self, id: u32, vector: &[f32], metadata: HashMap<String, String>, collection: Option<String>, ) -> Result<bool, Status>
Inserts a vector from f32 input (client-side conversion to protocol f64).
§Errors
Returns error if insertion fails.
Sourcepub async fn insert_text(
&mut self,
id: u32,
text: String,
metadata: HashMap<String, String>,
collection: Option<String>,
) -> Result<bool, Status>
pub async fn insert_text( &mut self, id: u32, text: String, metadata: HashMap<String, String>, collection: Option<String>, ) -> Result<bool, Status>
Inserts text that will be vectorized on the server side.
§Errors
Returns error if insertion/vectorization fails.
Sourcepub async fn vectorize(
&mut self,
text: String,
metric: String,
) -> Result<Vec<f64>, Status>
pub async fn vectorize( &mut self, text: String, metric: String, ) -> Result<Vec<f64>, Status>
Sourcepub async fn batch_insert(
&mut self,
items: Vec<(u32, Vec<f64>, HashMap<String, String>)>,
collection: Option<String>,
durability: DurabilityLevel,
) -> Result<bool, Status>
pub async fn batch_insert( &mut self, items: Vec<(u32, Vec<f64>, HashMap<String, String>)>, collection: Option<String>, durability: DurabilityLevel, ) -> Result<bool, Status>
Sourcepub async fn batch_insert_f32(
&mut self,
items: Vec<(u32, Vec<f32>, HashMap<String, String>)>,
collection: Option<String>,
durability: DurabilityLevel,
) -> Result<bool, Status>
pub async fn batch_insert_f32( &mut self, items: Vec<(u32, Vec<f32>, HashMap<String, String>)>, collection: Option<String>, durability: DurabilityLevel, ) -> Result<bool, Status>
Sourcepub async fn search(
&mut self,
vector: Vec<f64>,
top_k: u32,
collection: Option<String>,
) -> Result<Vec<SearchResult>, Status>
pub async fn search( &mut self, vector: Vec<f64>, top_k: u32, collection: Option<String>, ) -> Result<Vec<SearchResult>, Status>
Sourcepub async fn search_f32(
&mut self,
vector: &[f32],
top_k: u32,
collection: Option<String>,
) -> Result<Vec<SearchResult>, Status>
pub async fn search_f32( &mut self, vector: &[f32], top_k: u32, collection: Option<String>, ) -> Result<Vec<SearchResult>, Status>
Searches using f32 query vector (converted to protocol f64 once).
§Errors
Returns error if search fails.
Sourcepub async fn search_text(
&mut self,
text: String,
top_k: u32,
collection: Option<String>,
) -> Result<Vec<SearchResult>, Status>
pub async fn search_text( &mut self, text: String, top_k: u32, collection: Option<String>, ) -> Result<Vec<SearchResult>, Status>
Searches using text that will be vectorized on the server side.
§Errors
Returns error if search fails.
Sourcepub async fn search_wasserstein(
&mut self,
vector: Vec<f64>,
top_k: u32,
collection: Option<String>,
) -> Result<Vec<SearchResult>, Status>
pub async fn search_wasserstein( &mut self, vector: Vec<f64>, top_k: u32, collection: Option<String>, ) -> Result<Vec<SearchResult>, Status>
Performs search utilizing the Wasserstein distance (Cross-Feature Matching Metric).
§Errors
Returns error if search fails.
Sourcepub async fn search_batch(
&mut self,
vectors: Vec<Vec<f64>>,
top_k: u32,
collection: Option<String>,
) -> Result<Vec<Vec<SearchResult>>, Status>
pub async fn search_batch( &mut self, vectors: Vec<Vec<f64>>, top_k: u32, collection: Option<String>, ) -> Result<Vec<Vec<SearchResult>>, Status>
Sourcepub async fn search_batch_f32(
&mut self,
vectors: &[Vec<f32>],
top_k: u32,
collection: Option<String>,
) -> Result<Vec<Vec<SearchResult>>, Status>
pub async fn search_batch_f32( &mut self, vectors: &[Vec<f32>], top_k: u32, collection: Option<String>, ) -> Result<Vec<Vec<SearchResult>>, Status>
Batch search from f32 vectors (converted to protocol f64 once).
§Errors
Returns error if the batch search fails.
Sourcepub async fn search_multi_collection(
&mut self,
vector: Vec<f64>,
collections: Vec<String>,
top_k: u32,
) -> Result<HashMap<String, Vec<SearchResult>>, Status>
pub async fn search_multi_collection( &mut self, vector: Vec<f64>, collections: Vec<String>, top_k: u32, ) -> Result<HashMap<String, Vec<SearchResult>>, Status>
Multi-Geometry Benchmark Endpoint (10.3) Performs identical searches across multiple collections in parallel (via Batch Search). Typically used by the Frontend to compare L2, Cosine, Poincare and Lorentz results directly.
§Errors
Returns error if the batch search RPC fails.
Sourcepub async fn search_advanced(
&mut self,
vector: Vec<f64>,
top_k: u32,
filters: Vec<Filter>,
hybrid: Option<(String, f32)>,
collection: Option<String>,
) -> Result<Vec<SearchResult>, Status>
pub async fn search_advanced( &mut self, vector: Vec<f64>, top_k: u32, filters: Vec<Filter>, hybrid: Option<(String, f32)>, collection: Option<String>, ) -> Result<Vec<SearchResult>, Status>
Sourcepub async fn delete(
&mut self,
id: u32,
collection: Option<String>,
) -> Result<bool, Status>
pub async fn delete( &mut self, id: u32, collection: Option<String>, ) -> Result<bool, Status>
Sourcepub async fn get_node(
&mut self,
id: u32,
layer: u32,
collection: Option<String>,
) -> Result<GraphNode, Status>
pub async fn get_node( &mut self, id: u32, layer: u32, collection: Option<String>, ) -> Result<GraphNode, Status>
Sourcepub async fn get_neighbors(
&mut self,
id: u32,
layer: u32,
limit: u32,
offset: u32,
collection: Option<String>,
) -> Result<GetNeighborsResponse, Status>
pub async fn get_neighbors( &mut self, id: u32, layer: u32, limit: u32, offset: u32, collection: Option<String>, ) -> Result<GetNeighborsResponse, Status>
Sourcepub async fn get_neighbors_with_weights(
&mut self,
id: u32,
layer: u32,
limit: u32,
offset: u32,
collection: Option<String>,
) -> Result<Vec<(GraphNode, f64)>, Status>
pub async fn get_neighbors_with_weights( &mut self, id: u32, layer: u32, limit: u32, offset: u32, collection: Option<String>, ) -> Result<Vec<(GraphNode, f64)>, Status>
Returns neighbors with aligned edge weights (distance to source).
§Errors
Returns error if request fails.
Sourcepub async fn traverse(
&mut self,
req: TraverseRequest,
) -> Result<TraverseResponse, Status>
pub async fn traverse( &mut self, req: TraverseRequest, ) -> Result<TraverseResponse, Status>
Traverses graph from a start node with depth and node guards.
§Errors
Returns error if request fails.
Sourcepub async fn find_semantic_clusters(
&mut self,
req: FindSemanticClustersRequest,
) -> Result<FindSemanticClustersResponse, Status>
pub async fn find_semantic_clusters( &mut self, req: FindSemanticClustersRequest, ) -> Result<FindSemanticClustersResponse, Status>
Sourcepub async fn get_concept_parents(
&mut self,
id: u32,
layer: u32,
limit: u32,
collection: Option<String>,
) -> Result<GetConceptParentsResponse, Status>
pub async fn get_concept_parents( &mut self, id: u32, layer: u32, limit: u32, collection: Option<String>, ) -> Result<GetConceptParentsResponse, Status>
Sourcepub async fn subscribe_to_events(
&mut self,
types: Vec<EventType>,
collection: Option<String>,
) -> Result<Streaming<EventMessage>, Status>
pub async fn subscribe_to_events( &mut self, types: Vec<EventType>, collection: Option<String>, ) -> Result<Streaming<EventMessage>, Status>
Subscribes to CDC event stream (VectorInserted/VectorDeleted).
§Errors
Returns error if stream initialization fails.
Sourcepub async fn configure(
&mut self,
ef_search: Option<u32>,
ef_construction: Option<u32>,
collection: Option<String>,
) -> Result<String, Status>
pub async fn configure( &mut self, ef_search: Option<u32>, ef_construction: Option<u32>, collection: Option<String>, ) -> Result<String, Status>
Sourcepub async fn get_digest(
&mut self,
collection: Option<String>,
) -> Result<DigestResponse, Status>
pub async fn get_digest( &mut self, collection: Option<String>, ) -> Result<DigestResponse, Status>
Sourcepub async fn sync_handshake(
&mut self,
collection: String,
client_buckets: Vec<u64>,
client_logical_clock: u64,
client_count: u64,
) -> Result<SyncHandshakeResponse, Status>
pub async fn sync_handshake( &mut self, collection: String, client_buckets: Vec<u64>, client_logical_clock: u64, client_count: u64, ) -> Result<SyncHandshakeResponse, Status>
Sourcepub async fn sync_pull(
&mut self,
collection: String,
bucket_indices: Vec<u32>,
) -> Result<Streaming<SyncVectorData>, Status>
pub async fn sync_pull( &mut self, collection: String, bucket_indices: Vec<u32>, ) -> Result<Streaming<SyncVectorData>, Status>
Pulls differing subset of vectors from server bucket indices.
§Errors
Returns error if stream initialization fails.
Sourcepub async fn sync_push(
&mut self,
stream: impl IntoStreamingRequest<Message = SyncVectorData>,
) -> Result<SyncPushResponse, Status>
pub async fn sync_push( &mut self, stream: impl IntoStreamingRequest<Message = SyncVectorData>, ) -> Result<SyncPushResponse, Status>
Sourcepub async fn search_fuzzy(
&mut self,
query: &FuzzyQuery,
top_k: u32,
collection: Option<String>,
) -> Result<Vec<(u32, f32)>, Status>
pub async fn search_fuzzy( &mut self, query: &FuzzyQuery, top_k: u32, collection: Option<String>, ) -> Result<Vec<(u32, f32)>, Status>
Evaluates a fuzzy logic search query locally by issuing batch search RPCs and scoring candidates with TNorms/TConorms.
§Errors
Returns error if the batch search fails.
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request