#[non_exhaustive]pub struct FailoverResetEvent {
pub failed_addr: Endpoint,
pub new_addr: Endpoint,
pub new_server_info: Option<ServerInfo>,
pub new_request_id: i64,
pub attempts: u32,
pub trigger: Error,
pub elapsed: Duration,
}Expand description
Notification delivered to the ReaderQuery::on_failover_reset
callback right before replayed batches start arriving on a new
connection. Mirrors the Java onFailoverReset(newNode) contract:
the user-side handler is responsible for discarding any rows it
had accumulated from the previous (now-dead) connection, since the
query restarts from batch_seq=0 against the new endpoint.
Marked #[non_exhaustive] so we can add fields without breaking
downstream pattern matches.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.failed_addr: EndpointEndpoint that just failed. Use failed_addr.host /
failed_addr.port directly; the Endpoint struct replaces
the older (String, u16) tuple.
The address-list index is deliberately not exposed: indices are brittle if the connect string is reordered between runs, and the endpoint host/port is stable.
new_addr: EndpointEndpoint of the new connection.
new_server_info: Option<ServerInfo>SERVER_INFO of the new endpoint (None only if the server
omitted it).
new_request_id: i64Newly-allocated request_id the cursor will receive frames for
from now on. Different from Cursor::request_id before the
failover.
attempts: u32Count of reconnect dials the current failover cycle burned
before this success. 1 means the first reconnect dial
succeeded and its replay write went through cleanly. Larger
values mean earlier dials in this cycle missed (rotating
through endpoints) before one landed. Pairs with
elapsed — both measure the same failover
event.
trigger: ErrorThe error that triggered this failover (the failure of the
previous connection). The full error — code + message — is
preserved so callers can both route on the ErrorCode (for
metrics / categorization) and log the raw message (for
diagnostics: errno text on SocketError, peer info on
TlsError, decode-site detail on ProtocolError, etc.). Use
Error::code to extract just the category.
Without this, the cause-of-death of the previous connection is
lost forever once failover succeeds — it’s not re-surfaced as
Err anywhere else in the cursor’s API.
elapsed: DurationWall-clock time spent reconnecting (sleep + dial + handshake + SERVER_INFO read). Excludes the time from the cursor’s last successful read until the failure was observed.
Trait Implementations§
Source§impl Clone for FailoverResetEvent
impl Clone for FailoverResetEvent
Source§fn clone(&self) -> FailoverResetEvent
fn clone(&self) -> FailoverResetEvent
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 FailoverResetEvent
impl RefUnwindSafe for FailoverResetEvent
impl Send for FailoverResetEvent
impl Sync for FailoverResetEvent
impl Unpin for FailoverResetEvent
impl UnsafeUnpin for FailoverResetEvent
impl UnwindSafe for FailoverResetEvent
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more