Skip to main content

Crate rskit_validation

Crate rskit_validation 

Source
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§

FieldError
A single field validation failure.
Validator
Fluent builder that collects field errors and converts to AppError via Validator::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 the ValidateArgs<'v_a> trait.

Functions§

validate_email
Returns true if value looks like a valid e-mail address.
validate_url
Returns true if value is an absolute HTTP or HTTPS URL.
validate_uuid
Returns true if value is a valid UUID (any version, hyphenated or not).