1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-28 01:52:57 +01:00

update doc strings for extractors

This commit is contained in:
Nikolay Kim 2018-04-06 10:24:57 -07:00
parent 2c411a04a9
commit 084104d058
2 changed files with 14 additions and 2 deletions

View File

@ -183,6 +183,9 @@ impl<T, S> FromRequest<S> for Query<T>
/// To extract typed information from request's body, the type `T` must implement the /// To extract typed information from request's body, the type `T` must implement the
/// `Deserialize` trait from *serde*. /// `Deserialize` trait from *serde*.
/// ///
/// [**FormConfig**](dev/struct.FormConfig.html) allows to configure extraction
/// process.
///
/// ## Example /// ## Example
/// ///
/// It is possible to extract path information to a specific type that implements /// It is possible to extract path information to a specific type that implements
@ -199,7 +202,7 @@ impl<T, S> FromRequest<S> for Query<T>
/// } /// }
/// ///
/// /// extract form data using serde /// /// extract form data using serde
/// /// this handle get called only if content type is *x-www-form-urlencoded* /// /// this handler get called only if content type is *x-www-form-urlencoded*
/// /// and content of the request could be deserialized to a `FormData` struct /// /// and content of the request could be deserialized to a `FormData` struct
/// fn index(form: Form<FormData>) -> Result<String> { /// fn index(form: Form<FormData>) -> Result<String> {
/// Ok(format!("Welcome {}!", form.username)) /// Ok(format!("Welcome {}!", form.username))
@ -249,7 +252,8 @@ impl<T, S> FromRequest<S> for Form<T>
/// username: String, /// username: String,
/// } /// }
/// ///
/// /// extract form data using serde, max payload size is 4k /// /// extract form data using serde.
/// /// custom configuration is used for this handler, max payload size is 4k
/// fn index(form: Form<FormData>) -> Result<String> { /// fn index(form: Form<FormData>) -> Result<String> {
/// Ok(format!("Welcome {}!", form.username)) /// Ok(format!("Welcome {}!", form.username))
/// } /// }
@ -286,6 +290,9 @@ impl Default for FormConfig {
/// ///
/// Loads request's payload and construct Bytes instance. /// Loads request's payload and construct Bytes instance.
/// ///
/// [**PayloadConfig**](dev/struct.PayloadConfig.html) allows to configure extraction
/// process.
///
/// ## Example /// ## Example
/// ///
/// ```rust /// ```rust
@ -322,6 +329,9 @@ impl<S: 'static> FromRequest<S> for Bytes
/// ///
/// Text extractor automatically decode body according to the request's charset. /// Text extractor automatically decode body according to the request's charset.
/// ///
/// [**PayloadConfig**](dev/struct.PayloadConfig.html) allows to configure
/// extraction process.
///
/// ## Example /// ## Example
/// ///
/// ```rust /// ```rust

View File

@ -84,6 +84,8 @@ impl<T: Serialize> Responder for Json<T> {
/// To extract typed information from request's body, the type `T` must implement the /// To extract typed information from request's body, the type `T` must implement the
/// `Deserialize` trait from *serde*. /// `Deserialize` trait from *serde*.
/// ///
/// [**JsonConfig**](dev/struct.JsonConfig.html) allows to configure extraction process.
///
/// ## Example /// ## Example
/// ///
/// ```rust /// ```rust