Expand description
Fluent field-level validator — collects all field errors before returning.
§Example
use rskit_validation::Validator;
fn validate_user(name: &str, email: &str) -> rskit_errors::AppResult<()> {
Validator::new()
.required("name", name)
.max_length("name", name, 100)
.email("email", email)
.validate()
}Re-exports§
pub use ::validator;
Modules§
- input
- Validation helpers for path and text inputs.
Structs§
- Field
Error - A single field validation failure.
- Validator
- Fluent builder that collects field errors and converts to
AppErrorviaValidator::validate.
Traits§
- Validate
- This is the original trait that was implemented by deriving
Validate. It will still be implemented for struct validations that don’t take custom arguments. The call is being forwarded to theValidateArgs<'v_a>trait.
Functions§
- validate_
email - Returns
trueifvaluelooks like a valid e-mail address. - validate_
url - Returns
trueifvalueis an absolute HTTP or HTTPS URL. - validate_
uuid - Returns
trueifvalueis a valid UUID (any version, hyphenated or not).