pub enum WsEvent {
Connecting,
Connected,
Disconnected,
Reconnecting {
attempt: u32,
delay: Duration,
error: Option<String>,
},
ReconnectSuccess,
ReconnectFailed {
attempt: u32,
error: String,
is_permanent: bool,
},
ReconnectExhausted {
total_attempts: u32,
last_error: String,
},
SubscriptionRestored,
PermanentError {
error: String,
},
Shutdown,
}Expand description
WebSocket connection event types.
Variants§
Connecting
Connection attempt started.
Connected
Connection established successfully.
Disconnected
Connection closed.
Reconnecting
Reconnection in progress.
Fields
ReconnectSuccess
Reconnection succeeded.
ReconnectFailed
Single reconnection attempt failed.
Fields
ReconnectExhausted
All reconnection attempts exhausted.
Fields
SubscriptionRestored
Subscriptions restored after reconnection.
PermanentError
Permanent error occurred (no retry).
Shutdown
Shutdown completed.
Implementations§
Source§impl WsEvent
impl WsEvent
Sourcepub fn is_connecting(&self) -> bool
pub fn is_connecting(&self) -> bool
Returns true if this is a Connecting event.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if this is a Connected event.
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Returns true if this is a Disconnected event.
Sourcepub fn is_reconnecting(&self) -> bool
pub fn is_reconnecting(&self) -> bool
Returns true if this is a Reconnecting event.
Sourcepub fn is_reconnect_success(&self) -> bool
pub fn is_reconnect_success(&self) -> bool
Returns true if this is a ReconnectSuccess event.
Sourcepub fn is_reconnect_failed(&self) -> bool
pub fn is_reconnect_failed(&self) -> bool
Returns true if this is a ReconnectFailed event.
Sourcepub fn is_reconnect_exhausted(&self) -> bool
pub fn is_reconnect_exhausted(&self) -> bool
Returns true if this is a ReconnectExhausted event.
Sourcepub fn is_subscription_restored(&self) -> bool
pub fn is_subscription_restored(&self) -> bool
Returns true if this is a SubscriptionRestored event.
Sourcepub fn is_permanent_error(&self) -> bool
pub fn is_permanent_error(&self) -> bool
Returns true if this is a PermanentError event.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Returns true if this is a Shutdown event.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true if this is a terminal event.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsEvent
impl RefUnwindSafe for WsEvent
impl Send for WsEvent
impl Sync for WsEvent
impl Unpin for WsEvent
impl UnwindSafe for WsEvent
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<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.