#[non_exhaustive]pub struct UpgradeReject {
pub role_byte: u8,
pub role_name: String,
pub zone: Option<String>,
}Expand description
Upgrade-time topology rejection carried alongside an crate::Error.
Populated when the server rejects the WebSocket upgrade with HTTP 421
plus an X-QuestDB-Role header (per failover.md §5), or when a
SERVER_INFO frame advertises a role that does not match the configured
target= filter. The host-health tracker (when present) reads this to
decide whether the host is in TransientReject (PRIMARY_CATCHUP) or
TopologyReject (every other role byte) and to update zone tier from
the optional X-QuestDB-Zone / SERVER_INFO.zone_id.
role_byte is the raw SERVER_INFO.role byte from wire-egress.md §11.8
(0x00=STANDALONE, 0x01=PRIMARY, 0x02=REPLICA, 0x03=PRIMARY_CATCHUP);
unrecognised values are carried through verbatim so a future role
addition is observable to operators even on an older client build.
role_name is the ASCII token actually seen on the wire (uppercased for
the four named roles; the literal header value when the byte is unknown);
it is kept so diagnostics surface what the server said, not what the
client decided to call it. zone is Some only when the server
advertised one (via SERVER_INFO.zone_id gated on CAP_ZONE, or the
X-QuestDB-Zone upgrade header).
#[non_exhaustive] so future fields (a structured replay-hint, a
retry-after value, a cluster-ID tag — anything the failover.md spec
might extend 421 reject headers with) can be added without
breaking downstream struct-literal construction or exhaustive
destructuring. Use UpgradeReject::new to construct from
external code.
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.role_byte: u8§role_name: String§zone: Option<String>Implementations§
Source§impl UpgradeReject
impl UpgradeReject
pub fn new( role_byte: u8, role_name: impl Into<String>, zone: Option<String>, ) -> Self
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
True when the server-advertised role is PRIMARY_CATCHUP —
a transient state (promotion in flight) that the tracker should
classify as recoverable. Every other role byte is topological
(won’t recover without operator intervention or topology change).
Per failover.md §6: any non-empty X-QuestDB-Role value other
than PRIMARY_CATCHUP is conservatively treated as topological,
including unrecognised tokens.
Trait Implementations§
Source§impl Clone for UpgradeReject
impl Clone for UpgradeReject
Source§fn clone(&self) -> UpgradeReject
fn clone(&self) -> UpgradeReject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UpgradeReject
impl Debug for UpgradeReject
impl Eq for UpgradeReject
Source§impl PartialEq for UpgradeReject
impl PartialEq for UpgradeReject
impl StructuralPartialEq for UpgradeReject
Auto Trait Implementations§
impl Freeze for UpgradeReject
impl RefUnwindSafe for UpgradeReject
impl Send for UpgradeReject
impl Sync for UpgradeReject
impl Unpin for UpgradeReject
impl UnsafeUnpin for UpgradeReject
impl UnwindSafe for UpgradeReject
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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