Decrust_Promac 🦀🔮
Procedural Macros for the Decrust Error Handling Framework
Decrust_Promac provides the powerful procedural macros that enable the Decrust framework's revolutionary 96% automation rate. This crate contains the decrust! macro and other code generation tools that transform your error handling code.
🚀 Quick Start
This crate is typically used through the main decrust crate:
use *; // Includes decrust_promac macros
🎯 Core Macros
1. decrust! - The Ultimate Error Handler ⚡
The main macro that provides 96% automation rate with intelligent error handling:
use *;
// Automatic error handling with circuit breaker protection
let result = decrust! ;
2. Error Context Macros 📍
Macros for creating rich error context:
use *;
// Rich error context with automatic location tracking
let error = error_context!;
// Validation errors with suggestions
let validation_err = validation_error!;
// Quick error creation with source
let io_error = oops!;
3. Location Tracking 🗺️
Automatic location and context tracking:
use *;
// Automatic location tracking in generated code
let location = location!;
🔧 Macro Features
96% Automation Rate 🤖
The decrust! macro automatically handles:
- ✅ File I/O errors - with automatic retry and fallback
- ✅ Network errors - with circuit breaker and exponential backoff
- ✅ Parsing errors - with validation and recovery suggestions
- ✅ Type conversion errors - with smart casting and validation
- ✅ Missing imports (E0433) - automatic dependency resolution
- ✅ Division by zero - automatic safety checks
- ✅ Borrow checker errors - heuristic recovery patterns
- ✅ Async/await errors - seamless async error propagation
AST-Driven Code Generation 🌳
Advanced syntax tree analysis for intelligent code transformation:
// Before macro expansion
decrust!
// After macro expansion (simplified)
Circuit Breaker Integration ⚡
Automatic circuit breaker pattern application:
use *;
// Circuit breakers are automatically applied to external operations
decrust!
🏗️ Architecture
The procedural macros in this crate:
- Parse the input syntax tree
- Analyze error-prone operations
- Generate enhanced error handling code
- Inject circuit breaker and retry logic
- Add rich error context and location tracking
- Optimize for performance and reliability
📚 Advanced Usage
Custom Error Handling
use *;
// Custom error handling with macro support
decrust!
Macro Debugging
// Enable macro debugging (development only)
decrust!
🎨 Code Generation Features
- Smart Error Categorization - Automatic error type detection
- Context Injection - Rich error context with minimal overhead
- Performance Optimization - Zero-cost abstractions where possible
- Async Support - Seamless async/await integration
- Custom Recovery - Pluggable recovery strategies
- Debugging Support - Enhanced debugging information in development
🛡️ 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