larust_validation/lib.rs
1//! FormRequest validation: rule-checking functions and the Laravel-shaped
2//! `ValidationErrors` response. `#[derive(FormRequest)]` (in
3//! `larust-macros`) generates a per-struct `impl axum::extract::FromRequest`
4//! that calls into `rules::*` and builds a `ValidationErrors` on failure -
5//! generated per struct (not a blanket impl here) because Rust's orphan
6//! rule forbids implementing a foreign trait like `FromRequest` over a
7//! generic type parameter from this crate.
8
9mod errors;
10pub mod rules;
11
12pub use errors::ValidationErrors;
13
14/// Re-exported for `#[derive(FormRequest)]`'s generated code, which parses
15/// the raw request body itself rather than going through axum's `Form`
16/// extractor (see `larust-macros`' `form_request` module for why).
17pub use form_urlencoded;