Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

pub async fn connect( dst: String, api_key: Option<String>, user_id: Option<String>, ) -> Result<Self, Box<dyn Error>>

Connects to the HyperspaceDB server.

§Errors

Returns error if connection fails.

Source

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.

Source

pub async fn delete_collection( &mut self, name: String, ) -> Result<String, Status>

Deletes a collection.

§Errors

Returns error if the collection does not exist cancellation.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn trigger_vacuum(&mut self) -> Result<String, Status>

Triggers memory cleanup (Vacuum).

§Errors

Returns error if the operation fails.

Source

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.

Source

pub async fn insert( &mut self, id: u32, vector: Vec<f64>, metadata: HashMap<String, String>, collection: Option<String>, ) -> Result<bool, Status>

Inserts a vector into the collection.

§Errors

Returns error if insertion fails.

Source

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.

Source

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.

Source

pub async fn vectorize( &mut self, text: String, metric: String, ) -> Result<Vec<f64>, Status>

Vectoize text using the server-side embedding engine.

§Errors

Returns error if vectorization fails.

Source

pub async fn batch_insert( &mut self, items: Vec<(u32, Vec<f64>, HashMap<String, String>)>, collection: Option<String>, durability: DurabilityLevel, ) -> Result<bool, Status>

Batch inserts multiple vectors.

§Errors

Returns error if insertion fails.

Source

pub async fn batch_insert_f32( &mut self, items: Vec<(u32, Vec<f32>, HashMap<String, String>)>, collection: Option<String>, durability: DurabilityLevel, ) -> Result<bool, Status>

Batch inserts multiple vectors from f32 input.

§Errors

Returns error if insertion fails.

Source

pub async fn search( &mut self, vector: Vec<f64>, top_k: u32, collection: Option<String>, ) -> Result<Vec<SearchResult>, Status>

Searches for nearest neighbors.

§Errors

Returns error if search fails.

Source

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.

Source

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.

Source

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.

Source

pub async fn search_batch( &mut self, vectors: Vec<Vec<f64>>, top_k: u32, collection: Option<String>, ) -> Result<Vec<Vec<SearchResult>>, Status>

Batch search for multiple vectors in a single RPC.

§Errors

Returns error if the batch search fails.

Source

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.

Source

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.

Source

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>

Advanced search with filters and hybrid query.

§Errors

Returns error if search fails.

Source

pub async fn delete( &mut self, id: u32, collection: Option<String>, ) -> Result<bool, Status>

Deletes a vector by ID.

§Errors

Returns error if deletion fails.

Source

pub async fn get_node( &mut self, id: u32, layer: u32, collection: Option<String>, ) -> Result<GraphNode, Status>

Returns a graph node with adjacency on a specific layer.

§Errors

Returns error if request fails.

Source

pub async fn get_neighbors( &mut self, id: u32, layer: u32, limit: u32, offset: u32, collection: Option<String>, ) -> Result<GetNeighborsResponse, Status>

Returns neighbors for a node with pagination.

§Errors

Returns error if request fails.

Source

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.

Source

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.

Source

pub async fn find_semantic_clusters( &mut self, req: FindSemanticClustersRequest, ) -> Result<FindSemanticClustersResponse, Status>

Finds connected components as semantic clusters.

§Errors

Returns error if request fails.

Source

pub async fn get_concept_parents( &mut self, id: u32, layer: u32, limit: u32, collection: Option<String>, ) -> Result<GetConceptParentsResponse, Status>

Returns parent-like neighbors for concept-style traversals.

§Errors

Returns error if request fails.

Source

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.

Source

pub async fn configure( &mut self, ef_search: Option<u32>, ef_construction: Option<u32>, collection: Option<String>, ) -> Result<String, Status>

Configures collection parameters.

§Errors

Returns error if configuration fails.

Source

pub async fn get_digest( &mut self, collection: Option<String>, ) -> Result<DigestResponse, Status>

Gets collection digest (hash and count).

§Errors

Returns error if retrieval fails.

Source

pub async fn sync_handshake( &mut self, collection: String, client_buckets: Vec<u64>, client_logical_clock: u64, client_count: u64, ) -> Result<SyncHandshakeResponse, Status>

Performs Delta Sync Handshake with the server.

§Errors

Returns error on network failure.

Source

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.

Source

pub async fn sync_push( &mut self, stream: impl IntoStreamingRequest<Message = SyncVectorData>, ) -> Result<SyncPushResponse, Status>

Pushes offline delta back to the server.

§Errors

Returns error if push stream initialization fails.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more