Skip to main content

EffectStatus

Enum EffectStatus 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

pub const fn is_terminal(self) -> bool

Whether no further transition is possible.

Committed is not terminal: compensation can start from it.

Source

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.

Source

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.

Source

pub const fn as_str(self) -> &'static str

The stable storage representation.

Source

pub fn parse(s: &str) -> Option<Self>

Parses the storage representation produced by Self::as_str.

Source

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.

Trait Implementations§

Source§

impl Clone for EffectStatus

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EffectStatus

Source§

impl Debug for EffectStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EffectStatus

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for EffectStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for EffectStatus

Source§

impl Hash for EffectStatus

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for EffectStatus

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for EffectStatus

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for EffectStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.