pub struct StepContext {
pub workflow_id: String,
pub current_step: String,
pub outputs: HashMap<String, StepOutput>,
pub metadata: HashMap<String, Value>,
}Expand description
Step execution context
Fields§
§workflow_id: StringWorkflow ID
current_step: StringCurrent step ID
outputs: HashMap<String, StepOutput>Outputs from previous steps
metadata: HashMap<String, Value>Metadata
Implementations§
Source§impl StepContext
impl StepContext
Sourcepub fn set_output(&mut self, step_id: impl Into<String>, output: StepOutput)
pub fn set_output(&mut self, step_id: impl Into<String>, output: StepOutput)
Set output for a step
Sourcepub fn get_output(&self, step_id: &str) -> Option<&StepOutput>
pub fn get_output(&self, step_id: &str) -> Option<&StepOutput>
Get output from a previous step
Sourcepub fn set_metadata(&mut self, key: impl Into<String>, value: Value)
pub fn set_metadata(&mut self, key: impl Into<String>, value: Value)
Set metadata
Sourcepub fn get_metadata(&self, key: &str) -> Option<&Value>
pub fn get_metadata(&self, key: &str) -> Option<&Value>
Get metadata
Sourcepub fn get<T: DeserializeOwned>(&self, key: &str) -> Result<T>
pub fn get<T: DeserializeOwned>(&self, key: &str) -> Result<T>
Get typed metadata value
Trait Implementations§
Source§impl Clone for StepContext
impl Clone for StepContext
Source§fn clone(&self) -> StepContext
fn clone(&self) -> StepContext
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 StepContext
impl Debug for StepContext
Source§impl<'de> Deserialize<'de> for StepContext
impl<'de> Deserialize<'de> for StepContext
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
Auto Trait Implementations§
impl Freeze for StepContext
impl RefUnwindSafe for StepContext
impl Send for StepContext
impl Sync for StepContext
impl Unpin for StepContext
impl UnwindSafe for StepContext
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