#[error_strategy]Expand description
The error_strategy attribute macro
This macro transforms an async function that returns Result<T, E> into one that
returns PipexResult<T, E>, allowing the pipex library to apply the specified
error handling strategy.
§Arguments
strategy- The error handling strategy type (e.g.,IgnoreHandler,CollectHandler)
§Example
ⓘ
use pipex_macros::error_strategy;
#[error_strategy(IgnoreHandler)]
async fn process_item(x: i32) -> Result<i32, String> {
if x % 2 == 0 {
Ok(x * 2)
} else {
Err("Odd number".to_string())
}
}The generated function will automatically wrap the result in a PipexResult
with the specified strategy name, allowing the pipeline to handle errors
according to the strategy.