Skip to main content

Crate larust_validation

Crate larust_validation 

Source
Expand description

FormRequest validation: rule-checking functions and the Laravel-shaped ValidationErrors response. #[derive(FormRequest)] (in larust-macros) generates a per-struct impl axum::extract::FromRequest that calls into rules::* and builds a ValidationErrors on failure - generated per struct (not a blanket impl here) because Rust’s orphan rule forbids implementing a foreign trait like FromRequest over a generic type parameter from this crate.

Re-exports§

pub use form_urlencoded;

Modules§

rules
Rule-checking functions operate on the raw (possibly-absent) string value for a field and return Some(message) on failure. Each rule is independent, matching Laravel’s rule composition: an absent value doesn’t trigger email/length - only required cares about absence.

Structs§

ValidationErrors
Laravel-shaped validation error bag: field name -> messages.