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//! | [`Service<T>`] | Service registry | `T: Send + Sync + 'static` |
21//! | [`ClientInfo`] | Client IP, user-agent, fingerprint | — |
22//!
23//! ## Multipart helpers
24//!
25//! | Type | Purpose |
26//! |---|---|
27//! | [`UploadedFile`] | Single file extracted from a multipart field |
28//! | [`Files`] | Map of field names to uploaded files |
29//! | [`UploadValidator`] | Fluent size/content-type validator for [`UploadedFile`] |
30
31mod client_info;
32mod form;
33mod json;
34mod multipart;
35mod query;
36mod service;
37mod upload_validator;
38
39pub use axum::extract::Path;
40pub use client_info::ClientInfo;
41pub use form::FormRequest;
42pub use json::JsonRequest;
43pub use multipart::{Files, MultipartRequest, UploadedFile};
44pub use query::Query;
45pub use service::Service;
46pub use upload_validator::UploadValidator;