Enable tasks to accept ANY type implementing Clone + Send + Sync as dependencies, without requiring users to implement ExtractInput trait. The #[task] macro now generates task-specific extraction logic inline via a new extract_and_run() method. This leverages the macro's perfect compile-time knowledge of parameter types to handle extraction for: - Zero parameters (unit type, source tasks) - Single parameter (any Clone + Send + Sync type) - Multiple parameters (tuples, awaited concurrently) Previously, only hardcoded primitive types and specific stdlib types worked. Custom user types required manual ExtractInput implementations. Now custom types work automatically with zero API changes. Changes: - Add extract_and_run() method to Task trait (internal/hidden) - Generate inline extraction in #[task] macro based on parameter count - Remove ExtractInput bound from DagRunner::add_task() - Retain ExtractInput for internal task_fn() test helper - Add comprehensive custom type tests No breaking changes - purely internal implementation improvement.
dagx-macros
Procedural macros for dagx.
This crate provides the #[task] attribute macro. You typically don't need to depend on this directly—it's included automatically when you use dagx.
Usage
See the dagx documentation for usage examples.
The #[task] macro automatically implements the Task trait by deriving input and output types from your run() method signature.
License
MIT