1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Task graph DAG algorithms and dependency resolution for cuenv.
//!
//! This crate provides a directed acyclic graph (DAG) implementation for
//! task dependency resolution and execution ordering using petgraph.
//!
//! # Key Types
//!
//! - [`TaskGraph`]: The main graph structure for building and querying task dependencies
//! - [`TaskNodeData`]: Trait that task types must implement to be stored in the graph
//! - [`GraphNode`]: A node in the graph containing the task name and data
//!
//! # Example
//!
//! ```ignore
//! use cuenv_task_graph::{TaskGraph, TaskNodeData};
//!
//! // Define a simple task type
//! struct MyTask {
//! depends_on: Vec<String>,
//! }
//!
//! impl TaskNodeData for MyTask {
//! fn depends_on(&self) -> &[String] {
//! &self.depends_on
//! }
//! }
//!
//! // Build a graph
//! let mut graph = TaskGraph::new();
//! graph.add_task("build", MyTask { depends_on: vec![] })?;
//! graph.add_task("test", MyTask { depends_on: vec!["build".to_string()] })?;
//! graph.add_dependency_edges()?;
//!
//! // Get execution order
//! let sorted = graph.topological_sort()?;
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ValidationResult;
/// Trait for task data that can be stored in the task graph.
///
/// Implement this trait for your task type to enable it to be stored
/// in a [`TaskGraph`] and participate in dependency resolution.