1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

refactor payload

This commit is contained in:
Nikolay Kim
2017-10-08 20:16:48 -07:00
parent e398694bdb
commit e2dc775e21
12 changed files with 257 additions and 153 deletions

View File

@@ -4,7 +4,8 @@ use std::rc::Rc;
use http::StatusCode;
use task::Task;
use route::{Payload, RouteHandler};
use route::RouteHandler;
use payload::Payload;
use httpmessage::{Body, HttpRequest, HttpResponse, IntoHttpResponse};
pub const HTTPOk: StaticResponse = StaticResponse(StatusCode::OK);
@@ -25,8 +26,7 @@ impl StaticResponse {
}
impl<S> RouteHandler<S> for StaticResponse {
fn handle(&self, req: HttpRequest, _: Option<Payload>, _: Rc<S>) -> Task
{
fn handle(&self, req: HttpRequest, _: Payload, _: Rc<S>) -> Task {
Task::reply(HttpResponse::new(req, self.0, Body::Empty))
}
}