DependencyResolver

Struct DependencyResolver 

Source
pub struct DependencyResolver;
Expand description

Resolves step dependencies and builds execution order

Handles:

  • Building execution order from dependency graph
  • Detecting and reporting circular dependencies
  • Waiting for dependencies before executing step

Implementations§

Source§

impl DependencyResolver

Source

pub fn resolve_execution_order( workflow: &Workflow, ) -> WorkflowResult<Vec<String>>

Build execution order from dependency graph

Uses topological sort to determine the order in which steps should execute based on their dependencies. Returns error if circular dependencies are detected.

Source

pub fn detect_circular_dependencies(workflow: &Workflow) -> WorkflowResult<()>

Detect circular dependencies in workflow

Uses depth-first search to detect cycles in the dependency graph. Returns error if any circular dependency is found.

Source

pub fn get_all_dependencies( workflow: &Workflow, step_id: &str, ) -> WorkflowResult<HashSet<String>>

Get all dependencies for a step (transitive closure)

Returns all steps that must be completed before the given step can execute, including transitive dependencies.

Source

pub fn get_dependent_steps( workflow: &Workflow, step_id: &str, ) -> WorkflowResult<HashSet<String>>

Get all steps that depend on a given step (reverse dependencies)

Returns all steps that have the given step as a dependency (direct or transitive).

Source

pub fn can_execute_step( workflow: &Workflow, completed_steps: &[String], step_id: &str, ) -> WorkflowResult<bool>

Check if a step can be executed

A step can be executed if all its dependencies have been completed.

Source

pub fn get_ready_steps( workflow: &Workflow, completed_steps: &[String], in_progress_steps: &[String], ) -> WorkflowResult<Vec<String>>

Get steps that are ready to execute

Returns all steps whose dependencies are satisfied and haven’t been executed yet.

Source

pub fn validate_dependencies(workflow: &Workflow) -> WorkflowResult<()>

Validate dependency graph

Checks for:

  • Missing dependencies (references to non-existent steps)
  • Circular dependencies
  • Duplicate step IDs

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.