error-forge 0.9.8

Pragmatic Rust error-handling framework with stable error metadata, contextual diagnostics, optional async support, and synchronous recovery primitives (retry, circuit-breaker, backoff). Optional #[derive(ModError)], declarative define_errors!, and feature-gated logging / tracing / serde adapters.
Documentation
//! Error recovery patterns for handling transient errors
//!
//! This module provides various error recovery strategies that can be used to make
//! applications more resilient to transient failures.
//!
//! # Features
//!
//! - Backoff strategies for controlling retry timing
//! - Circuit breaker pattern to prevent cascading failures
//! - Retry policies for flexible retry behaviors
//! - `ForgeError`-aware retry executors for sync workloads
//!
//! # Examples
//!
//! ```
//! use error_forge::recovery::RetryPolicy;
//!
//! let policy = RetryPolicy::new_exponential().with_max_retries(3);
//!
//! // The operation must declare its error type so the policy can
//! // type-check the retry loop. Here we use `std::io::Error`.
//! let result: Result<(), std::io::Error> = policy.retry(|| Ok(()));
//! assert!(result.is_ok());
//! ```

mod backoff;
mod circuit_breaker;
mod forge_extensions;
mod retry;

pub use backoff::{Backoff, ExponentialBackoff, FixedBackoff, LinearBackoff};
pub use circuit_breaker::{CircuitBreaker, CircuitBreakerConfig, CircuitOpenError, CircuitState};
pub use forge_extensions::ForgeErrorRecovery;
pub use retry::{RetryExecutor, RetryPolicy};

/// Result type for recovery operations
pub type RecoveryResult<T> =
    std::result::Result<T, Box<dyn std::error::Error + Send + Sync + 'static>>;