Skip to main content

StepEventKind

Enum StepEventKind 

Source
pub enum StepEventKind<S: EngineSpec> {
    NoStepsDefined,
    ExecutionStarted {
        steps: Vec<StepInfo<S>>,
        components: Vec<StepComponentSummary<S>>,
        first_step: StepInfoWithMetadata<S>,
    },
    ProgressReset {
        step: StepInfoWithMetadata<S>,
        attempt: usize,
        metadata: S::ProgressMetadata,
        step_elapsed: Duration,
        attempt_elapsed: Duration,
        message: Cow<'static, str>,
    },
    AttemptRetry {
        step: StepInfoWithMetadata<S>,
        next_attempt: usize,
        step_elapsed: Duration,
        attempt_elapsed: Duration,
        message: Cow<'static, str>,
    },
    StepCompleted {
        step: StepInfoWithMetadata<S>,
        attempt: usize,
        outcome: StepOutcome<S>,
        next_step: StepInfoWithMetadata<S>,
        step_elapsed: Duration,
        attempt_elapsed: Duration,
    },
    ExecutionCompleted {
        last_step: StepInfoWithMetadata<S>,
        last_attempt: usize,
        last_outcome: StepOutcome<S>,
        step_elapsed: Duration,
        attempt_elapsed: Duration,
    },
    ExecutionFailed {
        failed_step: StepInfoWithMetadata<S>,
        total_attempts: usize,
        step_elapsed: Duration,
        attempt_elapsed: Duration,
        message: String,
        causes: Vec<String>,
    },
    ExecutionAborted {
        aborted_step: StepInfoWithMetadata<S>,
        attempt: usize,
        step_elapsed: Duration,
        attempt_elapsed: Duration,
        message: String,
    },
    Nested {
        step: StepInfoWithMetadata<S>,
        attempt: usize,
        event: Box<StepEvent<GenericSpec>>,
        step_elapsed: Duration,
        attempt_elapsed: Duration,
    },
    Unknown,
}

Variants§

§

NoStepsDefined

No steps were defined, and the executor exited without doing anything.

This is a terminal event: it is guaranteed that no more events will be seen after this one.

§

ExecutionStarted

Execution was started.

This is an initial event – it is always expected to be the first event received from the event stream.

Fields

§steps: Vec<StepInfo<S>>

The list of steps that will be executed.

§components: Vec<StepComponentSummary<S>>

A list of components, along with the number of items each component has.

§first_step: StepInfoWithMetadata<S>

Information about the first step.

§

ProgressReset

Progress was reset along an attempt, and this attempt is going down a different path.

Fields

§step: StepInfoWithMetadata<S>

Information about the step.

§attempt: usize

The current attempt number.

§metadata: S::ProgressMetadata

Progress-related metadata associated with this attempt.

§step_elapsed: Duration

Total time elapsed since the start of the step. Includes prior attempts.

§attempt_elapsed: Duration

The amount of time this attempt has taken so far.

§message: Cow<'static, str>

A message associated with the reset.

§

AttemptRetry

An attempt failed and this step is being retried.

Fields

§step: StepInfoWithMetadata<S>

Information about the step.

§next_attempt: usize

The attempt number for the next attempt.

§step_elapsed: Duration

Total time elapsed since the start of the step. Includes prior attempts.

§attempt_elapsed: Duration

The amount of time the previous attempt took.

§message: Cow<'static, str>

A message associated with the retry.

§

StepCompleted

A step is complete and the next step has been started.

Fields

§step: StepInfoWithMetadata<S>

Information about the step that just completed.

§attempt: usize

The attempt number that completed.

§outcome: StepOutcome<S>

The outcome of the step.

§next_step: StepInfoWithMetadata<S>

The next step that is being started.

§step_elapsed: Duration

Total time elapsed since the start of the step. Includes prior attempts.

§attempt_elapsed: Duration

The time it took for this attempt to complete.

§

ExecutionCompleted

Execution is complete.

This is a terminal event: it is guaranteed that no more events will be seen after this one.

Fields

§last_step: StepInfoWithMetadata<S>

Information about the last step that completed.

§last_attempt: usize

The attempt number that completed.

§last_outcome: StepOutcome<S>

The outcome of the last step.

§step_elapsed: Duration

Total time elapsed since the start of the step. Includes prior attempts.

§attempt_elapsed: Duration

The time it took for this attempt to complete.

§

ExecutionFailed

Execution failed.

This is a terminal event: it is guaranteed that no more events will be seen after this one.

Fields

§failed_step: StepInfoWithMetadata<S>

Information about the step that failed.

§total_attempts: usize

The total number of attempts that were performed before the step failed.

§step_elapsed: Duration

Total time elapsed since the start of the step. Includes prior attempts.

§attempt_elapsed: Duration

The time it took for this attempt to complete.

§message: String

A message associated with the failure.

§causes: Vec<String>

A chain of causes associated with the failure.

§

ExecutionAborted

Execution aborted by an external user.

This is a terminal event: it is guaranteed that no more events will be seen after this one.

Fields

§aborted_step: StepInfoWithMetadata<S>

Information about the step that was running at the time execution was aborted.

§attempt: usize

The attempt that was running at the time the step was aborted.

§step_elapsed: Duration

Total time elapsed since the start of the step. Includes prior attempts.

§attempt_elapsed: Duration

The time it took for this attempt to complete.

§message: String

A message associated with the abort.

§

Nested

A nested step event occurred.

Fields

§step: StepInfoWithMetadata<S>

Information about the step that’s occurring.

§attempt: usize

The current attempt number.

§event: Box<StepEvent<GenericSpec>>

The event that occurred.

§step_elapsed: Duration

Total time elapsed since the start of the step. Includes prior attempts.

§attempt_elapsed: Duration

The time it took for this attempt to complete.

§

Unknown

Future variants that might be unknown.

Implementations§

Source§

impl<S: EngineSpec> StepEventKind<S>

Source

pub fn is_terminal(&self) -> StepEventIsTerminal

Returns whether this is a terminal step event.

Terminal events guarantee that there are no further events coming from this update engine.

This does not recurse into nested events; those are always non-terminal.

Source

pub fn priority(&self) -> StepEventPriority

Returns the priority of the event.

For more about this, see StepEventPriority.

Source

pub fn from_generic( value: StepEventKind<GenericSpec>, ) -> Result<Self, ConvertGenericError>

Converts a generic version into self.

This version can be used to convert a generic type into a more concrete form.

Source

pub fn into_generic(self) -> StepEventKind<GenericSpec>

Converts self into its generic version.

This version can be used to share data across different kinds of engines.

If any of the data in self fails to serialize to a serde_json::Value, it will be replaced with serde_json::Value::Null. Since serde_json::Value represents an arbitrary JSON value, such data would have failed to serialize anyway.

Source

pub fn step_outcome(&self) -> Option<&StepOutcome<S>>

If this represents a successfully-completed step, returns the outcome.

This does not recurse into nested events.

Trait Implementations§

Source§

impl<S: EngineSpec> Clone for StepEventKind<S>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<S: EngineSpec> Debug for StepEventKind<S>

Source§

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

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

impl<'de, S: EngineSpec> Deserialize<'de> for StepEventKind<S>

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<S> JsonSchema for StepEventKind<S>

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl<S: EngineSpec> PartialEq for StepEventKind<S>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: EngineSpec> Serialize for StepEventKind<S>

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<S: EngineSpec> Eq for StepEventKind<S>

Auto Trait Implementations§

§

impl<S> Freeze for StepEventKind<S>

§

impl<S> RefUnwindSafe for StepEventKind<S>

§

impl<S> Send for StepEventKind<S>

§

impl<S> Sync for StepEventKind<S>

§

impl<S> Unpin for StepEventKind<S>

§

impl<S> UnsafeUnpin for StepEventKind<S>

§

impl<S> UnwindSafe for StepEventKind<S>

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

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