1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! # modo::extractor
//!
//! Sanitizing axum extractors for request bodies, query strings, and multipart uploads.
//!
//! Every sanitizing extractor calls [`crate::sanitize::Sanitize::sanitize`] on the
//! deserialized value before returning it, so whitespace trimming and other
//! normalization happen automatically. Rejections are [`crate::Error`] values with
//! `400 Bad Request` status, which render through their [`IntoResponse`](axum::response::IntoResponse) impl.
//!
//! `FormRequest`, `Query`, and the text-field side of `MultipartRequest` deserialize
//! through `serde_qs`, so HTML forms can map directly into Rust structs:
//!
//! - Repeated keys (`tag=a&tag=b`) populate `Vec<scalar>` fields — multi-select
//! checkbox groups and dropdown lists.
//! - Bracketed keys (`address[city]=…`) populate nested struct fields.
//! - Indexed brackets (`contacts[0][kind]=…&contacts[0][value]=…`) populate
//! `Vec<Struct>` rows — htmx-added dynamic-row groups and per-row contact lists.
//!
//! All three extractors use `serde_qs` form-encoding mode, so they accept both bare
//! brackets (`?filter[status]=active`) and browser-percent-encoded brackets
//! (`?filter%5Bstatus%5D=active`). `+` decodes as space, matching standard form and
//! query-string conventions.
//!
//! Provides:
//!
//! - [`JsonRequest<T>`] — JSON body (`T: DeserializeOwned + Sanitize`)
//! - [`FormRequest<T>`] — URL-encoded form body (`T: DeserializeOwned + Sanitize`)
//! - [`Query<T>`] — URL query string (`T: DeserializeOwned + Sanitize`)
//! - [`MultipartRequest<T>`] — `multipart/form-data` body split into text fields
//! and a [`Files`] map (`T: DeserializeOwned + Sanitize`)
//! - [`Path`] — URL path parameters, re-exported from axum unchanged
//! (`T: DeserializeOwned`, no sanitization)
//! - [`UploadedFile`] — single file from a multipart field (also directly constructable
//! via [`UploadedFile::from_field`])
//! - [`Files`] — map of field names to uploaded files (also constructable via
//! [`Files::from_map`] for tests)
//! - [`UploadValidator`] — fluent size/content-type validator for [`UploadedFile`]
pub use Path;
pub use FormRequest;
pub use JsonRequest;
pub use ;
pub use Query;
pub use UploadValidator;