pub enum ReconnectTError {
ConnectionError {
message: String,
context: ErrorContext,
},
ProtocolError {
message: String,
context: ErrorContext,
},
ConfigurationError {
message: String,
context: ErrorContext,
},
TimeoutError {
timeout_type: String,
duration: Duration,
context: ErrorContext,
},
AuthenticationError {
message: String,
context: ErrorContext,
},
ResourceExhausted {
resource_type: String,
context: ErrorContext,
},
ReceiveTimeout(Duration),
HandshakeFailed,
SenderNotConnected,
TokioTungsteniteError(Error),
}Expand description
Simplified error types for WebSocket reconnection operations
Variants§
ConnectionError
Connection-related errors
ProtocolError
Protocol-related errors
ConfigurationError
Configuration errors
TimeoutError
Timeout errors with specific timeout information
AuthenticationError
Authentication/authorization errors
ResourceExhausted
Resource exhaustion errors
ReceiveTimeout(Duration)
Legacy errors for backward compatibility
HandshakeFailed
SenderNotConnected
TokioTungsteniteError(Error)
Implementations§
Source§impl ReconnectTError
impl ReconnectTError
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get the severity level of the error - simplified logic
Sourcepub fn context(&self) -> Option<&ErrorContext>
pub fn context(&self) -> Option<&ErrorContext>
Get the error context if available
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable based on its severity
Sourcepub fn requires_connection_reset(&self) -> bool
pub fn requires_connection_reset(&self) -> bool
Check if this error requires a connection reset
Sourcepub fn recommended_retry_delay(&self) -> Option<Duration>
pub fn recommended_retry_delay(&self) -> Option<Duration>
Get the recommended retry delay based on error type and context
Source§impl ReconnectTError
impl ReconnectTError
pub fn connection_failed<S: Into<String>>(message: S) -> Self
pub fn protocol_error<S: Into<String>>(message: S) -> Self
pub fn timeout_error<S: Into<String>>( timeout_type: S, duration: Duration, ) -> Self
pub fn auth_error<S: Into<String>>(message: S) -> Self
pub fn config_error<S: Into<String>>(message: S) -> Self
pub fn resource_exhausted<S: Into<String>>(resource_type: S) -> Self
Source§impl ReconnectTError
impl ReconnectTError
Sourcepub fn receive_timeout(duration: Duration) -> Self
pub fn receive_timeout(duration: Duration) -> Self
Create a legacy receive timeout error
Sourcepub fn handshake_failed() -> Self
pub fn handshake_failed() -> Self
Create a legacy handshake failed error
Sourcepub fn sender_not_connected() -> Self
pub fn sender_not_connected() -> Self
Create a legacy sender not connected error
Trait Implementations§
Source§impl Clone for ReconnectTError
impl Clone for ReconnectTError
Source§impl Debug for ReconnectTError
impl Debug for ReconnectTError
Source§impl Display for ReconnectTError
impl Display for ReconnectTError
Source§impl Error for ReconnectTError
impl Error for ReconnectTError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl !Freeze for ReconnectTError
impl !RefUnwindSafe for ReconnectTError
impl Send for ReconnectTError
impl Sync for ReconnectTError
impl Unpin for ReconnectTError
impl !UnwindSafe for ReconnectTError
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