Skip to main content

StepEvent

Struct StepEvent 

Source
pub struct StepEvent<S: EngineSpec> {
    pub spec: String,
    pub execution_id: ExecutionUuid,
    pub event_index: usize,
    pub total_elapsed: Duration,
    pub kind: StepEventKind<S>,
}

Fields§

§spec: String

The specification that this event belongs to.

This is typically the name of the type S for which EngineSpec is implemented.

This can be used along with Self::from_generic to identify which specification to deserialize generic metadata against. For example:

if event.spec == "MySpec" {
    // event is likely generated from a MySpec engine.
    let event = Event::<MySpec>::from_generic(event)?;
    // ...
}
§execution_id: ExecutionUuid

The execution ID.

§event_index: usize

A monotonically increasing index for this StepEvent.

§total_elapsed: Duration

Total time elapsed since the start of execution.

§kind: StepEventKind<S>

The kind of event this is.

Implementations§

Source§

impl<S: EngineSpec> StepEvent<S>

Source

pub fn progress_event(&self) -> Option<ProgressEvent<S>>

Returns a progress event associated with this step event, if any.

Some step events have an implicit progress event of kind ProgressEventKind::WaitingForProgress associated with them. This causes those step events to generate progress events.

Source

pub fn leaf_execution_id(&self) -> ExecutionUuid

Returns the execution ID for the leaf event, recursing into nested events if necessary.

Source

pub fn leaf_event_index(&self) -> usize

Returns the event index for the leaf event, recursing into nested events if necessary.

Source

pub fn from_generic( value: StepEvent<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) -> StepEvent<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.

Trait Implementations§

Source§

impl<S: EngineSpec> Clone for StepEvent<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 StepEvent<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 StepEvent<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: JsonSchemaEngineSpec> JsonSchema for StepEvent<S>

Available on crate feature schemars08 only.
Source§

fn schema_name() -> String

The name of the generated JSON Schema. 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§

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

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

impl<S: EngineSpec> PartialEq for StepEvent<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 StepEvent<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 StepEvent<S>

Auto Trait Implementations§

§

impl<S> Freeze for StepEvent<S>

§

impl<S> RefUnwindSafe for StepEvent<S>

§

impl<S> Send for StepEvent<S>

§

impl<S> Sync for StepEvent<S>

§

impl<S> Unpin for StepEvent<S>

§

impl<S> UnsafeUnpin for StepEvent<S>

§

impl<S> UnwindSafe for StepEvent<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>,