Crates.io | decrust |
lib.rs | decrust |
version | 1.2.6 |
created_at | 2025-05-23 23:35:01.229747+00 |
updated_at | 2025-05-25 19:31:42.798544+00 |
description | The ultimate all-in-one error handling framework for Rust - use decrust::* and decrust!(any_operation()) |
homepage | |
repository | https://github.com/arcmoonstudios/decrust |
max_upload_size | |
id | 1686861 |
size | 91,338 |
*The Ultimate All-in-One Error Handling Framework for Rust
Decrust is a revolutionary error handling framework that transforms how you deal with errors in Rust. With 96% automation rate, intelligent autocorrection, and comprehensive error analysis, Decrust makes error handling effortless and robust.
Add Decrust to your Cargo.toml
:
[dependencies]
decrust = "1.2"
Use the decrust!
macro for automatic error handling:
use decrust::*;
fn any_operation() -> Result<String> {
Ok("Success!".to_string())
}
fn main() -> Result<()> {
let result = decrust!(any_operation());
// 96% of errors are automatically fixed with M.A.R.S. system
// CrossModuleAutomationEngine + CircuitBreakerProtection + HeuristicRecovery
Ok(())
}
decrust!
Can Handleuse decrust::*;
fn complex_operation() -> Result<String> {
// File operations with automatic error handling
let config = decrust!(std::fs::read_to_string("config.toml"));
// Rich error context
let data = std::fs::read_to_string("data.txt")
.decrust_context_msg("Loading application data")?;
// Validation with automatic suggestions
if data.is_empty() {
return Err(validation_error!("data", "Data cannot be empty"));
}
Ok("Success".to_string())
}
// Manual error handling - verbose and error-prone
match std::fs::read_to_string("config.toml") {
Ok(content) => {
match toml::from_str::<Config>(&content) {
Ok(config) => {
// Finally use the config...
}
Err(e) => {
eprintln!("Parse error: {}", e);
std::process::exit(1);
}
}
}
Err(e) => {
eprintln!("File error: {}", e);
std::process::exit(1);
}
}
// Automatic error handling - clean and robust
use decrust::*;
decrust! {
let config: Config = std::fs::read_to_string("config.toml")?
.parse()?;
// Use config directly - all errors handled automatically!
}
Decrust consists of several integrated components:
decrust-core
- Core error handling frameworkdecrust-promac-runtime
- Runtime middleware and utilitiesdecrust_promac
- Procedural macros and code generationdecrust
- Main public interface (this crate)This project is licensed under the Business Source License 1.1 (BSL 1.1).
Change Date: 2029-05-25 | Change License: GNU GPL v3
We welcome contributions! Please see our Contributing Guide for details.
Issues: GitHub Issues
Discussions: GitHub Discussions
Commercial Support LordXyn@proton.me
Made with ❤️ by ArcMoon Studios