#[non_exhaustive]pub enum ConnectionState {
Connecting,
Connected(ConnectionInfo),
WaitingForNetwork,
Reconnecting {
cycle_id: CycleId,
next_attempt_at: Option<Instant>,
},
Closing,
Closed(Result<SessionEnd>),
}Expand description
Current status of a connection session, including initial connection, reconnection, network waiting, and shutdown. This enum is non-exhaustive; callers must handle future states.
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.
Connecting
Preparing for or performing the first connection attempt.
Connected(ConnectionInfo)
A usable WebSocket connection was successfully established.
Tuple Fields
§
0: ConnectionInfoThe identity, establishment time, and credential version of the currently established connection.
WaitingForNetwork
Network conditions currently prevent a connection, so the session is waiting for reachability to recover.
Reconnecting
Waiting for or performing a new connection attempt.
Fields
Closing
The session is closing and completing its shutdown work.
Closed(Result<SessionEnd>)
The session has ended and no more connection attempts are initiated.
Tuple Fields
§
0: Result<SessionEnd>Final session-end details, or the error that caused termination.
Trait Implementations§
Source§impl Clone for ConnectionState
impl Clone for ConnectionState
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionState
impl !UnwindSafe for ConnectionState
impl Forget for ConnectionState
impl Freeze for ConnectionState
impl Move for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl UnsafeUnpin for ConnectionState
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