T must implement serde::Deserialize.
Type signature
Usage
Basic example
Optional query parameters
UseOption fields in your struct to make query parameters optional:
Default values
Combine with#[serde(default)] for default values:
Multiple values
Query parameters with the same name can be collected into aVec:
Error handling
QueryRejection
Returned when the query string cannot be parsed into the target type.
400 Bad Request response.
Parsing from URI
You can also parse query parameters directly from aUri:
Form URL encoding
Query strings use the same encoding asapplication/x-www-form-urlencoded form data. Special characters are percent-encoded: