Registry / utility / garde
library0.22.1rscratesunverified

Validation library for Rust with derive macros and custom validators.

# Cargo.toml [dependencies] garde = "0.22.1"
INSTALL
IMPORT
SIG · GARDE
G
garde
utilityrustv0.22.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Validate
✓ use garde::Validate;

Validates a struct field using garde's derive macro.

use garde::Validate; #[derive(Validate)] struct User { #[garde(length(min=3, max=20))] name: String, } fn main() { let user = User { name: "Al".to_string() }; if let Err(e) = user.validate() { println!("Validation error: {:?}", e); } }
Debug
Known issues
gotchaRequires derive macro feature; may conflict with other validation crates.
fix
Enable the 'derive' feature in Cargo.toml.
affects: >=0.22.0
Upgrade
Version history
0.22.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
garde — cargo add garde · libregistry