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-23 Section 6.6: “The Transport Session can be terminated at any point.”
SetupExchange is accepted: a setup exchange can end for a PATH from a server, a malformed SETUP, or a peer that goes away, and a session that could not close in SetupExchange could record none of them.
Connecting is still refused: no transport session has been established, so there is nothing to terminate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionStateMachine
impl RefUnwindSafe for SessionStateMachine
impl Send for SessionStateMachine
impl Sync for SessionStateMachine
impl Unpin for SessionStateMachine
impl UnsafeUnpin for SessionStateMachine
impl UnwindSafe for SessionStateMachine
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