3 releases

new 0.1.2 Jan 5, 2025
0.1.1 Dec 29, 2024
0.1.0 Dec 28, 2024

#1254 in Rust patterns

Download history 195/week @ 2024-12-25 165/week @ 2025-01-01

360 downloads per month

Apache-2.0

9KB
190 lines

Valid8

A simple validation library.

Example

Use the validators to validate values.

use valid8::Validator;
use valid8::validator::Min;

let validator = Min::<u32>::new(5);
let invalid = "1234";
assert!(validator.validate(&invalid).is_err());

let valid = "12345";
assert!(validator.validate(&valid).is_ok());

Use the derive(Validate) macro to generate validation code for structs.

Dependencies

~2–3MB
~56K SLoC