pub struct InputStateMachine;Expand description
Validates and applies lifecycle state transitions on InputState.
Implementations§
Source§impl InputStateMachine
impl InputStateMachine
Sourcepub fn is_valid_transition(
from: InputLifecycleState,
to: InputLifecycleState,
) -> bool
pub fn is_valid_transition( from: InputLifecycleState, to: InputLifecycleState, ) -> bool
Check if a transition from from to to is valid per §15.
Sourcepub fn transition(
state: &mut InputState,
to: InputLifecycleState,
reason: Option<String>,
) -> Result<(), InputStateMachineError>
pub fn transition( state: &mut InputState, to: InputLifecycleState, reason: Option<String>, ) -> Result<(), InputStateMachineError>
Transition the input state, recording history.
Returns an error if the transition is invalid or the state is terminal.
Sourcepub fn set_terminal_outcome(
state: &mut InputState,
outcome: InputTerminalOutcome,
)
pub fn set_terminal_outcome( state: &mut InputState, outcome: InputTerminalOutcome, )
Set the terminal outcome explicitly (for Superseded/Coalesced which need extra data).
Sourcepub fn abandon(
state: &mut InputState,
reason: InputAbandonReason,
) -> Result<(), InputStateMachineError>
pub fn abandon( state: &mut InputState, reason: InputAbandonReason, ) -> Result<(), InputStateMachineError>
Transition to Abandoned with a specific reason.
Auto Trait Implementations§
impl Freeze for InputStateMachine
impl RefUnwindSafe for InputStateMachine
impl Send for InputStateMachine
impl Sync for InputStateMachine
impl Unpin for InputStateMachine
impl UnsafeUnpin for InputStateMachine
impl UnwindSafe for InputStateMachine
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