pub struct RuntimeFsm { /* private fields */ }Expand description
Executable runtime mirror of the generated typestate API.
Implementations§
Source§impl RuntimeFsm
Runtime state-machine construction, inspection, and advancement.
impl RuntimeFsm
Runtime state-machine construction, inspection, and advancement.
Sourcepub const fn state(&self) -> RuntimeState
pub const fn state(&self) -> RuntimeState
Returns the current runtime phase.
Sourcepub const fn choice(&self) -> ChoiceKind
pub const fn choice(&self) -> ChoiceKind
Returns who selects transitions in the current phase.
Sourcepub const fn dual_choice(&self) -> ChoiceKind
pub const fn dual_choice(&self) -> ChoiceKind
Returns the current phase’s choice as seen by the peer.
Sourcepub fn event_choice(&self, event: Event) -> Option<ChoiceKind>
pub fn event_choice(&self, event: Event) -> Option<ChoiceKind>
Returns the direction of one legal event from the current state.
Sourcepub fn dual_event_choice(&self, event: Event) -> Option<ChoiceKind>
pub fn dual_event_choice(&self, event: Event) -> Option<ChoiceKind>
Returns the direction of one legal event for the dual role.
Sourcepub fn step(&mut self, event: Event) -> Result<(), TransitionError>
pub fn step(&mut self, event: Event) -> Result<(), TransitionError>
Advances the FSM with event without changing it on error.
Sourcepub fn step_projected<Message>(
&mut self,
message: &Message,
project: impl FnOnce(RuntimeState, &Message) -> Option<Event>,
) -> Result<Event, ProjectionError>
pub fn step_projected<Message>( &mut self, message: &Message, project: impl FnOnce(RuntimeState, &Message) -> Option<Event>, ) -> Result<Event, ProjectionError>
Projects a wire message using the current state, then advances.
The projector is state-aware because one wire message can denote different protocol events in nested or mixed sessions.
Trait Implementations§
Source§impl Clone for RuntimeFsm
impl Clone for RuntimeFsm
Source§fn clone(&self) -> RuntimeFsm
fn clone(&self) -> RuntimeFsm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RuntimeFsm
Source§impl Debug for RuntimeFsm
impl Debug for RuntimeFsm
Source§impl Default for RuntimeFsm
impl Default for RuntimeFsm
impl Eq for RuntimeFsm
Source§impl PartialEq for RuntimeFsm
impl PartialEq for RuntimeFsm
impl StructuralPartialEq for RuntimeFsm
Auto Trait Implementations§
impl Freeze for RuntimeFsm
impl RefUnwindSafe for RuntimeFsm
impl Send for RuntimeFsm
impl Sync for RuntimeFsm
impl Unpin for RuntimeFsm
impl UnsafeUnpin for RuntimeFsm
impl UnwindSafe for RuntimeFsm
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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