Simple, lightweight, low-alloc error handling crate for Rust.
ResExt provides a declarative macro (ResExt! {}) for easy, ergonomic and performant error-handling.
Quick Start
Add ResExt to your dependencies:
- or add this to your Cargo.toml:
[]
= "0.7.0"
Basic Usage
use ResExt;
ResExt!
This code generates:
MyErrorenum withError,DebugandDisplayimplementationsFrom<T> for MyErrorfor types of the enum's tuple variantsResErrstruct for context wrapper aroundMyErrorResExttrait with context methodsRes<T>type alias forResult<T, MyError>
Example
use ResExt;
use io;
use crateData;
ResExt!
async
ResExt uses a unique approach for error-handling that provides anyhow methods and convenient error-propagation as well as thiserror's performance and concrete types with a macro that generates both methods and the error enum locally in your project.
Notes
- ResExt is still in heavy development, wait for v1.0.0 to rely on it for production code.
- For changes, see CHANGELOG.md.
- For contribution details, see CONTRIBUTING.md.
- This project is licensed under the MIT license.