Expand description
Core traits for error handling and composition Core traits for error handling and composition.
This module defines the fundamental traits that enable error-rail’s composable error handling patterns:
ErrorCategory: Categorical abstraction for lifting values and handling errorsErrorOps: Operations for error recovery and bidirectional mappingIntoErrorContext: Conversion trait for creating structured error contextsWithError: Abstraction for types that carry remappable error variants
§Examples
use error_rail::traits::{ErrorCategory, IntoErrorContext};
use error_rail::{ComposableError, ErrorContext};
// Using ErrorCategory to lift values
let success: Result<i32, String> = <Result<(), String>>::lift(42);
// Using IntoErrorContext for structured contexts
let err = ComposableError::<&str, u32>::new("failed")
.with_context("operation context");Re-exports§
pub use error_category::ErrorCategory;pub use error_ops::ErrorOps;pub use into_error_context::IntoErrorContext;pub use with_error::WithError;
Modules§
- error_
category - error_
ops - Operations for error recovery and transformation.
- into_
error_ context - Trait for converting types into structured error context.
- with_
error