pub trait TaskNodeData: Clone {
// Required method
fn dependency_names(&self) -> impl Iterator<Item = &str>;
// Provided methods
fn add_dependency(&mut self, _dep: String) { ... }
fn has_dependency(&self, name: &str) -> bool { ... }
}Expand description
Trait for task data that can be stored in the task graph.
Implement this trait for your task type to enable it to be stored
in a TaskGraph and participate in dependency resolution.
Required Methods§
Sourcefn dependency_names(&self) -> impl Iterator<Item = &str>
fn dependency_names(&self) -> impl Iterator<Item = &str>
Returns an iterator over the names of tasks this task depends on.
Provided Methods§
Sourcefn add_dependency(&mut self, _dep: String)
fn add_dependency(&mut self, _dep: String)
Adds a dependency to this task by name.
Default implementation panics. Override this method if mutation is needed (e.g., for applying group-level dependencies to subtasks).
§Panics
Panics if not overridden - implement for task types that need mutable dependency addition.
Sourcefn has_dependency(&self, name: &str) -> bool
fn has_dependency(&self, name: &str) -> bool
Returns true if this task has a dependency on the given task name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".