pub struct TaskGraph { /* private fields */ }Expand description
A fine-grained task dependency graph built from the project graph.
Expands project-level dependencies into target-level task dependencies,
resolving local and upstream (^) dependency references.
Implementations§
Source§impl TaskGraph
impl TaskGraph
Sourcepub fn build(
project_graph: &ProjectGraph,
target: &TargetName,
) -> Result<Self, TaskGraphError>
pub fn build( project_graph: &ProjectGraph, target: &TargetName, ) -> Result<Self, TaskGraphError>
Build a task graph from a project graph for the given target.
This expands the project-level DAG into a fine-grained task-level DAG,
resolving all depends_on references in each target configuration.
Sourcepub fn ready_tasks(&self) -> Vec<&TaskId>
pub fn ready_tasks(&self) -> Vec<&TaskId>
Get all tasks that are ready to execute.
Sourcepub fn mark_complete(
&mut self,
task_id: &TaskId,
) -> Result<Vec<TaskId>, TaskGraphError>
pub fn mark_complete( &mut self, task_id: &TaskId, ) -> Result<Vec<TaskId>, TaskGraphError>
Mark a task as complete and return the tasks that became ready.
Sourcepub fn mark_running(&mut self, task_id: &TaskId) -> Result<(), TaskGraphError>
pub fn mark_running(&mut self, task_id: &TaskId) -> Result<(), TaskGraphError>
Mark a task as running.
Sourcepub fn dependencies_of(&self, task_id: &TaskId) -> Option<&HashSet<TaskId>>
pub fn dependencies_of(&self, task_id: &TaskId) -> Option<&HashSet<TaskId>>
Get the direct dependencies of a task.
Sourcepub fn all_completed(&self) -> bool
pub fn all_completed(&self) -> bool
Check if all tasks are completed.
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