modo/extractor/mod.rs
1//! # modo::extractor
2//!
3//! Request extractors for the modo web framework.
4//!
5//! All sanitizing extractors call [`crate::sanitize::Sanitize::sanitize`] on
6//! the deserialized value before returning it, so whitespace trimming and other
7//! normalization happen automatically.
8//!
9//! [`Path`] is re-exported directly from axum and behaves identically.
10//!
11//! ## Extractors
12//!
13//! | Extractor | Source | Trait bound |
14//! |---|---|---|
15//! | [`JsonRequest<T>`] | JSON body | `T: DeserializeOwned + Sanitize` |
16//! | [`FormRequest<T>`] | URL-encoded form body | `T: DeserializeOwned + Sanitize` |
17//! | [`Query<T>`] | URL query string | `T: DeserializeOwned + Sanitize` |
18//! | [`MultipartRequest<T>`] | `multipart/form-data` body | `T: DeserializeOwned + Sanitize` |
19//! | [`Path`] | URL path parameters | `T: DeserializeOwned` |
20//!
21//! ## Multipart helpers
22//!
23//! | Type | Purpose |
24//! |---|---|
25//! | [`UploadedFile`] | Single file extracted from a multipart field; also constructable via [`UploadedFile::from_field`] for advanced use |
26//! | [`Files`] | Map of field names to uploaded files; constructable via [`Files::from_map`] for testing or pre-built maps |
27//! | [`UploadValidator`] | Fluent size/content-type validator for [`UploadedFile`] |
28
29mod form;
30mod json;
31mod multipart;
32mod query;
33mod upload_validator;
34
35pub use axum::extract::Path;
36pub use form::FormRequest;
37pub use json::JsonRequest;
38pub use multipart::{Files, MultipartRequest, UploadedFile};
39pub use query::Query;
40pub use upload_validator::UploadValidator;