pub struct TrackStatusStateMachine {
state: TrackStatusState,
}Expand description
Pure state machine for a MoQT track status request (draft-10). Transitions: Idle → Pending → Done.
Fields§
§state: TrackStatusStateImplementations§
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_request_sent(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_request_sent(&mut self) -> Result<(), TrackStatusError>
Idle → Pending (TRACK_STATUS_REQUEST sent).
Sourcepub fn on_track_status(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status(&mut self) -> Result<(), TrackStatusError>
Pending → Done (TRACK_STATUS received).
Source§impl TrackStatusStateMachine
The same transitions, named for the end the request arrives at.
impl TrackStatusStateMachine
The same transitions, named for the end the request arrives at.
A track status the peer asks for passes through the states in the same order as one this endpoint asks for, with both messages going the other way: the request arrives instead of leaving, and the answer leaves instead of arriving. Sharing the transitions and not the names is what lets a refusal say which event was refused rather than the mirror image of it.
Section 8.16 leaves the answering end no discretion about whether to
answer: “A TRACK_STATUS message MUST be sent in response to each
TRACK_STATUS_REQUEST.” What it bounds is how many, and that is what Done
is for: a second answer finds a request that has already left Pending.
Sourcepub fn on_track_status_request_received(
&mut self,
) -> Result<(), TrackStatusError>
pub fn on_track_status_request_received( &mut self, ) -> Result<(), TrackStatusError>
Idle → Pending (TRACK_STATUS_REQUEST received).
Sourcepub fn on_track_status_sent(&mut self) -> Result<(), TrackStatusError>
pub fn on_track_status_sent(&mut self) -> Result<(), TrackStatusError>
Pending → Done (TRACK_STATUS sent).