pub struct TaskGraph { /* private fields */ }Implementations§
Source§impl TaskGraph
impl TaskGraph
pub fn new() -> Self
Sourcepub fn add_dependency(&mut self, from: &str, to: &str) -> Result<(), Error>
pub fn add_dependency(&mut self, from: &str, to: &str) -> Result<(), Error>
Add a dependency relationship between tasks
Sourcepub fn remove_node(&mut self, node_id: &str) -> Result<(), Error>
pub fn remove_node(&mut self, node_id: &str) -> Result<(), Error>
Remove a task node from the graph
Sourcepub fn get_node_mut(&mut self, node_id: &str) -> Option<&mut TaskNode>
pub fn get_node_mut(&mut self, node_id: &str) -> Option<&mut TaskNode>
Get a mutable task node by ID
Sourcepub fn get_dependents(&self, node_id: &str) -> Option<&HashSet<String>>
pub fn get_dependents(&self, node_id: &str) -> Option<&HashSet<String>>
Get dependent tasks (tasks that depend on this task)
Sourcepub fn get_dependencies(&self, node_id: &str) -> Option<&HashSet<String>>
pub fn get_dependencies(&self, node_id: &str) -> Option<&HashSet<String>>
Get dependency tasks (tasks that this task depends on)
Sourcepub fn has_cycles(&self) -> bool
pub fn has_cycles(&self) -> bool
Check if the graph has cycles
Sourcepub fn get_ready_tasks(&self) -> Vec<String>
pub fn get_ready_tasks(&self) -> Vec<String>
Get ready-to-execute tasks (all dependencies satisfied)
Sourcepub fn get_statistics(&self) -> TaskGraphStatistics
pub fn get_statistics(&self) -> TaskGraphStatistics
Get execution 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> 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