pub struct LifecycleEngine;Expand description
Stateless decision engine for order lifecycle state machines.
Implementations§
Source§impl LifecycleEngine
impl LifecycleEngine
Sourcepub fn decide_transition(
current_terminal: Option<TerminalStatus>,
transition: LifecycleTransition,
) -> TransitionDecision
pub fn decide_transition( current_terminal: Option<TerminalStatus>, transition: LifecycleTransition, ) -> TransitionDecision
Decides whether transition should be applied given the order’s current terminal state.
Non-terminal orders (None) accept all transitions.
Terminal orders only accept LifecycleTransition::MetadataOnly.
Sourcepub fn normalize_snapshot_to_delta(
stored_total: i64,
snapshot_total: i64,
) -> SnapshotDelta
pub fn normalize_snapshot_to_delta( stored_total: i64, snapshot_total: i64, ) -> SnapshotDelta
Converts a cumulative snapshot into a non-negative delta relative to stored_total.
If the snapshot regressed, delta is clamped to 0 and regression is flagged.
Auto Trait Implementations§
impl Freeze for LifecycleEngine
impl RefUnwindSafe for LifecycleEngine
impl Send for LifecycleEngine
impl Sync for LifecycleEngine
impl Unpin for LifecycleEngine
impl UnsafeUnpin for LifecycleEngine
impl UnwindSafe for LifecycleEngine
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> 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