#[task]Expand description
Transforms an async function into a CoreTask implementation.
§Attributes
id = "custom_name"— override the task ID (default: function name)display_name = "Charge Card"— human-readable namedescription = "Charges the customer's card"— task descriptiontimeout = "30s"— task timeout (supportsms,s,m,hsuffixes)retries = 3— maximum retry countbackoff = "100ms"— initial retry delaybackoff_multiplier = 2.0— exponential multiplier (default: 2.0)tags = "io"— categorization tags (can be repeated)
§Parameters
- Exactly one non-
#[inject]parameter: the task input type - Zero or more
#[inject]parameters: dependency-injected fields
§Return Types
Result<T, E>— fallible;Eis converted viaInto<BoxError>T— infallible; automatically wrapped inOk(...)
§Generated Code
- A PascalCase struct (e.g.,
fn charge→struct Charge) new()constructor with positional args for injected dependenciestask_id()andmetadata()helper methodsregister()method forTaskRegistryintegrationCoreTasktrait implementation- The original function is preserved for direct use/testing