Skip to main content

StepContext

Trait StepContext 

Source
pub trait StepContext {
    // Required methods
    fn step_index(&self, step_id: &str) -> Option<usize>;
    fn is_completed(&self, step_index: usize) -> bool;
    fn get_result(&self, step_index: usize) -> Option<&FlowResult>;
    fn get_input(&self) -> Option<&ValueRef>;
    fn get_variable(&self, name: &str) -> Option<ValueRef>;
    fn get_variable_secrets(&self, name: &str) -> Secrets;
}
Expand description

Provides access to execution state for expression evaluation.

This trait allows ValueExpr::needed_steps() to determine which steps are needed to evaluate an expression, and ValueExpr::resolve() to evaluate expressions using available state.

Required Methods§

Source

fn step_index(&self, step_id: &str) -> Option<usize>

Get the index of a step by its ID.

Returns None if the step ID is not found in the workflow.

Source

fn is_completed(&self, step_index: usize) -> bool

Check if a step has completed execution.

A step is completed if it has a result (success, skipped, or failed).

Source

fn get_result(&self, step_index: usize) -> Option<&FlowResult>

Get the result of a completed step.

Returns None if the step has not completed or the index is invalid.

Source

fn get_input(&self) -> Option<&ValueRef>

Get the workflow input value.

Returns None if input is not available in this context.

Source

fn get_variable(&self, name: &str) -> Option<ValueRef>

Get a variable value by name.

Returns None if the variable is not defined. The implementation may fall back to schema defaults before returning None. Returns an owned ValueRef since defaults may be computed.

Source

fn get_variable_secrets(&self, name: &str) -> Secrets

Get the secrets configuration for a variable.

Used for redacting sensitive values in logs.

Implementors§