pub struct SubWorkflowOutput { /* private fields */ }Expand description
Result of a workflow step.
While planning, no child run is created: run_id is
Uuid::nil and the metrics are zero.
It is also the persisted output of the step, so a stored workflow step
reads back with StepOutput::json.
§Examples
use ironflow_engine::executor::SubWorkflowOutput;
use ironflow_store::entities::RunStatus;
use rust_decimal::Decimal;
use uuid::Uuid;
let run_id = Uuid::now_v7();
let output = SubWorkflowOutput::new(run_id, "collect", RunStatus::Completed, Decimal::ZERO, 1200);
assert_eq!(output.run_id(), run_id);
assert_eq!(output.workflow_name(), "collect");
assert_eq!(output.status(), RunStatus::Completed);
assert_eq!(output.duration_ms(), 1200);Implementations§
Source§impl SubWorkflowOutput
impl SubWorkflowOutput
Sourcepub fn new(
run_id: Uuid,
workflow_name: &str,
status: RunStatus,
cost_usd: Decimal,
duration_ms: u64,
) -> Self
pub fn new( run_id: Uuid, workflow_name: &str, status: RunStatus, cost_usd: Decimal, duration_ms: u64, ) -> Self
Assemble the result of a child run.
§Examples
use ironflow_engine::executor::SubWorkflowOutput;
use ironflow_store::entities::RunStatus;
use rust_decimal::Decimal;
use uuid::Uuid;
let output = SubWorkflowOutput::new(Uuid::nil(), "collect", RunStatus::Warning, Decimal::ONE, 0);
assert_eq!(output.cost_usd(), Decimal::ONE);Sourcepub fn run_id(&self) -> Uuid
pub fn run_id(&self) -> Uuid
The child run, to read its steps from the store. Uuid::nil while
planning.
§Examples
use ironflow_engine::executor::SubWorkflowOutput;
use ironflow_store::entities::RunStatus;
use rust_decimal::Decimal;
use uuid::Uuid;
let output = SubWorkflowOutput::new(Uuid::nil(), "collect", RunStatus::Completed, Decimal::ZERO, 0);
assert!(output.run_id().is_nil());Sourcepub fn workflow_name(&self) -> &str
pub fn workflow_name(&self) -> &str
Name of the child workflow.
Sourcepub fn status(&self) -> RunStatus
pub fn status(&self) -> RunStatus
Final status of the child run: Completed, or Warning when one of its
allow_failure steps failed.
Sourcepub fn cost_usd(&self) -> Decimal
pub fn cost_usd(&self) -> Decimal
Cost of the child run, in USD. Already included in the parent’s cost.
Sourcepub fn duration_ms(&self) -> u64
pub fn duration_ms(&self) -> u64
Wall-clock duration of the child run, in milliseconds.
Trait Implementations§
Source§impl Clone for SubWorkflowOutput
impl Clone for SubWorkflowOutput
Source§impl Debug for SubWorkflowOutput
impl Debug for SubWorkflowOutput
Source§impl<'de> Deserialize<'de> for SubWorkflowOutput
impl<'de> Deserialize<'de> for SubWorkflowOutput
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SubWorkflowOutput
impl PartialEq for SubWorkflowOutput
Source§impl Serialize for SubWorkflowOutput
impl Serialize for SubWorkflowOutput
impl StructuralPartialEq for SubWorkflowOutput
Auto Trait Implementations§
impl Freeze for SubWorkflowOutput
impl RefUnwindSafe for SubWorkflowOutput
impl Send for SubWorkflowOutput
impl Sync for SubWorkflowOutput
impl Unpin for SubWorkflowOutput
impl UnsafeUnpin for SubWorkflowOutput
impl UnwindSafe for SubWorkflowOutput
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