pub struct TaskGraph { /* private fields */ }Expand description
Graph of task relationships
Implementations§
Source§impl TaskGraph
impl TaskGraph
Sourcepub fn add_relationship(&mut self, relationship: Relationship)
pub fn add_relationship(&mut self, relationship: Relationship)
Add a relationship between tasks
Sourcepub fn get_relationships_by_type(
&self,
rel_type: RelationshipType,
) -> Vec<&Relationship>
pub fn get_relationships_by_type( &self, rel_type: RelationshipType, ) -> Vec<&Relationship>
Get all relationships of a specific type
Get all tasks that a given task has a relationship with
Sourcepub fn get_dependent_tasks(
&self,
task_id: TaskId,
) -> Vec<(TaskId, RelationshipType)>
pub fn get_dependent_tasks( &self, task_id: TaskId, ) -> Vec<(TaskId, RelationshipType)>
Get all tasks that have a relationship to a given task
Sourcepub fn find_critical_path(&self) -> Vec<TaskId>
pub fn find_critical_path(&self) -> Vec<TaskId>
Find the critical path (longest dependency chain)
Sourcepub fn find_transitive_dependencies(&self, task_id: TaskId) -> HashSet<TaskId>
pub fn find_transitive_dependencies(&self, task_id: TaskId) -> HashSet<TaskId>
Find all transitive dependencies of a task
Sourcepub fn find_tasks_sharing_resource(&self, resource_name: &str) -> Vec<TaskId>
pub fn find_tasks_sharing_resource(&self, resource_name: &str) -> Vec<TaskId>
Find all tasks sharing a resource
Sourcepub fn find_channel_pairs(&self) -> Vec<(TaskId, TaskId)>
pub fn find_channel_pairs(&self) -> Vec<(TaskId, TaskId)>
Find channel communication pairs
Sourcepub fn detect_potential_deadlocks(&self) -> Vec<Vec<TaskId>>
pub fn detect_potential_deadlocks(&self) -> Vec<Vec<TaskId>>
Detect potential deadlocks based on resource sharing
Sourcepub fn to_mermaid(&self) -> String
pub fn to_mermaid(&self) -> String
Generate Mermaid diagram format
Mermaid is a JavaScript-based diagramming tool that renders Markdown-inspired text definitions to create diagrams dynamically.
Sourcepub fn stats(&self) -> GraphStats
pub fn stats(&self) -> GraphStats
Get graph statistics
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more