#[non_exhaustive]pub enum EffectStatus {
Pending,
AwaitingApproval,
Executing,
Unknown,
Verifying,
Committed,
Failed,
Rejected,
NeedsIntervention,
Compensating,
Compensated,
CompensationFailed,
}Expand description
Where an effect is in its lifecycle.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pending
Recorded and waiting to run, either for the first time or for a scheduled retry.
AwaitingApproval
Waiting for a human or policy decision before it may run.
Executing
An attempt is in flight under a lease.
Unknown
An attempt may or may not have applied.
Verifying
Checking the remote system for the effect’s outcome.
Committed
The effect applied. Final, unless it is later compensated.
Failed
The effect definitely did not apply and will not be retried. Terminal.
Rejected
A precondition or approval decision refused the effect before it ran. Terminal.
NeedsIntervention
The runtime cannot resolve the outcome on its own; an operator must.
Compensating
A committed effect is being undone. Attempts are retried; the compensation must be idempotent.
Compensated
The effect was undone. Terminal.
CompensationFailed
Undoing the effect failed for good; an operator must finish it or order a retry.
Implementations§
Source§impl EffectStatus
impl EffectStatus
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Whether no further transition is possible.
Committed is not terminal: compensation can start from it.
Sourcepub const fn is_settled(self) -> bool
pub const fn is_settled(self) -> bool
Whether nothing is left to do without a new request: the effect
committed, failed, was rejected or was undone. Only settled records
may be pruned (PruneQuery).
Unlike Self::is_terminal this includes Committed, whose
compensation would be a new request. CompensationFailed is not
settled: it waits for an operator.
Sourcepub const fn is_in_doubt(self) -> bool
pub const fn is_in_doubt(self) -> bool
Whether the effect may have changed the outside world without the runtime knowing the result, so it must not simply be started again.
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parses the storage representation produced by Self::as_str.
Sourcepub const fn apply(self, event: Transition) -> Result<Self, InvalidTransition>
pub const fn apply(self, event: Transition) -> Result<Self, InvalidTransition>
The status after event, or an error if the event is not legal here.
§Errors
Returns InvalidTransition for any pair not in the transition table.