1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-08-02 02:35:04 +00: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
/// `Deserialize` trait from *serde*.
///
/// [**FormConfig**](dev/struct.FormConfig.html) allows to configure extraction
/// process.
///
/// ## Example
///
/// 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
/// /// 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
/// fn index(form: Form<FormData>) -> Result<String> {
/// Ok(format!("Welcome {}!", form.username))
@ -249,7 +252,8 @@ impl<T, S> FromRequest<S> for Form<T>
/// 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> {
/// Ok(format!("Welcome {}!", form.username))
/// }
@ -286,6 +290,9 @@ impl Default for FormConfig {
///
/// Loads request's payload and construct Bytes instance.
///
/// [**PayloadConfig**](dev/struct.PayloadConfig.html) allows to configure extraction
/// process.
///
/// ## Example
///
/// ```rust
@ -322,6 +329,9 @@ impl<S: 'static> FromRequest<S> for Bytes
///
/// Text extractor automatically decode body according to the request's charset.
///
/// [**PayloadConfig**](dev/struct.PayloadConfig.html) allows to configure
/// extraction process.
///
/// ## Example
///
/// ```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
/// `Deserialize` trait from *serde*.
///
/// [**JsonConfig**](dev/struct.JsonConfig.html) allows to configure extraction process.
///
/// ## Example
///
/// ```rust