mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-01 08:45:10 +02:00
rename .to_async() to .to()
This commit is contained in:
@ -181,7 +181,7 @@ impl<T: Serialize> Responder for Form<T> {
|
||||
///
|
||||
/// /// Extract form data using serde.
|
||||
/// /// Custom configuration is used for this handler, max payload size is 4k
|
||||
/// fn index(form: web::Form<FormData>) -> Result<String> {
|
||||
/// async fn index(form: web::Form<FormData>) -> Result<String> {
|
||||
/// Ok(format!("Welcome {}!", form.username))
|
||||
/// }
|
||||
///
|
||||
|
@ -46,7 +46,7 @@ use crate::responder::Responder;
|
||||
/// }
|
||||
///
|
||||
/// /// deserialize `Info` from request's body
|
||||
/// fn index(info: web::Json<Info>) -> String {
|
||||
/// async fn index(info: web::Json<Info>) -> String {
|
||||
/// format!("Welcome {}!", info.username)
|
||||
/// }
|
||||
///
|
||||
@ -157,7 +157,7 @@ impl<T: Serialize> Responder for Json<T> {
|
||||
/// }
|
||||
///
|
||||
/// /// deserialize `Info` from request's body
|
||||
/// fn index(info: web::Json<Info>) -> String {
|
||||
/// async fn index(info: web::Json<Info>) -> String {
|
||||
/// format!("Welcome {}!", info.username)
|
||||
/// }
|
||||
///
|
||||
@ -217,7 +217,7 @@ where
|
||||
/// }
|
||||
///
|
||||
/// /// deserialize `Info` from request's body, max payload size is 4kb
|
||||
/// fn index(info: web::Json<Info>) -> String {
|
||||
/// async fn index(info: web::Json<Info>) -> String {
|
||||
/// format!("Welcome {}!", info.username)
|
||||
/// }
|
||||
///
|
||||
|
@ -24,7 +24,7 @@ use crate::FromRequest;
|
||||
/// /// extract path info from "/{username}/{count}/index.html" url
|
||||
/// /// {username} - deserializes to a String
|
||||
/// /// {count} - - deserializes to a u32
|
||||
/// fn index(info: web::Path<(String, u32)>) -> String {
|
||||
/// async fn index(info: web::Path<(String, u32)>) -> String {
|
||||
/// format!("Welcome {}! {}", info.0, info.1)
|
||||
/// }
|
||||
///
|
||||
@ -49,7 +49,7 @@ use crate::FromRequest;
|
||||
/// }
|
||||
///
|
||||
/// /// extract `Info` from a path using serde
|
||||
/// fn index(info: web::Path<Info>) -> Result<String, Error> {
|
||||
/// async fn index(info: web::Path<Info>) -> Result<String, Error> {
|
||||
/// Ok(format!("Welcome {}!", info.username))
|
||||
/// }
|
||||
///
|
||||
@ -119,7 +119,7 @@ impl<T: fmt::Display> fmt::Display for Path<T> {
|
||||
/// /// extract path info from "/{username}/{count}/index.html" url
|
||||
/// /// {username} - deserializes to a String
|
||||
/// /// {count} - - deserializes to a u32
|
||||
/// fn index(info: web::Path<(String, u32)>) -> String {
|
||||
/// async fn index(info: web::Path<(String, u32)>) -> String {
|
||||
/// format!("Welcome {}! {}", info.0, info.1)
|
||||
/// }
|
||||
///
|
||||
@ -144,7 +144,7 @@ impl<T: fmt::Display> fmt::Display for Path<T> {
|
||||
/// }
|
||||
///
|
||||
/// /// extract `Info` from a path using serde
|
||||
/// fn index(info: web::Path<Info>) -> Result<String, Error> {
|
||||
/// async fn index(info: web::Path<Info>) -> Result<String, Error> {
|
||||
/// Ok(format!("Welcome {}!", info.username))
|
||||
/// }
|
||||
///
|
||||
@ -206,7 +206,7 @@ where
|
||||
/// }
|
||||
///
|
||||
/// // deserialize `Info` from request's path
|
||||
/// fn index(folder: web::Path<Folder>) -> String {
|
||||
/// async fn index(folder: web::Path<Folder>) -> String {
|
||||
/// format!("Selected folder: {:?}!", folder)
|
||||
/// }
|
||||
///
|
||||
|
@ -40,7 +40,7 @@ use crate::request::HttpRequest;
|
||||
/// fn main() {
|
||||
/// let app = App::new().service(
|
||||
/// web::resource("/index.html").route(
|
||||
/// web::get().to_async(index))
|
||||
/// web::get().to(index))
|
||||
/// );
|
||||
/// }
|
||||
/// ```
|
||||
@ -88,7 +88,7 @@ impl Stream for Payload {
|
||||
/// fn main() {
|
||||
/// let app = App::new().service(
|
||||
/// web::resource("/index.html").route(
|
||||
/// web::get().to_async(index))
|
||||
/// web::get().to(index))
|
||||
/// );
|
||||
/// }
|
||||
/// ```
|
||||
@ -117,7 +117,7 @@ impl FromRequest for Payload {
|
||||
/// use actix_web::{web, App};
|
||||
///
|
||||
/// /// extract binary data from request
|
||||
/// fn index(body: Bytes) -> String {
|
||||
/// async fn index(body: Bytes) -> String {
|
||||
/// format!("Body {:?}!", body)
|
||||
/// }
|
||||
///
|
||||
@ -169,7 +169,7 @@ impl FromRequest for Bytes {
|
||||
/// use actix_web::{web, App, FromRequest};
|
||||
///
|
||||
/// /// extract text data from request
|
||||
/// fn index(text: String) -> String {
|
||||
/// async fn index(text: String) -> String {
|
||||
/// format!("Body {}!", text)
|
||||
/// }
|
||||
///
|
||||
|
@ -40,7 +40,7 @@ use crate::request::HttpRequest;
|
||||
/// // Use `Query` extractor for query information (and destructure it within the signature).
|
||||
/// // This handler gets called only if the request's query string contains a `username` field.
|
||||
/// // The correct request for this handler would be `/index.html?id=64&response_type=Code"`.
|
||||
/// fn index(web::Query(info): web::Query<AuthRequest>) -> String {
|
||||
/// async fn index(web::Query(info): web::Query<AuthRequest>) -> String {
|
||||
/// format!("Authorization request for client with id={} and type={:?}!", info.id, info.response_type)
|
||||
/// }
|
||||
///
|
||||
@ -118,7 +118,7 @@ impl<T: fmt::Display> fmt::Display for Query<T> {
|
||||
/// // 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 {
|
||||
/// async fn index(info: web::Query<AuthRequest>) -> String {
|
||||
/// format!("Authorization request for client with id={} and type={:?}!", info.id, info.response_type)
|
||||
/// }
|
||||
///
|
||||
@ -179,7 +179,7 @@ where
|
||||
/// }
|
||||
///
|
||||
/// /// deserialize `Info` from request's querystring
|
||||
/// fn index(info: web::Query<Info>) -> String {
|
||||
/// async fn index(info: web::Query<Info>) -> String {
|
||||
/// format!("Welcome {}!", info.username)
|
||||
/// }
|
||||
///
|
||||
|
Reference in New Issue
Block a user