pub struct FetchStateMachine {
state: FetchState,
}Expand description
Pure state machine for a MoQT fetch request. Transitions: Idle -> Pending -> Receiving -> Done.
Fields§
§state: FetchStateImplementations§
Source§impl FetchStateMachine
impl FetchStateMachine
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new state machine in the FetchState::Idle state.
Sourcepub fn state(&self) -> FetchState
pub fn state(&self) -> FetchState
Returns the current state of the fetch request.
Sourcepub fn on_fetch_sent(&mut self) -> Result<(), FetchError>
pub fn on_fetch_sent(&mut self) -> Result<(), FetchError>
Idle -> Pending (FETCH sent).
Sourcepub fn on_fetch_ok(&mut self) -> Result<(), FetchError>
pub fn on_fetch_ok(&mut self) -> Result<(), FetchError>
Pending -> Receiving (FETCH_OK received).
Sourcepub fn on_fetch_error(&mut self) -> Result<(), FetchError>
pub fn on_fetch_error(&mut self) -> Result<(), FetchError>
Pending -> Done (REQUEST_ERROR received).
Sourcepub fn on_fetch_cancel(&mut self) -> Result<(), FetchError>
pub fn on_fetch_cancel(&mut self) -> Result<(), FetchError>
Pending|Receiving -> Done (FETCH_CANCEL sent).
Sourcepub fn on_stream_fin(&mut self) -> Result<(), FetchError>
pub fn on_stream_fin(&mut self) -> Result<(), FetchError>
Receiving -> Done (stream FIN received).
Sourcepub fn on_stream_reset(&mut self) -> Result<(), FetchError>
pub fn on_stream_reset(&mut self) -> Result<(), FetchError>
Receiving -> Done (stream RESET received).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FetchStateMachine
impl RefUnwindSafe for FetchStateMachine
impl Send for FetchStateMachine
impl Sync for FetchStateMachine
impl Unpin for FetchStateMachine
impl UnsafeUnpin for FetchStateMachine
impl UnwindSafe for FetchStateMachine
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