mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 00:21:08 +01:00
make Query payload public (#991)
This commit is contained in:
parent
cccd829656
commit
c808364c07
@ -6,6 +6,10 @@
|
||||
|
||||
* Re-implement Host predicate (#989)
|
||||
|
||||
### Changed
|
||||
|
||||
* `Query` payload made `pub`. Allows user to pattern-match the payload.
|
||||
|
||||
|
||||
## [1.0.5] - 2019-07-18
|
||||
|
||||
|
@ -36,7 +36,7 @@ use crate::request::HttpRequest;
|
||||
/// // Use `Query` extractor for query information.
|
||||
/// // This handler get called only if request's query contains `username` field
|
||||
/// // The correct request for this handler would be `/index.html?id=64&response_type=Code"`
|
||||
/// fn index(info: web::Query<AuthRequest>) -> String {
|
||||
/// fn index(web::Query(info): web::Query<AuthRequest>) -> String {
|
||||
/// format!("Authorization request for client with id={} and type={:?}!", info.id, info.response_type)
|
||||
/// }
|
||||
///
|
||||
@ -45,7 +45,7 @@ use crate::request::HttpRequest;
|
||||
/// web::resource("/index.html").route(web::get().to(index))); // <- use `Query` extractor
|
||||
/// }
|
||||
/// ```
|
||||
pub struct Query<T>(T);
|
||||
pub struct Query<T>(pub T);
|
||||
|
||||
impl<T> Query<T> {
|
||||
/// Deconstruct to a inner value
|
||||
|
Loading…
Reference in New Issue
Block a user