error_rail/traits/mod.rs
1//! Core traits for error handling and composition.
2//!
3//! This module defines the fundamental traits that enable error-rail's composable
4//! error handling patterns:
5//!
6//! - [`ErrorCategory`]: Categorical abstraction for lifting values and handling errors
7//! - [`ErrorOps`]: Operations for error recovery and bidirectional mapping
8//! - [`IntoErrorContext`]: Conversion trait for creating structured error contexts
9//! - [`WithError`]: Abstraction for types that carry remappable error variants
10//!
11//! # Examples
12//!
13//! ```
14//! use error_rail::traits::{ErrorCategory, IntoErrorContext};
15//! use error_rail::{ComposableError, ErrorContext};
16//!
17//! // Using ErrorCategory to lift values
18//! let success: Result<i32, String> = <Result<(), String>>::lift(42);
19//!
20//! // Using IntoErrorContext for structured contexts
21//! let err = ComposableError::<&str>::new("failed")
22//! .with_context("operation context");
23//! ```
24
25pub mod error_category;
26pub mod error_ops;
27pub mod into_error_context;
28pub mod result_ext;
29pub mod with_error;
30
31pub use error_category::ErrorCategory;
32pub use error_ops::ErrorOps;
33pub use into_error_context::IntoErrorContext;
34pub use result_ext::{BoxedResultExt, ResultExt};
35pub use with_error::WithError;