pub enum StepKind {
Pure,
Idempotent,
SideEffecting,
}Expand description
Advisory classification of a step’s side-effect profile (corrections
#3). The substrate can’t verify side-effect freedom, so this is
convention the worker respects, not enforcement: a SideEffecting
step that already completed should not be silently re-run on rewind
without a registered compensating step, whereas Pure / Idempotent
steps are safe to re-execute. Rewind reconstructs lifecycle metadata
deterministically; it does not undo external side effects.
Variants§
Pure
No external side effects — safe to re-execute freely.
Idempotent
Has side effects but re-execution leaves the world unchanged (e.g. an idempotent PUT) — safe to re-execute.
SideEffecting
Produces non-idempotent external effects (an email, a payment, a non-idempotent API call). Re-execution is unsafe.
Implementations§
Source§impl StepKind
impl StepKind
Sourcepub fn may_reexecute(self, already_completed: bool) -> bool
pub fn may_reexecute(self, already_completed: bool) -> bool
May this step be safely re-executed (e.g. on a rewind/retry)
given whether it already_completed? Pure / Idempotent are
always safe; a completed SideEffecting step is not (the worker
should require a compensating step instead). Advisory.
Trait Implementations§
impl Copy for StepKind
impl Eq for StepKind
impl StructuralPartialEq for StepKind
Auto Trait Implementations§
impl Freeze for StepKind
impl RefUnwindSafe for StepKind
impl Send for StepKind
impl Sync for StepKind
impl Unpin for StepKind
impl UnsafeUnpin for StepKind
impl UnwindSafe for StepKind
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
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§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.