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: StringThe 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: ExecutionUuidThe execution ID.
event_index: usizeA monotonically increasing index for this StepEvent.
total_elapsed: DurationTotal time elapsed since the start of execution.
kind: StepEventKind<S>The kind of event this is.
Implementations§
Source§impl<S: EngineSpec> StepEvent<S>
impl<S: EngineSpec> StepEvent<S>
Sourcepub fn progress_event(&self) -> Option<ProgressEvent<S>>
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.
Sourcepub fn leaf_execution_id(&self) -> ExecutionUuid
pub fn leaf_execution_id(&self) -> ExecutionUuid
Returns the execution ID for the leaf event, recursing into nested events if necessary.
Sourcepub fn leaf_event_index(&self) -> usize
pub fn leaf_event_index(&self) -> usize
Returns the event index for the leaf event, recursing into nested events if necessary.
Sourcepub fn from_generic(
value: StepEvent<GenericSpec>,
) -> Result<Self, ConvertGenericError>
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.
Sourcepub fn into_generic(self) -> StepEvent<GenericSpec>
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>
impl<S: EngineSpec> Clone for StepEvent<S>
Source§impl<S: EngineSpec> Debug for StepEvent<S>
impl<S: EngineSpec> Debug for StepEvent<S>
Source§impl<'de, S: EngineSpec> Deserialize<'de> for StepEvent<S>
impl<'de, S: EngineSpec> Deserialize<'de> for StepEvent<S>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<S: JsonSchemaEngineSpec> JsonSchema for StepEvent<S>
Available on crate feature schemars08 only.
impl<S: JsonSchemaEngineSpec> JsonSchema for StepEvent<S>
schemars08 only.Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl<S: EngineSpec> PartialEq for StepEvent<S>
impl<S: EngineSpec> PartialEq for StepEvent<S>
Source§impl<S: EngineSpec> Serialize for StepEvent<S>
impl<S: EngineSpec> Serialize for StepEvent<S>
impl<S: EngineSpec> Eq for StepEvent<S>
Auto Trait Implementations§
impl<S> Freeze for StepEvent<S>where
<S as EngineSpec>::ProgressMetadata: Freeze,
<S as EngineSpec>::StepId: Freeze,
<S as EngineSpec>::Component: Freeze,
<S as EngineSpec>::StepMetadata: Freeze,
<S as EngineSpec>::CompletionMetadata: Freeze,
<S as EngineSpec>::SkippedMetadata: Freeze,
impl<S> RefUnwindSafe for StepEvent<S>where
<S as EngineSpec>::ProgressMetadata: RefUnwindSafe,
<S as EngineSpec>::StepId: RefUnwindSafe,
<S as EngineSpec>::Component: RefUnwindSafe,
<S as EngineSpec>::StepMetadata: RefUnwindSafe,
<S as EngineSpec>::CompletionMetadata: RefUnwindSafe,
<S as EngineSpec>::SkippedMetadata: RefUnwindSafe,
impl<S> Send for StepEvent<S>
impl<S> Sync for StepEvent<S>
impl<S> Unpin for StepEvent<S>where
<S as EngineSpec>::ProgressMetadata: Unpin,
<S as EngineSpec>::StepId: Unpin,
<S as EngineSpec>::Component: Unpin,
<S as EngineSpec>::StepMetadata: Unpin,
<S as EngineSpec>::CompletionMetadata: Unpin,
<S as EngineSpec>::SkippedMetadata: Unpin,
impl<S> UnsafeUnpin for StepEvent<S>where
<S as EngineSpec>::ProgressMetadata: UnsafeUnpin,
<S as EngineSpec>::StepId: UnsafeUnpin,
<S as EngineSpec>::Component: UnsafeUnpin,
<S as EngineSpec>::StepMetadata: UnsafeUnpin,
<S as EngineSpec>::CompletionMetadata: UnsafeUnpin,
<S as EngineSpec>::SkippedMetadata: UnsafeUnpin,
impl<S> UnwindSafe for StepEvent<S>where
<S as EngineSpec>::ProgressMetadata: UnwindSafe,
<S as EngineSpec>::StepId: UnwindSafe,
<S as EngineSpec>::Component: UnwindSafe,
<S as EngineSpec>::StepMetadata: UnwindSafe,
<S as EngineSpec>::CompletionMetadata: UnwindSafe,
<S as EngineSpec>::SkippedMetadata: UnwindSafe,
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.