#[non_exhaustive]pub enum DisconnectReason {
Handover,
ConnectionFailed {
detail: String,
},
Stalled {
budget: Duration,
},
Refused(ServerError),
Refreshing(ServerError),
}Expand description
Why the session stopped streaming.
A disconnection is not the end: this client reconnects on its own, and
SessionEvent::Disconnected carries how long until the next attempt. It
is the end only when SessionEvent::Closed follows.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Handover
The server handed the connection over cleanly and expects the client to
reconnect. The session itself is untouched and every subscription
survives [docs/spec/02-session-lifecycle.md §4.4].
Routine: it is how TLCP rotates long-lived connections.
ConnectionFailed
The connection failed or was dropped. The session is not closed and a
recovery is attempted [docs/spec/02-session-lifecycle.md §2.2].
Stalled
The connection went silent for longer than the server promised, without ever failing.
This is the failure mode a protocol client exists to catch: a socket
that is wedged but never errors. The connection is torn down and
recovered [docs/spec/02-session-lifecycle.md §8.1].
Refused(ServerError)
The server refused the session with a code that still allows another attempt.
Refreshing(ServerError)
The server ended the session in order to refresh it, and expects a new
one to be opened immediately — Appendix A code 48
[docs/spec/05-error-codes.md §2].
Nothing is wrong, but the session that follows is a new one: expect
a Continuity::Replaced next.
Trait Implementations§
Source§impl Clone for DisconnectReason
impl Clone for DisconnectReason
Source§fn clone(&self) -> DisconnectReason
fn clone(&self) -> DisconnectReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more