pub struct TaskGraph {
pub nodes: Vec<TaskNode>,
pub edges: Vec<TaskEdge>,
}Expand description
A directed acyclic task dependency graph.
Fields§
§nodes: Vec<TaskNode>All registered task nodes.
edges: Vec<TaskEdge>All directed edges.
Implementations§
Source§impl TaskGraph
impl TaskGraph
Sourcepub fn successors(&self, id: u64) -> Vec<u64>
pub fn successors(&self, id: u64) -> Vec<u64>
Return the IDs of all nodes that are direct successors of id.
Sourcepub fn predecessors(&self, id: u64) -> Vec<u64>
pub fn predecessors(&self, id: u64) -> Vec<u64>
Return the IDs of all nodes that are direct predecessors of id.
Sourcepub fn root_nodes(&self) -> Vec<u64>
pub fn root_nodes(&self) -> Vec<u64>
Return IDs of nodes that have no incoming edges (roots of the DAG).
Sourcepub fn critical_path_ms(&self) -> u64
pub fn critical_path_ms(&self) -> u64
Compute the critical path length (ms) via dynamic programming.
The critical path is the longest weighted path from any root node to
any leaf node, where each node contributes its estimated_ms.
Returns 0 if the graph has no nodes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskGraph
impl RefUnwindSafe for TaskGraph
impl Send for TaskGraph
impl Sync for TaskGraph
impl Unpin for TaskGraph
impl UnsafeUnpin for TaskGraph
impl UnwindSafe for TaskGraph
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