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 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).
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 every message 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 9.19 says what the arriving request is: the receiver “treats it identically as if it had received a SUBSCRIBE message, except it does not create downstream subscription state or send any Objects”. Identical treatment and no subscription state is why the request gets a machine of this kind rather than a subscription’s, and why what it opens is a record of its own rather than an entry among the subscriptions the peer holds.
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).
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 sent).
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 sent).