pub struct TransactionFsm;Expand description
Pure-logic FSM engine for TAP transactions.
This struct contains no I/O — it operates only on TransactionContext
and returns Transition values describing what happened and what
decisions are needed. The caller (typically the StandardTransactionProcessor
or a higher-level orchestrator) is responsible for:
- Persisting state changes
- Publishing events
- Presenting decisions to external systems
- Sending response messages
Implementations§
Source§impl TransactionFsm
impl TransactionFsm
Sourcepub fn apply(
ctx: &mut TransactionContext,
event: FsmEvent,
) -> Result<Transition, InvalidTransition>
pub fn apply( ctx: &mut TransactionContext, event: FsmEvent, ) -> Result<Transition, InvalidTransition>
Apply an event to a transaction context, producing a state transition.
Returns Ok(Transition) on success, describing the state change and
any decision required. Returns Err(InvalidTransition) if the event
is not valid in the current state.
Sourcepub fn valid_events(state: &TransactionState) -> Vec<&'static str>
pub fn valid_events(state: &TransactionState) -> Vec<&'static str>
Returns all valid events for a given state (for documentation/UI).
Auto Trait Implementations§
impl Freeze for TransactionFsm
impl RefUnwindSafe for TransactionFsm
impl Send for TransactionFsm
impl Sync for TransactionFsm
impl Unpin for TransactionFsm
impl UnsafeUnpin for TransactionFsm
impl UnwindSafe for TransactionFsm
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more