pub struct ClusterClient { /* private fields */ }Expand description
Cluster-aware client with automatic node discovery
Discovers cluster nodes and maintains connections for high availability. Note: Write routing to the leader is handled server-side via transparent forwarding - clients can send writes to ANY node.
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>
Create a new cluster client with seed nodes
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>
Create a new cluster client with TLS
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