pub struct DagGraph { /* private fields */ }Expand description
Internal DAG representation using adjacency lists.
Implementations§
Source§impl DagGraph
impl DagGraph
Sourcepub fn add_task(&mut self, id: TaskId, task: Box<dyn DagTask>) -> Result<()>
pub fn add_task(&mut self, id: TaskId, task: Box<dyn DagTask>) -> Result<()>
Add a task to the graph.
Sourcepub fn add_dep(&mut self, dependent: &TaskId, dependency: &TaskId) -> Result<()>
pub fn add_dep(&mut self, dependent: &TaskId, dependency: &TaskId) -> Result<()>
Add a dependency edge: dependent cannot start until dependency succeeds.
Sourcepub fn set_concurrency_group(&mut self, name: &str, max_concurrent: usize)
pub fn set_concurrency_group(&mut self, name: &str, max_concurrent: usize)
Set a concurrency group with a limit.
Sourcepub fn assign_group(&mut self, task_id: &TaskId, group: &str)
pub fn assign_group(&mut self, task_id: &TaskId, group: &str)
Assign a task to a concurrency group.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the graph: check for cycles using Kahn’s algorithm.
Sourcepub fn roots(&self) -> Vec<TaskId>
pub fn roots(&self) -> Vec<TaskId>
Return task IDs with zero dependencies (roots/starting points).
Auto Trait Implementations§
impl !RefUnwindSafe for DagGraph
impl !Sync for DagGraph
impl !UnwindSafe for DagGraph
impl Freeze for DagGraph
impl Send for DagGraph
impl Unpin for DagGraph
impl UnsafeUnpin for DagGraph
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