pub struct TrackStatusStateMachine {
state: TrackStatusState,
}Expand description
Pure state machine for a MoQT track status request. Transitions: Idle -> Pending -> Done.
Fields§
§state: TrackStatusStateImplementations§
Source§impl TrackStatusStateMachine
impl TrackStatusStateMachine
Sourcepub fn on_track_status_received(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_received(&mut self) -> Result<(), TrackStatusError>
Idle -> Pending (TRACK_STATUS received from the peer).
Sourcepub fn on_track_status_ok_sent(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_ok_sent(&mut self) -> Result<(), TrackStatusError>
Pending -> Done (REQUEST_OK written on the peer’s stream).
Sourcepub fn on_track_status_error_sent(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_error_sent(&mut self) -> Result<(), TrackStatusError>
Pending -> Done (REQUEST_ERROR written on the peer’s stream).
Source§impl TrackStatusStateMachine
impl TrackStatusStateMachine
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new state machine in the TrackStatusState::Idle state.
Sourcepub fn state(&self) -> TrackStatusState
pub fn state(&self) -> TrackStatusState
Returns the current state of the track status request.
Sourcepub fn on_track_status_sent(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_sent(&mut self) -> Result<(), TrackStatusError>
Idle -> Pending (TRACK_STATUS sent).
Sourcepub fn on_track_status_ok(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_ok(&mut self) -> Result<(), TrackStatusError>
Pending -> Done (REQUEST_OK received).
Sourcepub fn on_track_status_error(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_error(&mut self) -> Result<(), TrackStatusError>
Pending -> Done (REQUEST_ERROR received).
Sourcepub fn on_request_cancelled(&mut self) -> Result<(), TrackStatusError>
pub fn on_request_cancelled(&mut self) -> Result<(), TrackStatusError>
Pending -> Done, Done -> Done (this request’s stream was cancelled).
A track status request owns a stream like any other — “A potential subscriber sends TRACK_STATUS as the first and only message on a new bidi stream” — and it is the one request kind no draft ever gave a withdrawal message of its own. Section 3.3.1: “Once a request stream has been opened, the request MAY be cancelled by either endpoint.”
Idle is refused, on the other half of the same sentence: nothing has
been written, so there is no stream to terminate. Done stays Done —
nothing finishes a request stream’s send half on the ordinary path, so a
caller that walks away from a request that has already ended still
resets the stream, and that reset is an ordinary end rather than a
fault.