pub enum WsErrorKind {
Transient,
Permanent,
}Expand description
WebSocket error classification.
This enum categorizes WebSocket errors into two types:
Transient: Temporary errors that may recover with retry (network issues, server unavailable)Permanent: Errors that should not be retried (authentication failures, protocol errors)
§Example
use ccxt_core::ws_client::WsErrorKind;
let kind = WsErrorKind::Transient;
assert!(kind.is_transient());
let kind = WsErrorKind::Permanent;
assert!(!kind.is_transient());Variants§
Transient
Transient errors that may recover with retry.
Examples:
- Network timeouts
- Connection resets
- Server unavailable (5xx errors)
- Temporary connection failures
Permanent
Permanent errors that should not be retried.
Examples:
- Authentication failures (401/403)
- Protocol errors
- Invalid credentials
- Invalid parameters
Implementations§
Source§impl WsErrorKind
impl WsErrorKind
Sourcepub fn is_transient(self) -> bool
pub fn is_transient(self) -> bool
Returns true if this is a transient error that may recover with retry.
§Example
use ccxt_core::ws_client::WsErrorKind;
assert!(WsErrorKind::Transient.is_transient());
assert!(!WsErrorKind::Permanent.is_transient());Sourcepub fn is_permanent(self) -> bool
pub fn is_permanent(self) -> bool
Returns true if this is a permanent error that should not be retried.
§Example
use ccxt_core::ws_client::WsErrorKind;
assert!(WsErrorKind::Permanent.is_permanent());
assert!(!WsErrorKind::Transient.is_permanent());Trait Implementations§
Source§impl Clone for WsErrorKind
impl Clone for WsErrorKind
Source§fn clone(&self) -> WsErrorKind
fn clone(&self) -> WsErrorKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WsErrorKind
impl Debug for WsErrorKind
Source§impl Display for WsErrorKind
impl Display for WsErrorKind
Source§impl Hash for WsErrorKind
impl Hash for WsErrorKind
Source§impl PartialEq for WsErrorKind
impl PartialEq for WsErrorKind
impl Copy for WsErrorKind
impl Eq for WsErrorKind
impl StructuralPartialEq for WsErrorKind
Auto Trait Implementations§
impl Freeze for WsErrorKind
impl RefUnwindSafe for WsErrorKind
impl Send for WsErrorKind
impl Sync for WsErrorKind
impl Unpin for WsErrorKind
impl UnwindSafe for WsErrorKind
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
Mutably borrows from an owned value. Read more
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<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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.