Expand description
The cdumay_error_derive crate provides procedural macros to simplify the creation of custom error types in Rust. By leveraging these macros,
developers can efficiently define error structures that integrate seamlessly with the cdumay_error error management ecosystem.
§Overview
Error handling in Rust often involves creating complex structs to represent various error kinds and implementing traits to provide context and
conversions. The cdumay_error_derive crate automates this process by offering macros that generate the necessary boilerplate code, allowing for
more readable and maintainable error definitions.
§Features
- Macros: Automatically generate implementations for custom error types.
- Integration with cdumay_error: Designed to work cohesively with the
cdumay_errorcrate, ensuring consistent error handling patterns.
§Usage
See cdumay_error documentation for more information.
Macros§
- define_
errors - The
define_errorsmacro is a procedural macro that generates structured error types implementingcdumay_error::AsError. This macro simplifies error handling by defining error structures with relevant metadata, serialization, and error conversion logic. - define_
kinds - The
define_kindsmacro is a procedural macro that generates constants of typecdumay_error::ErrorKind. This macro simplifies the definition of structured error kinds by allowing developers to declare them using a concise syntax. It takes a list of error definitions and expands them into properly structuredcdumay_error::ErrorKindconstants.