pub struct StepResult {
pub trace_id: Uuid,
pub name: String,
pub status: StepStatus,
pub duration_ms: u64,
pub cost_usd: Decimal,
pub input_tokens: Option<u64>,
pub output_tokens: Option<u64>,
pub error: Option<String>,
pub output_summary: Option<String>,
}Expand description
Enriched result of a completed step, for post-execution inspection.
Collects the step’s trace ID, status, metrics, and a truncated output
summary into a single struct that the WorkflowContext
accumulates over the run.
§Examples
use ironflow_engine::executor::StepResult;
use ironflow_store::entities::StepStatus;
use rust_decimal::Decimal;
use uuid::Uuid;
let result = StepResult {
trace_id: Uuid::nil(),
name: "build".to_string(),
status: StepStatus::Completed,
duration_ms: 1200,
cost_usd: Decimal::ZERO,
input_tokens: None,
output_tokens: None,
error: None,
output_summary: Some("ok".to_string()),
};
assert_eq!(result.status, StepStatus::Completed);Fields§
§trace_id: UuidDeterministic trace ID for log correlation.
name: StringStep name.
status: StepStatusTerminal status.
duration_ms: u64Wall-clock duration in milliseconds.
cost_usd: DecimalCost in USD.
input_tokens: Option<u64>Input token count (agent steps only).
output_tokens: Option<u64>Output token count (agent steps only).
error: Option<String>Error message if the step failed.
output_summary: Option<String>First 500 characters of the serialized output.
Implementations§
Source§impl StepResult
impl StepResult
Sourcepub fn from_success(trace_id: Uuid, name: &str, output: &StepOutput) -> Self
pub fn from_success(trace_id: Uuid, name: &str, output: &StepOutput) -> Self
Build from a completed step’s output.
Trait Implementations§
Source§impl Clone for StepResult
impl Clone for StepResult
Source§fn clone(&self) -> StepResult
fn clone(&self) -> StepResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StepResult
impl Debug for StepResult
Auto Trait Implementations§
impl Freeze for StepResult
impl RefUnwindSafe for StepResult
impl Send for StepResult
impl Sync for StepResult
impl Unpin for StepResult
impl UnsafeUnpin for StepResult
impl UnwindSafe for StepResult
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
Mutably borrows from an owned value. Read more