Skip to main content

ExecutionStep

Struct ExecutionStep 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§workflow_id: String

ID of the workflow this step belongs to

§task_id: Option<String>

ID of the task (None for workflow-level skips)

§result: StepResult

Result 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

Source

pub fn executed(workflow_id: &str, task_id: &str, message: &Message) -> Self

Create a new executed step with a message snapshot

Source

pub fn task_skipped(workflow_id: &str, task_id: &str) -> Self

Create a skipped task step

Source

pub fn workflow_skipped(workflow_id: &str) -> Self

Create a skipped workflow step

Source

pub fn with_mapping_contexts(self, contexts: Vec<Value>) -> Self

Set mapping context snapshots (for map tasks in trace mode)

Source

pub fn with_timing(self, started_at: DateTime<Utc>, duration_us: u64) -> Self

Attach task-body timing. Chains after Self::executed.

Source

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

Source§

fn clone(&self) -> ExecutionStep

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 Debug for ExecutionStep

Source§

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

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

impl<'de> Deserialize<'de> for ExecutionStep

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 Serialize for ExecutionStep

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

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, 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.