#[non_exhaustive]pub struct ExecutionStep {
pub workflow_id: String,
pub task_id: Option<String>,
pub result: StepResult,
pub message: Option<Message>,
pub mapping_contexts: Option<Vec<Value>>,
pub started_at: Option<DateTime<Utc>>,
pub duration_us: Option<u64>,
pub changes: Option<Vec<Change>>,
}Expand description
A single step in the execution trace
#[non_exhaustive]: construct through ExecutionStep::executed,
ExecutionStep::task_skipped or ExecutionStep::workflow_skipped and
chain the with_* methods. Field reads and .. patterns are unaffected.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workflow_id: StringID of the workflow this step belongs to
task_id: Option<String>ID of the task (None for workflow-level skips)
result: StepResultResult of the step execution
message: Option<Message>Message snapshot after this step. None for skipped steps, when
TraceOptions::snapshots is off, and for executed steps recorded after
TraceOptions::max_snapshot_bytes was exceeded.
mapping_contexts: Option<Vec<Value>>Context snapshots before each mapping (map tasks only, trace mode only).
mapping_contexts[i] is message.context before mapping[i] executed.
started_at: Option<DateTime<Utc>>Wall-clock start of the task body. Executed steps only.
chrono, not std::time::Instant: Instant::now() panics on
wasm32-unknown-unknown, and the wasm bindings run the trace path there.
duration_us: Option<u64>Task body duration in microseconds. Executed steps only.
Derived from two Utc::now() reads, which are not monotonic: a backward
clock step clamps to 0 rather than wrapping.
changes: Option<Vec<Change>>This task’s own writes, when TraceOptions::changes is set. Some(vec![])
means the task wrote nothing (or change capture is off), which is
distinct from None meaning “not recorded”.
Implementations§
Source§impl ExecutionStep
impl ExecutionStep
Sourcepub fn executed(workflow_id: &str, task_id: &str, message: &Message) -> Self
pub fn executed(workflow_id: &str, task_id: &str, message: &Message) -> Self
Create a new executed step with a message snapshot
Sourcepub fn task_skipped(workflow_id: &str, task_id: &str) -> Self
pub fn task_skipped(workflow_id: &str, task_id: &str) -> Self
Create a skipped task step
Sourcepub fn workflow_skipped(workflow_id: &str) -> Self
pub fn workflow_skipped(workflow_id: &str) -> Self
Create a skipped workflow step
Sourcepub fn with_mapping_contexts(self, contexts: Vec<Value>) -> Self
pub fn with_mapping_contexts(self, contexts: Vec<Value>) -> Self
Set mapping context snapshots (for map tasks in trace mode)
Sourcepub fn with_timing(self, started_at: DateTime<Utc>, duration_us: u64) -> Self
pub fn with_timing(self, started_at: DateTime<Utc>, duration_us: u64) -> Self
Attach task-body timing. Chains after Self::executed.
Sourcepub fn with_changes(self, changes: Vec<Change>) -> Self
pub fn with_changes(self, changes: Vec<Change>) -> Self
Attach this task’s own diff. Chains after Self::executed.
Trait Implementations§
Source§impl Clone for ExecutionStep
impl Clone for ExecutionStep
Source§fn clone(&self) -> ExecutionStep
fn clone(&self) -> ExecutionStep
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more