#[non_exhaustive]pub enum ErrorKind {
Network,
Protocol,
Auth,
RateLimit,
Client,
}Expand description
Coarse-grained classification of the source of a MarketDataError.
Returned by MarketDataError::source_kind so downstream code can
branch on the category of failure (network glitch vs SDK / protocol
bug vs auth vs rate-limit vs caller-side validation) without
pattern-matching every variant or string-matching the embedded msg.
#[non_exhaustive] so future variants are non-breaking.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network
Transport-level transient failure: connection reset, timeout, heartbeat gap, server outage (5xx). Generally safe to retry with backoff.
Protocol
Protocol-level violation or unclassified WebSocket failure. Indicates an SDK / version mismatch or a server-side bug; retry is unlikely to help.
0.5.1 maps every MarketDataError::WebSocketError to this
kind because the variant is currently string-only. 0.6.0 refines
the mapping when WebSocketErrorKind lands — IO failures will move
to ErrorKind::Network and TLS failures to ErrorKind::Auth.
Auth
Authentication / authorization failure: bad credentials, 401/403, expired token, TLS cert failure. Human intervention required.
RateLimit
Server is rejecting requests because the caller is exceeding its
rate budget (HTTP 429). Distinct from ErrorKind::Network —
the correct response is to reduce request volume, not to assume
the upstream is degraded. Adding parallel retries makes this
strictly worse.
Client
Caller-side problem: invalid input, configuration error, client already closed, serialization failure, non-auth/non-throttle 4xx. The SDK can’t recover from the caller’s request without changes from the caller’s side.
Trait Implementations§
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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<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.