Expand description
Extracts request data into type-safe structs using Serde.
Extractors are added to route definitions when defining a Router. The PathExtractor and
QueryStringExtractor traits provide usage examples.
The request data is extracted by the Route implementation when dispatching the request. The
application-provided data structure which implements the extractor trait is used to deserialize
the data and store it within the request State before the request is dispatched to the
Handler.
Structs§
- Noop
Path Extractor - A
PathExtractorthat does not extract/store any data from theRequestpath. - Noop
Query String Extractor - A
QueryStringExtractorthat does not extract/store any data.
Traits§
- Path
Extractor - Defines a binding for storing the dynamic segments of the
Requestpath inState. On failure theStaticResponseExtenderimplementation extends theResponseto indicate why the extraction process failed. - Query
String Extractor - Defines a binding for storing the query parameters from the
RequestURI inState. On failure theStaticResponseExtenderimplementation extends theResponseto indicate why the extraction process failed.