1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 09:59:21 +02:00

start working on guide

This commit is contained in:
Nikolay Kim
2017-11-27 16:41:37 -08:00
parent b5a4f6f855
commit 599f3c26e0
9 changed files with 141 additions and 8 deletions

View File

@ -11,7 +11,7 @@ use actix_web::error::{Error, Result};
use actix_web::middlewares::RequestSession;
use futures::stream::{once, Once};
/// somple handle
/// simple handler
fn index(mut req: HttpRequest) -> Result<HttpResponse> {
println!("{:?}", req);
if let Ok(ch) = req.payload_mut().readany() {
@ -31,7 +31,7 @@ fn index(mut req: HttpRequest) -> Result<HttpResponse> {
Ok(httpcodes::HTTPOk.into())
}
/// somple handle
/// async handler
fn index_async(req: HttpRequest) -> Once<actix_web::Frame, Error>
{
println!("{:?}", req);
@ -43,7 +43,7 @@ fn index_async(req: HttpRequest) -> Once<actix_web::Frame, Error>
.into()))
}
/// handle with path parameters like `/user/{name}/`
/// handler with path parameters like `/user/{name}/`
fn with_param(req: HttpRequest) -> Result<HttpResponse>
{
println!("{:?}", req);