#[non_exhaustive]pub enum State {
#[non_exhaustive] Connecting {
attempt: u32,
},
#[non_exhaustive] Connected {
sid: String,
recovered: bool,
},
#[non_exhaustive] Disconnected {
reason: String,
error: Option<ErrorPayload>,
},
#[non_exhaustive] Reconnecting {
attempt: u32,
delay: u64,
error: Option<ErrorPayload>,
},
#[non_exhaustive] Closed {
reason: String,
error: Option<ErrorPayload>,
},
}Expand description
ConnectionState for JS: { status, ... } with socket.io-client’s reason strings and
delays in milliseconds.
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.
#[non_exhaustive]Connecting
A connect attempt runs (attempt 0 is the first connect).
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Connected
The namespace is joined.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Disconnected
The connection was lost; a reconnect follows.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
error: Option<ErrorPayload>The error behind it (e.g. WebsocketClosed with the close code).
#[non_exhaustive]Reconnecting
Waiting delay ms before reconnect attempt attempt.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
error: Option<ErrorPayload>Why the previous attempt failed.
#[non_exhaustive]Closed
Final.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
error: Option<ErrorPayload>The error behind it.
Trait Implementations§
Source§impl From<&ConnectionState> for State
impl From<&ConnectionState> for State
Source§fn from(state: &ConnectionState) -> Self
fn from(state: &ConnectionState) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Forget for State
impl Freeze for State
impl Move for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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