pub enum ResponseClass {
Completed,
Running,
StatementTimeout,
StatementFailed,
RateLimited,
Other(u16),
}Expand description
The classification of a SQL API HTTP response by status code.
Variants§
Completed
200: completed; body is a crate::response::ResultSet.
Running
202: still running / accepted async; body is a
crate::response::QueryStatus. Poll again.
StatementTimeout
408: statement exceeded STATEMENT_TIMEOUT_IN_SECONDS; body is a
crate::response::QueryFailureStatus. A typed timeout, not a SQL error.
StatementFailed
422: SQL compilation/execution failure; body is a
crate::response::QueryFailureStatus.
RateLimited
429: server overloaded / rate limited. Back off and retry; Retry-After
is not guaranteed. Never a query-status code.
Other(u16)
Any other status (e.g. 5xx transport error), carried verbatim.
Implementations§
Source§impl ResponseClass
impl ResponseClass
Sourcepub const fn from_status(code: u16) -> Self
pub const fn from_status(code: u16) -> Self
Classify a raw HTTP status code.
Sourcepub const fn should_poll(self) -> bool
pub const fn should_poll(self) -> bool
Whether this state means “poll the handle again” (202 only).
Sourcepub const fn is_retryable(self) -> bool
pub const fn is_retryable(self) -> bool
Whether this state is transient and should be retried under backoff
(429; 5xx transport). 408/422 are terminal failures, not retries.
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Whether this state terminates the statement lifecycle (success or a typed
failure). Running/RateLimited are non-terminal.
Sourcepub const fn terminal_outcome(self) -> Option<OutcomeKind>
pub const fn terminal_outcome(self) -> Option<OutcomeKind>
The envelope OutcomeKind for a terminal state, or None while the
statement is still in flight (Running/RateLimited/non-5xx Other).
Trait Implementations§
Source§impl Clone for ResponseClass
impl Clone for ResponseClass
impl Copy for ResponseClass
Source§impl Debug for ResponseClass
impl Debug for ResponseClass
impl Eq for ResponseClass
Source§impl PartialEq for ResponseClass
impl PartialEq for ResponseClass
impl StructuralPartialEq for ResponseClass
Auto Trait Implementations§
impl Freeze for ResponseClass
impl RefUnwindSafe for ResponseClass
impl Send for ResponseClass
impl Sync for ResponseClass
impl Unpin for ResponseClass
impl UnsafeUnpin for ResponseClass
impl UnwindSafe for ResponseClass
Blanket Implementations§
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.