Module traits

Module traits 

Source
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 errors
  • ErrorOps: Operations for error recovery and bidirectional mapping
  • IntoErrorContext: Conversion trait for creating structured error contexts
  • WithError: 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