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
PathExtractor
that does not extract/store any data from theRequest
path. - Noop
Query String Extractor - A
QueryStringExtractor
that does not extract/store any data.
Traits§
- Path
Extractor - Defines a binding for storing the dynamic segments of the
Request
path inState
. On failure theStaticResponseExtender
implementation extends theResponse
to indicate why the extraction process failed. - Query
String Extractor - Defines a binding for storing the query parameters from the
Request
URI inState
. On failure theStaticResponseExtender
implementation extends theResponse
to indicate why the extraction process failed.