#[compensatable_task]Expand description
Apply to the CompensatableTask trait definition, an
impl CompensatableTask<S [, K]> for T block, or — for less boilerplate — an
inherent impl T { ... } block.
Use as #[cano::saga::task].
Two surface forms on impl blocks:
- Trait-impl form:
#[saga::task] impl CompensatableTask<S> for T { type Output = O; async fn run(..); async fn compensate(..); }— user writes the trait header. - Inherent-impl form:
#[saga::task(state = S [, key = K])] impl T { type Output = O; async fn run(..); async fn compensate(..); }— the macro builds theimpl CompensatableTask<S [, K]> for Theader from the attribute args and enforces thattype Output,run, andcompensateare present (config/namemay be overridden).
Either way, every async fn is rewritten to return
Pin<Box<dyn Future<Output = ...> + Send + 'async_trait>>. On the trait definition the macro
just performs that rewrite.