#[non_exhaustive]pub enum AnySession<P: Protocol> {
Configured(Session<P, Configured>),
Authenticated(Session<DPlus, Authenticated>),
Connecting(Session<P, Connecting>),
Connected(Session<P, Connected>),
Disconnecting(Session<P, Disconnecting>),
Closed(Session<P, Closed>),
}Expand description
Storage-friendly enum wrapping a Session<P, S> in any state.
Use this when you need to keep a session in a struct field that
might be in any state (e.g., a long-lived REPL state). For
individual transitions, use the typed Session<P, S> directly.
Note: AnySession<P> is generic over the protocol. The
Self::Authenticated variant is hard-coded to DPlus because
the typestate guarantees only DPlus reaches that state. This is
a known wart of full typestate that we accept.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Configured(Session<P, Configured>)
Configured state — session built but no I/O has happened.
Authenticated(Session<DPlus, Authenticated>)
Authenticated state — DPlus only, TCP auth completed.
Connecting(Session<P, Connecting>)
Connecting state — LINK packet sent, waiting for ACK.
Connected(Session<P, Connected>)
Connected state — operational.
Disconnecting(Session<P, Disconnecting>)
Disconnecting state — UNLINK sent, waiting for ACK.
Closed(Session<P, Closed>)
Closed state — terminal.
Implementations§
Source§impl<P: Protocol> AnySession<P>
impl<P: Protocol> AnySession<P>
Sourcepub const fn state_kind(&self) -> ClientStateKind
pub const fn state_kind(&self) -> ClientStateKind
Runtime state discriminator for whichever state the session is in.