Skip to main content

TaskNodeData

Trait TaskNodeData 

Source
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§

Source

fn dependency_names(&self) -> impl Iterator<Item = &str>

Returns an iterator over the names of tasks this task depends on.

Provided Methods§

Source

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.

Source

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".

Implementors§