pub struct ConnectConfig {
pub endpoints: Vec<String>,
pub db: String,
pub token: Option<String>,
pub tls: Option<ClientTlsConfig>,
pub reconnect_min: Duration,
pub reconnect_max: Duration,
pub failover_timeout: Duration,
pub heartbeat_timeout: Option<Duration>,
}Expand description
Connection configuration.
Fields§
§endpoints: Vec<String>Candidate transactor endpoints in preference order, e.g.
http://127.0.0.1:4334. With an HA pair, list the active and every
standby: the connection sticks to whichever endpoint accepts its
subscription and rotates through the rest on failure, so failover
needs no reconfiguration.
db: StringDatabase name.
token: Option<String>Optional bearer token.
tls: Option<ClientTlsConfig>Optional TLS configuration (https endpoints).
reconnect_min: DurationMinimum reconnect backoff.
reconnect_max: DurationMaximum reconnect backoff.
failover_timeout: DurationHow long Connection::transact keeps retrying failures that are
provably pre-commit (standby/deposed rejections, connection
establishment) while a failover completes. Ambiguous failures — a
connection that died with the request in flight — are surfaced
immediately; the transaction may or may not have committed.
heartbeat_timeout: Option<Duration>Heartbeat-silence timeout override. None derives three times the
server-advertised heartbeat interval; streams silent for longer are
dropped and the connection fails over.
Implementations§
Trait Implementations§
Source§impl Clone for ConnectConfig
impl Clone for ConnectConfig
Source§fn clone(&self) -> ConnectConfig
fn clone(&self) -> ConnectConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectConfig
impl RefUnwindSafe for ConnectConfig
impl Send for ConnectConfig
impl Sync for ConnectConfig
impl Unpin for ConnectConfig
impl UnsafeUnpin for ConnectConfig
impl UnwindSafe for ConnectConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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