pub struct ClusterClient { /* private fields */ }Expand description
Cluster-aware client with automatic node discovery. It discovers nodes and maintains healthy connections for read availability per Architecture §21.
Implementations§
Source§impl ClusterClient
impl ClusterClient
Sourcepub async fn connect(seed_addrs: &[&str]) -> Result<Self, ClientError>
pub async fn connect(seed_addrs: &[&str]) -> Result<Self, ClientError>
Creates a cluster client using the provided seed nodes, aligning with Architecture §21’s discovery process.
§Arguments
seed_addrs- List of seed endpoints ("host:port") used to fetch the cluster topology.
§Returns
Result<Self>- Initialized client after a successful discovery round-trip.
§Errors
ClientError::ProtocolErrorwhen no seed nodes resolve.- Propagates underlying connect/discovery errors when all nodes fail.
Sourcepub async fn connect_tls(
seed_addrs: &[&str],
tls_config: TlsClientConfig,
) -> Result<Self, ClientError>
pub async fn connect_tls( seed_addrs: &[&str], tls_config: TlsClientConfig, ) -> Result<Self, ClientError>
Creates a TLS-enabled cluster client using the provided seed nodes so we can satisfy Architecture §14’s transport security guidance.
§Arguments
seed_addrs- List of seed endpoints for discovery.tls_config- Certificates and trust roots forwarded toLanceClient.
§Returns
Result<Self>- Initialized TLS client once discovery succeeds.
§Errors
Mirrors ClusterClient::connect, plus TLS handshake failures.
Sourcepub fn with_discovery_interval(self, interval: Duration) -> Self
pub fn with_discovery_interval(self, interval: Duration) -> Self
Set the discovery refresh interval
Sourcepub async fn client(&mut self) -> Result<&mut LanceClient, ClientError>
pub async fn client(&mut self) -> Result<&mut LanceClient, ClientError>
Get a client connection, refreshing discovery if needed
Sourcepub fn primary(&self) -> Option<SocketAddr>
pub fn primary(&self) -> Option<SocketAddr>
Get the current primary node address
Sourcepub fn nodes(&self) -> &[SocketAddr]
pub fn nodes(&self) -> &[SocketAddr]
Get all known cluster nodes
Sourcepub fn tls_config(&self) -> Option<&TlsClientConfig>
pub fn tls_config(&self) -> Option<&TlsClientConfig>
Get the TLS configuration if set
Sourcepub fn is_tls_enabled(&self) -> bool
pub fn is_tls_enabled(&self) -> bool
Check if TLS is enabled
Sourcepub async fn refresh(&mut self) -> Result<(), ClientError>
pub async fn refresh(&mut self) -> Result<(), ClientError>
Force a cluster discovery refresh
Auto Trait Implementations§
impl !Freeze for ClusterClient
impl !RefUnwindSafe for ClusterClient
impl Send for ClusterClient
impl Sync for ClusterClient
impl Unpin for ClusterClient
impl UnsafeUnpin for ClusterClient
impl !UnwindSafe for ClusterClient
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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Wrap the input message
T in a tonic::Request