From 4b1a471b35881937a62f3f511051e02e7252cd50 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 10 May 2018 13:03:43 -0700 Subject: [PATCH] add more examples for extractor config --- src/with.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/with.rs b/src/with.rs index 099bcea4f..fa4f4dc41 100644 --- a/src/with.rs +++ b/src/with.rs @@ -39,6 +39,32 @@ use httpresponse::HttpResponse; /// ); /// } /// ``` +/// +/// Same could be donce with multiple extractors +/// +/// ```rust +/// # extern crate actix_web; +/// #[macro_use] extern crate serde_derive; +/// use actix_web::{App, Form, Path, Result, http}; +/// +/// #[derive(Deserialize)] +/// struct FormData { +/// username: String, +/// } +/// +/// fn index(data: (Path<(String,)>, Form)) -> Result { +/// Ok(format!("Welcome {}!", data.1.username)) +/// } +/// +/// fn main() { +/// let app = App::new().resource( +/// "/index.html", |r| { +/// r.method(http::Method::GET) +/// .with(index) +/// .1.limit(4096);} // <- change form extractor configuration +/// ); +/// } +/// ``` pub struct ExtractorConfig> { cfg: Rc>, }