| Crates.io | rod_derive |
| lib.rs | rod_derive |
| version | 0.2.3 |
| created_at | 2025-09-20 07:33:37.918969+00 |
| updated_at | 2025-09-30 10:07:49.315879+00 |
| description | Procedural macro for the Rod Validation library |
| homepage | |
| repository | https://github.com/kommade/rod/tree/master/rod_derive |
| max_upload_size | |
| id | 1847490 |
| size | 150,813 |
Procedural macro for the Rod Validation library. This crate provides the #[derive(RodValidate)] macro that generates validation code based on field attributes.
rod_derive is the procedural macro component of the Rod Validation framework. It automatically generates validation implementations for structs and enumerations based on declarative attributes.
This crate is typically used through the main rod_validation crate and not directly.
Add Rod Validation to your Cargo.toml:
[dependencies]
rod_validation = "0.2.2"
The derive macro is available through the prelude:
use rod_validation::prelude::*;
#[derive(RodValidate)]
struct User {
#[rod(String {
length: 3..=50,
format: Email,
})]
email: String,
}
For complete documentation, examples, technical details, and all supported validation attributes, see the main Rod Validation crate documentation and README.
This includes:
? "message" syntaxproc-macro2 - Token manipulationquote - Code generationsyn - Rust syntax parsingproc-macro-error - Enhanced error reportingThis project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.