{"id":57537,"library":"validator","title":"Validator","description":"Common validation functions (email, url, length, ...) and trait to be used with `validator_derive`.","status":"active","version":"0.20.0","language":"rust","source_language":null,"source_url":"https://github.com/Keats/validator","tags":["validation","derive","email","length","form"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nvalidator = \"0.20.0\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add validator","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"Validate","correct":"use validator::Validate;"}],"quickstart":{"code":"use validator::Validate;\n\n#[derive(Validate)]\nstruct Signup {\n    #[validate(email)]\n    email: String,\n    #[validate(length(min = 8))]\n    password: String,\n}\n\nfn main() {\n    let s = Signup { email: \"invalid\".into(), password: \"short\".into() };\n    match s.validate() {\n        Ok(_) => println!(\"valid\"),\n        Err(e) => println!(\"errors: {:?}\", e),\n    }\n}","lang":"rust","description":"Validates a struct with email and length constraints."},"warnings":[{"fix":"Add `validator_derive` to your Cargo.toml with the same version as `validator`.","message":"The `Validate` derive macro requires the `validator_derive` crate as a separate dependency.","severity":"gotcha","affected_versions":">=0.20.0"}],"env_vars":null,"search_vec":"'common':2 'deriv':15,17 'email':5,18 'form':20 'function':4 'length':7,19 'trait':9 'url':6 'use':12 'valid':1,3,14,16","created_at":"2026-06-16T15:46:25.001495+00:00","updated_at":"2026-06-16T15:46:25.001495+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Keats/validator","github":"https://github.com/Keats/validator","docs":"https://docs.rs/validator/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}