errcraft 0.1.0

Beautiful, structured, and colorful error handling for Rust.
Documentation
//! # errcraft
//!
//! Beautiful, structured, and colorful error handling for Rust.
//!
//! ## Overview
//!
//! `errcraft` provides a composable error type that supports:
//! - Rich context with key-value pairs and text annotations
//! - Nested error chaining with beautiful tree rendering
//! - Colorful CLI output with emoji support
//! - Smart backtrace capture and filtering
//! - JSON and Markdown serialization
//! - Integration with popular error handling crates
//!
//! ## Quick Start
//!
//! ```rust
//! use errcraft::ErrFrame;
//!
//! fn read_config(path: &str) -> Result<String, ErrFrame> {
//!     std::fs::read_to_string(path).map_err(|e| {
//!         ErrFrame::new("Failed to read config file")
//!             .context("path", path.to_string())
//!             .with_source(e)
//!     })
//! }
//! ```
//!
//! ## Features
//!
//! - `std` (default): Standard library support with `std::error::Error`
//! - `backtrace` (default): Capture and display backtraces
//! - `colors-owo` (default): Colorful output using owo-colors
//! - `serde`: JSON serialization support
//! - `markdown`: Markdown rendering utilities
//! - `emoji`: Enable emoji glyphs in output
//! - Integration features: `anyhow`, `eyre`, `thiserror`, `tracing`, `axum`

#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(missing_docs)]
#![deny(unsafe_code)]

#[cfg(feature = "std")]
extern crate std;

#[cfg(not(feature = "std"))]
extern crate alloc;

mod context;
mod frame;
mod result;
mod utils;

#[cfg(feature = "std")]
mod display;

#[cfg(all(feature = "std", feature = "backtrace"))]
mod backtrace;

#[cfg(feature = "serde")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
mod serde_support;

#[cfg(any(
    feature = "anyhow",
    feature = "eyre",
    feature = "thiserror",
    feature = "tracing",
    feature = "axum"
))]
#[cfg_attr(
    docsrs,
    doc(cfg(any(
        feature = "anyhow",
        feature = "eyre",
        feature = "thiserror",
        feature = "tracing",
        feature = "axum"
    )))
)]
mod integration;

mod macros;

// Public exports
pub use context::{ContextLayer, ContextValue};
pub use frame::ErrFrame;
pub use result::ErrResult;

#[cfg(feature = "std")]
pub use display::{BacktraceMode, ColorMode, DisplayOptions};

// Feature-gated integrations are in the integration module
// but don't export anything at the crate root since they extend existing types

// Note: Color backend conflicts should be checked via cargo features
// When using --all-features, multiple color backends may be enabled
// The last one in the conditional compilation chain will be used