Decrust-Core 🦀🔧
Advanced Error Handling Framework for Rust - Core Components
Decrust-Core is the foundation of the Decrust error handling framework, providing comprehensive, production-ready error handling with rich error context, automatic error recovery, circuit breaker patterns, and powerful debugging capabilities.
🚀 Quick Start
use ;
// Basic error creation with rich context
🎯 Core Features
1. Rich Error Context 📍
Every error includes comprehensive context with location tracking, severity levels, and metadata for better debugging and monitoring.
use ;
// Create rich error context with metadata
let context = error_context!.with_component
.with_correlation_id
.with_recovery_suggestion;
2. Circuit Breaker Pattern ⚡
Built-in circuit breaker for handling external service failures gracefully.
use ;
use Duration;
// Configure circuit breaker
let config = CircuitBreakerConfig ;
let circuit_breaker = new;
// Execute operations through circuit breaker
let result = circuit_breaker.execute;
3. Automatic Error Recovery 🔄
Smart error recovery with configurable retry strategies and fix suggestions.
use ;
let mut decrust = new;
// Apply fixes automatically
if let Some = decrust.suggest_autocorrection
4. Powerful Macros 🛠️
Ergonomic macros for common error handling patterns.
use ;
// Quick error creation
let error = oops!;
// Validation errors with suggestions
let validation_err = validation_error!;
// Rich context with location tracking
let context = error_context!;
let loc = location!;
5. Comprehensive Error Types 📋
Pre-built error variants for common scenarios with rich metadata.
use ;
// Network errors with retry information
let network_error = Network ;
// Configuration errors with suggestions
let config_error = Config ;
🏗️ Architecture
Decrust-Core provides the following modules:
backtrace- Enhanced backtrace capture and analysiscircuit_breaker- Circuit breaker pattern implementationdecrust- Core error handling and autocorrection enginereporter- Error reporting and formattingsyntax- AST-driven fix generation and templatestypes- Core type definitions and utilities
📚 Feature Flags
std-thread: Enables threading support for circuit breaker timeoutsserde: Enables serialization support for error typestracing: Enables integration with the tracing ecosystem
🎨 Best Practices
- Use specific error variants for different error categories
- Add rich context with
decrust_context_msg()for better debugging - Implement circuit breakers for external service calls
- Use macros for common error patterns to reduce boilerplate
- Configure error reporting for production monitoring
- Create domain-specific error types that convert to
DecrustError
🛡️ Licensing
This project is licensed under the Business Source License 1.1 (BSL 1.1).
- ✅ Non-production use is FREE (development, testing, academic, personal)
- 💰 Commercial/production use requires a paid license from ArcMoon Studios
- 📧 Contact: LordXyn@proton.me for commercial licensing inquiries
Change Date: 2029-05-25 | Change License: GNU GPL v3
Made with ❤️ by ArcMoon Studios