Skip to main content

Module extractor

Module extractor 

Source
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

ExtractorSourceTrait bound
JsonRequest<T>JSON bodyT: DeserializeOwned + Sanitize
FormRequest<T>URL-encoded form bodyT: DeserializeOwned + Sanitize
Query<T>URL query stringT: DeserializeOwned + Sanitize
MultipartRequest<T>multipart/form-data bodyT: DeserializeOwned + Sanitize
PathURL path parametersT: DeserializeOwned

§Multipart helpers

TypePurpose
UploadedFileSingle file extracted from a multipart field; also constructable via UploadedFile::from_field for advanced use
FilesMap of field names to uploaded files; constructable via Files::from_map for testing or pre-built maps
UploadValidatorFluent size/content-type validator for UploadedFile

Structs§

Files
A map of field names to their uploaded files, produced by MultipartRequest.
FormRequest
Axum extractor that deserializes a URL-encoded form body into T and then sanitizes it.
JsonRequest
Axum extractor that deserializes a JSON request body into T and then sanitizes it.
MultipartRequest
Axum extractor for multipart/form-data requests.
Path
Extractor that will get captures from the URL and parse them using serde.
Query
Axum extractor that deserializes URL query parameters into T and then sanitizes it.
UploadValidator
Fluent validator for uploaded files.
UploadedFile
A single uploaded file extracted from a multipart request.