pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub async fn connect(endpoints: Vec<String>) -> Result<Self, ClientError>
Sourcepub fn cached_leader(&self) -> Option<String>
pub fn cached_leader(&self) -> Option<String>
The endpoint the client currently believes is the leader, or None
if no leader has been observed yet or the cached entry has aged past
the configured leader_ttl.
Read-only diagnostic surface for ops dashboards and integration tests
asserting that a client has converged to the expected leader. It
reflects the cache as last updated by a completed RPC — it neither
triggers nor waits on any network round-trip, and the TTL check is
lazy (an expired entry reads as None).
pub async fn get_ts(&self) -> Result<Timestamp, ClientError>
pub async fn get_ts_batch( &self, count: u32, ) -> Result<Vec<Timestamp>, ClientError>
Sourcepub async fn get_current_max_safe(&self) -> Result<MaxSafe, ClientError>
pub async fn get_current_max_safe(&self) -> Result<MaxSafe, ClientError>
Read the leader’s current safe-point in physical-millisecond units.
Targets the cached leader if known, otherwise the first configured
endpoint. Followers return MaxSafe::max_safe_physical_ms == 0 rather
than erroring, matching the proto contract; pollers needing freshness
should target the leader endpoint.
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