1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-02 13:29:24 +00:00

make Query payload public (#991)

This commit is contained in:
jesskfullwood 2019-07-19 10:47:44 +01:00 committed by Nikolay Kim
parent cccd829656
commit c808364c07
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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