1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 17:46:38 +02:00

refactor handler rtype handling

This commit is contained in:
Nikolay Kim
2017-11-29 09:17:00 -08:00
parent e9bfab8012
commit 6177d86d97
6 changed files with 34 additions and 44 deletions

View File

@@ -2,11 +2,10 @@ use std::rc::Rc;
use std::collections::HashMap;
use task::Task;
use route::{RouteHandler, FnHandler};
use route::{RouteHandler, FnHandler, Reply};
use resource::Resource;
use recognizer::{RouteRecognizer, check_pattern};
use httprequest::HttpRequest;
use httpresponse::HttpResponse;
use channel::HttpHandler;
use pipeline::Pipeline;
use middlewares::Middleware;
@@ -204,7 +203,7 @@ impl<S> ApplicationBuilder<S> where S: 'static {
/// ```
pub fn handler<P, F, R>(&mut self, path: P, handler: F) -> &mut Self
where F: Fn(HttpRequest<S>) -> R + 'static,
R: Into<HttpResponse> + 'static,
R: Into<Reply> + 'static,
P: Into<String>,
{
self.parts.as_mut().expect("Use after finish")