pub struct RpcClient { /* private fields */ }Expand description
One connection to a Vectorizer RPC server.
Implementations§
Source§impl RpcClient
impl RpcClient
Sourcepub async fn connect_url(url: &str) -> Result<Self>
pub async fn connect_url(url: &str) -> Result<Self>
Convenience: parse a vectorizer://host[:port] URL and dial.
Accepts every form documented at
crate::rpc::endpoint::parse_endpoint:
vectorizer://host:port→ RPC on the given port.vectorizer://host→ RPC on the default port 15503.host:port(no scheme) → RPC.http(s)://...→ returnsRpcClientError::Serverwith a clear message asking the caller to use the HTTP client instead. The SDK ships thehttpCargo feature for that path; anhttp://URL is not a transport an RPC client can speak.
Sourcepub async fn connect(addr: impl ToSocketAddrs) -> Result<Self>
pub async fn connect(addr: impl ToSocketAddrs) -> Result<Self>
Open a TCP connection to addr (which must be host:port)
and start the background reader task. Does NOT send HELLO —
callers MUST call Self::hello before any data-plane
command, or the server will reject it.
Sourcepub async fn hello(&self, payload: HelloPayload) -> Result<HelloResponse>
pub async fn hello(&self, payload: HelloPayload) -> Result<HelloResponse>
Issue the HELLO handshake. Must be the first call on a fresh
connection. Returns the server’s capability list and auth flags.
Sourcepub async fn ping(&self) -> Result<String>
pub async fn ping(&self) -> Result<String>
Health check. The server treats PING as auth-exempt so this
works even before HELLO; the typed wrapper still validates the
response shape.
Sourcepub async fn call(
&self,
command: impl Into<String>,
args: Vec<VectorizerValue>,
) -> Result<VectorizerValue>
pub async fn call( &self, command: impl Into<String>, args: Vec<VectorizerValue>, ) -> Result<VectorizerValue>
Generic call dispatcher. Most callers should use a typed
wrapper from crate::rpc::commands instead.
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Returns true once HELLO has succeeded on this connection.
Source§impl RpcClient
impl RpcClient
Sourcepub async fn list_collections(&self) -> Result<Vec<String>>
pub async fn list_collections(&self) -> Result<Vec<String>>
collections.list — return every collection name visible to
the authenticated principal.
Sourcepub async fn get_collection_info(&self, name: &str) -> Result<CollectionInfo>
pub async fn get_collection_info(&self, name: &str) -> Result<CollectionInfo>
collections.get_info — return metadata for one collection.
Sourcepub async fn get_vector(
&self,
collection: &str,
vector_id: &str,
) -> Result<VectorizerValue>
pub async fn get_vector( &self, collection: &str, vector_id: &str, ) -> Result<VectorizerValue>
vectors.get — fetch one vector by id. Returns the raw
VectorizerValue::Map so callers can read whichever fields
they care about (id, data, payload, document_id).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RpcClient
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl UnsafeUnpin for RpcClient
impl !UnwindSafe for RpcClient
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