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 with_error;
29
30pub use error_category::ErrorCategory;
31pub use error_ops::ErrorOps;
32pub use into_error_context::IntoErrorContext;
33pub use with_error::WithError;