pub struct SessionStateMachine {
state: SessionState,
}Expand description
Pure state machine for MoQT session lifecycle. Transitions: Connecting -> SetupExchange -> Active -> Draining -> Closed.
Fields§
§state: SessionStateImplementations§
Source§impl SessionStateMachine
impl SessionStateMachine
Sourcepub fn state(&self) -> SessionState
pub fn state(&self) -> SessionState
Returns the current session state.
Sourcepub fn on_connect(&mut self) -> Result<(), SessionError>
pub fn on_connect(&mut self) -> Result<(), SessionError>
Transition: Connecting -> SetupExchange.
Sourcepub fn on_setup_complete(&mut self) -> Result<(), SessionError>
pub fn on_setup_complete(&mut self) -> Result<(), SessionError>
Transition: SetupExchange -> Active.
Sourcepub fn on_goaway(&mut self) -> Result<(), SessionError>
pub fn on_goaway(&mut self) -> Result<(), SessionError>
Transition: Active -> Draining (GOAWAY received).
Sourcepub fn on_close(&mut self) -> Result<(), SessionError>
pub fn on_close(&mut self) -> Result<(), SessionError>
Transition: SetupExchange|Active|Draining -> Closed.
draft-16 Section 3.4: “The Transport Session can be terminated at any point.” The same section lists VERSION_NEGOTIATION_FAILED (0x15), “The client didn’t offer a version supported by the server” — a failure reachable only from SetupExchange, before any session is Active. A session that cannot close there cannot record the one outcome that code exists for.
Connecting is still refused: no transport session has been established, so there is nothing to terminate.