Skip to main content

TrackStatusStateMachine

Struct TrackStatusStateMachine 

Source
pub struct TrackStatusStateMachine {
    state: TrackStatusState,
}
Expand description

Pure state machine for a MoQT track status request. Transitions: Idle -> Pending -> Done.

Fields§

§state: TrackStatusState

Implementations§

Source§

impl TrackStatusStateMachine

Source

pub fn new() -> Self

Creates a new state machine in the TrackStatusState::Idle state.

Source

pub fn state(&self) -> TrackStatusState

Returns the current state of the track status request.

Source

pub fn on_track_status_sent(&mut self) -> Result<(), TrackStatusError>

Idle -> Pending (TRACK_STATUS sent).

Source

pub fn on_track_status_ok(&mut self) -> Result<(), TrackStatusError>

Pending -> Done (REQUEST_OK received).

Source

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.

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.

Source

pub fn on_track_status_received(&mut self) -> Result<(), TrackStatusError>

Idle -> Pending (TRACK_STATUS received).

Source

pub fn on_track_status_ok_sent(&mut self) -> Result<(), TrackStatusError>

Pending -> Done (REQUEST_OK sent).

Source

pub fn on_track_status_error_sent(&mut self) -> Result<(), TrackStatusError>

Pending -> Done (REQUEST_ERROR sent).

Trait Implementations§

Source§

impl Default for TrackStatusStateMachine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more