pub struct TaskDAG {
pub dependencies: HashMap<String, Vec<String>>,
pub dependents: HashMap<String, Vec<String>>,
pub tasks: HashMap<String, AgentTask>,
}Expand description
Directed Acyclic Graph (DAG) for task execution
Fields§
§dependencies: HashMap<String, Vec<String>>Map of task ID to its dependencies
dependents: HashMap<String, Vec<String>>Map of task ID to tasks that depend on it
tasks: HashMap<String, AgentTask>All tasks in the DAG
Implementations§
Source§impl TaskDAG
impl TaskDAG
Sourcepub fn add_dependency(&mut self, task_id: String, depends_on: String)
pub fn add_dependency(&mut self, task_id: String, depends_on: String)
Add a dependency between tasks
Sourcepub fn get_root_tasks(&self) -> Vec<String>
pub fn get_root_tasks(&self) -> Vec<String>
Get tasks with no dependencies (can execute immediately)
Sourcepub fn get_dependents(&self, task_id: &str) -> Vec<String>
pub fn get_dependents(&self, task_id: &str) -> Vec<String>
Get tasks that depend on a given task
Sourcepub fn get_dependencies(&self, task_id: &str) -> Vec<String>
pub fn get_dependencies(&self, task_id: &str) -> Vec<String>
Get dependencies for a task
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskDAG
impl RefUnwindSafe for TaskDAG
impl Send for TaskDAG
impl Sync for TaskDAG
impl Unpin for TaskDAG
impl UnwindSafe for TaskDAG
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