Expand description
§modo::extractor
Request extractors for the modo web framework.
All sanitizing extractors call crate::sanitize::Sanitize::sanitize on
the deserialized value before returning it, so whitespace trimming and other
normalization happen automatically.
Path is re-exported directly from axum and behaves identically.
§Extractors
| Extractor | Source | Trait bound |
|---|---|---|
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 | T: DeserializeOwned + Sanitize |
Path | URL path parameters | T: DeserializeOwned |
Service<T> | Service registry | T: Send + Sync + 'static |
ClientInfo | Client IP, user-agent, fingerprint | — |
§Multipart helpers
| Type | Purpose |
|---|---|
UploadedFile | Single file extracted from a multipart field |
Files | Map of field names to uploaded files |
UploadValidator | Fluent size/content-type validator for UploadedFile |
Structs§
- Client
Info - Client request context: IP address, user-agent, and fingerprint.
- Files
- A map of field names to their uploaded files, produced by
MultipartRequest. - Form
Request - Axum extractor that deserializes a URL-encoded form body into
Tand then sanitizes it. - Json
Request - Axum extractor that deserializes a JSON request body into
Tand then sanitizes it. - Multipart
Request - Axum extractor for
multipart/form-datarequests. - Path
- Extractor that will get captures from the URL and parse them using
serde. - Query
- Axum extractor that deserializes URL query parameters into
Tand then sanitizes it. - Service
- Axum extractor that retrieves a service
Tfrom the application’s service registry. - Upload
Validator - Fluent validator for uploaded files.
- Uploaded
File - A single uploaded file extracted from a multipart request.