Module error_ops

Module error_ops 

Source
Expand description

Operations for error recovery and transformation.

This module provides ErrorOps, a trait that extends WithError with additional combinators for recovering from errors and mapping both success and error cases simultaneously.

§Examples

use error_rail::traits::ErrorOps;

let result: Result<i32, &str> = Err("failed");
let recovered = result.recover(|_| Ok(42));
assert_eq!(recovered, Ok(42));

Traits§

ErrorOps
Operations for error recovery and bidirectional mapping.