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-07 Section 3.5: “The Transport Session can be terminated at any point.” Section 6.2.1 obliges an endpoint to do so during the Setup exchange itself: “If the server does not support any of the versions offered by the client, or the client receives a server version that it did not offer, the corresponding peer MUST close the session.” That failure is reachable only from SetupExchange, so a session that cannot close there cannot record the one outcome the draft requires of it.
Connecting is still refused: no transport session has been established, so there is nothing to terminate.