pub struct StepDependencyGraph { /* private fields */ }Expand description
Dependency graph over the steps of an instantiated job.
Implementations§
Source§impl StepDependencyGraph
impl StepDependencyGraph
Sourcepub fn new(job: &Job) -> Result<Self, ModelError>
pub fn new(job: &Job) -> Result<Self, ModelError>
Build the dependency graph from a Job.
Sourcepub fn step_node(&self, name: &str) -> Option<&StepDependencyNode>
pub fn step_node(&self, name: &str) -> Option<&StepDependencyNode>
Get a node by step name.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes in the graph.
Sourcepub fn edge(&self, index: usize) -> Option<&StepDependencyEdge>
pub fn edge(&self, index: usize) -> Option<&StepDependencyEdge>
Get an edge by index.
Sourcepub fn node(&self, index: usize) -> Option<&StepDependencyNode>
pub fn node(&self, index: usize) -> Option<&StepDependencyNode>
Get a node by index.
Sourcepub fn max_indegree(&self) -> usize
pub fn max_indegree(&self) -> usize
Maximum in-degree (max number of dependencies any step has).
Sourcepub fn max_outdegree(&self) -> usize
pub fn max_outdegree(&self) -> usize
Maximum out-degree (max number of steps that depend on any single step).
Sourcepub fn topo_sorted(&self) -> Result<Vec<usize>, ModelError>
pub fn topo_sorted(&self) -> Result<Vec<usize>, ModelError>
Stable topological sort matching the Python implementation.
DFS-based: processes nodes in template order. For each unvisited node, pushes it onto a stack and explores dependencies (pushed in reverse template order so the earliest dependency is processed first). Returns step indices in dependency-respecting, template-stable order.
Sourcepub fn topo_sorted_names(&self) -> Result<Vec<String>, ModelError>
pub fn topo_sorted_names(&self) -> Result<Vec<String>, ModelError>
Convenience: topological sort returning step names.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StepDependencyGraph
impl RefUnwindSafe for StepDependencyGraph
impl Send for StepDependencyGraph
impl Sync for StepDependencyGraph
impl Unpin for StepDependencyGraph
impl UnsafeUnpin for StepDependencyGraph
impl UnwindSafe for StepDependencyGraph
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more