#[non_exhaustive]pub struct TripModel {
pub workflow: TripWorkflow,
}Expand description
The exploration model of the trip workflow.
It offers, in every state, only the commands that make sense there plus one it knows will be refused (an empty name), so every explored state also checks that a refusal changes nothing. All values are fixed constants and identifiers are derived, so the reachable state space is finite and the same on every run.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workflow: TripWorkflowThe definition transitions are applied through.
Implementations§
Trait Implementations§
impl Copy for TripModel
Source§impl WorkflowModel<TripWorkflow> for TripModel
impl WorkflowModel<TripWorkflow> for TripModel
Source§fn initial_states(&self) -> Vec<Option<TripState>>
fn initial_states(&self) -> Vec<Option<TripState>>
The states exploration starts from.
None means “the case does not
exist yet”, which is where most workflows begin — and it never means
“the case is over”, because a case’s identity outlives its content.Source§fn candidate_commands(&self, state: Option<&TripState>) -> Vec<TripCommand>
fn candidate_commands(&self, state: Option<&TripState>) -> Vec<TripCommand>
Commands worth trying in this state, in a stable order. Include commands
you expect to be refused: the explorer checks that a refusal changes
nothing.
Source§fn simulate(
&self,
state: Option<&TripState>,
command: &TripCommand,
) -> SimulatedTransition<TripState, TripEvent>
fn simulate( &self, state: Option<&TripState>, command: &TripCommand, ) -> SimulatedTransition<TripState, TripEvent>
Applies one candidate command purely.
Source§fn declared_outcomes(&self) -> Vec<TripOutcome>
fn declared_outcomes(&self) -> Vec<TripOutcome>
Outcomes the workflow claims it can reach. The explorer reports every
declared outcome no reachable state projects. The default is empty,
which disables the check.
Auto Trait Implementations§
impl Freeze for TripModel
impl RefUnwindSafe for TripModel
impl Send for TripModel
impl Sync for TripModel
impl Unpin for TripModel
impl UnsafeUnpin for TripModel
impl UnwindSafe for TripModel
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