pub enum SimulatedTransition<S, E> {
Applied {
state: Option<S>,
events: Vec<E>,
},
Rejected(DomainRejection),
}Expand description
The result of applying one candidate command to one state (spec §8.5).
A transition is either applied — producing the next state and the events the
executor would commit — or refused by the domain. A refusal carries the
DomainRejection the real executor would return, so the explorer can check
it against WorkflowDefinition::validate_command.
Variants§
Applied
The command was applied.
Fields
Rejected(DomainRejection)
The domain refused the command; the input state is unchanged.
Implementations§
Source§impl<S, E> SimulatedTransition<S, E>
impl<S, E> SimulatedTransition<S, E>
Sourcepub fn removed(events: Vec<E>) -> Self
pub fn removed(events: Vec<E>) -> Self
A transition that removed the case, which
explore reports as
TransitionRemovesCase.
A case’s identity outlives its content, so a domain whose working
document is consumed on success moves the case to a terminal status
instead of dropping it, the way the traveler sample’s Deleted does.
This constructor exists so that a model ported from a delete-on-completion
design produces a reported violation rather than a shape the explorer
cannot express — and so the check itself can be falsified.
Sourcepub fn rejected(rejection: DomainRejection) -> Self
pub fn rejected(rejection: DomainRejection) -> Self
A refusal.
Sourcepub fn is_applied(&self) -> bool
pub fn is_applied(&self) -> bool
Returns true when the command was applied.
Sourcepub fn next_state(&self) -> Option<&S>
pub fn next_state(&self) -> Option<&S>
The state after the command, when the command applied and the case still exists.
Sourcepub fn rejection(&self) -> Option<&DomainRejection>
pub fn rejection(&self) -> Option<&DomainRejection>
The rejection, when the command was refused.
Trait Implementations§
impl<S: Eq, E: Eq> Eq for SimulatedTransition<S, E>
impl<S: PartialEq, E: PartialEq> StructuralPartialEq for SimulatedTransition<S, E>
Auto Trait Implementations§
impl<S, E> Freeze for SimulatedTransition<S, E>
impl<S, E> RefUnwindSafe for SimulatedTransition<S, E>
impl<S, E> Send for SimulatedTransition<S, E>
impl<S, E> Sync for SimulatedTransition<S, E>
impl<S, E> Unpin for SimulatedTransition<S, E>
impl<S, E> UnsafeUnpin for SimulatedTransition<S, E>
impl<S, E> UnwindSafe for SimulatedTransition<S, E>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.