pub struct WorkflowContext { /* private fields */ }Expand description
Shared context that flows through a workflow execution.
Stores outputs from completed steps so downstream steps can access them.
Implementations§
Source§impl WorkflowContext
impl WorkflowContext
Sourcepub fn output(&self, step_id: &str) -> Option<&StepOutput>
pub fn output(&self, step_id: &str) -> Option<&StepOutput>
Returns the output of a completed step, if available.
Sourcepub fn step_outputs(&self) -> &HashMap<String, StepOutput>
pub fn step_outputs(&self) -> &HashMap<String, StepOutput>
Returns all step outputs.
Sourcepub fn set_output(&mut self, step_id: &str, output: StepOutput)
pub fn set_output(&mut self, step_id: &str, output: StepOutput)
Stores the output of a completed step.
Sourcepub fn is_completed(&self, step_id: &str) -> bool
pub fn is_completed(&self, step_id: &str) -> bool
Returns true if the step has completed.
Sourcepub fn completed_step_ids(&self) -> Vec<&str>
pub fn completed_step_ids(&self) -> Vec<&str>
Returns the IDs of all completed steps.
Trait Implementations§
Source§impl Clone for WorkflowContext
impl Clone for WorkflowContext
Source§fn clone(&self) -> WorkflowContext
fn clone(&self) -> WorkflowContext
Returns a duplicate of the value. Read more
1.0.0 · 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 WorkflowContext
impl Debug for WorkflowContext
Source§impl Default for WorkflowContext
impl Default for WorkflowContext
Source§fn default() -> WorkflowContext
fn default() -> WorkflowContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WorkflowContext
impl RefUnwindSafe for WorkflowContext
impl Send for WorkflowContext
impl Sync for WorkflowContext
impl Unpin for WorkflowContext
impl UnsafeUnpin for WorkflowContext
impl UnwindSafe for WorkflowContext
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