#[non_exhaustive]pub enum DisconnectReason {
IoServerDisconnect,
IoClientDisconnect,
PingTimeout,
TransportClose,
TransportError,
ParseError,
ConnectRejected,
ReconnectFailed,
Dropped,
}Expand description
Why a connection ended. The first six are socket.io-client’s disconnect reasons.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
IoServerDisconnect
The server disconnected the socket (socket.disconnect() on the server). No reconnect
unless reconnect_on_disconnect is on.
IoClientDisconnect
Client::disconnect was called.
PingTimeout
No ping from the server within pingInterval + pingTimeout.
TransportClose
The connection was closed (the server went away, the network dropped it).
TransportError
The transport failed (HTTP error, websocket error, a write that failed).
ParseError
The server sent a packet that does not decode.
ConnectRejected
The server refused the namespace (CONNECT_ERROR). Final.
ReconnectFailed
The reconnect attempts ran out (reconnection_attempts). Final.
Dropped
Every Client handle was dropped. Final.
Implementations§
Trait Implementations§
Source§impl Clone for DisconnectReason
impl Clone for DisconnectReason
impl Copy for DisconnectReason
Source§impl Debug for DisconnectReason
impl Debug for DisconnectReason
Source§impl Display for DisconnectReason
impl Display for DisconnectReason
impl Eq for DisconnectReason
Source§impl Hash for DisconnectReason
impl Hash for DisconnectReason
Source§impl PartialEq for DisconnectReason
impl PartialEq for DisconnectReason
impl StructuralPartialEq for DisconnectReason
Auto Trait Implementations§
impl Forget for DisconnectReason
impl Freeze for DisconnectReason
impl RefUnwindSafe for DisconnectReason
impl Send for DisconnectReason
impl Sync for DisconnectReason
impl Unpin for DisconnectReason
impl UnsafeUnpin for DisconnectReason
impl UnwindSafe for DisconnectReason
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