pub struct ExecutionContext { /* private fields */ }Expand description
Context passed through skill execution, carrying inputs, outputs, and configuration.
The execution context maintains state between steps, allowing later steps to reference outputs from earlier steps.
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn from_inputs(inputs: HashMap<String, Value>) -> Self
pub fn from_inputs(inputs: HashMap<String, Value>) -> Self
Create a context from input arguments.
Sourcepub fn with_input(self, key: impl Into<String>, value: Value) -> Self
pub fn with_input(self, key: impl Into<String>, value: Value) -> Self
Add an input value.
Sourcepub fn with_config(self, config: ExecutionConfig) -> Self
pub fn with_config(self, config: ExecutionConfig) -> Self
Set the execution configuration.
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata.
Sourcepub fn get_output(&self, step_name: &str) -> Option<&Value>
pub fn get_output(&self, step_name: &str) -> Option<&Value>
Get an output value by step name.
Sourcepub fn set_output(&mut self, step_name: impl Into<String>, value: Value)
pub fn set_output(&mut self, step_name: impl Into<String>, value: Value)
Set an output value for a step.
Sourcepub fn config(&self) -> &ExecutionConfig
pub fn config(&self) -> &ExecutionConfig
Get the execution configuration.
Sourcepub fn config_mut(&mut self) -> &mut ExecutionConfig
pub fn config_mut(&mut self) -> &mut ExecutionConfig
Get mutable reference to the execution configuration.
Sourcepub fn get_metadata(&self, key: &str) -> Option<&Value>
pub fn get_metadata(&self, key: &str) -> Option<&Value>
Get metadata value.
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 value.
Sourcepub fn variables(&self) -> HashMap<String, Value>
pub fn variables(&self) -> HashMap<String, Value>
Get a combined view of inputs and outputs for variable substitution.
Outputs take precedence over inputs if there are key conflicts.
Sourcepub fn clear_outputs(&mut self)
pub fn clear_outputs(&mut self)
Clear all outputs (useful for re-execution).
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§fn clone(&self) -> ExecutionContext
fn clone(&self) -> ExecutionContext
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 ExecutionContext
impl Debug for ExecutionContext
Auto Trait Implementations§
impl Freeze for ExecutionContext
impl RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin for ExecutionContext
impl UnwindSafe for ExecutionContext
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