1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-22 13:45:13 +02:00

use Route for Applicaiton handlers

This commit is contained in:
Nikolay Kim
2017-12-04 14:53:40 -08:00
parent f5d6179a34
commit e332c1242f
16 changed files with 61 additions and 80 deletions

View File

@@ -5,7 +5,7 @@ use futures::Future;
use error::Error;
use pred::{self, Predicate};
use route::{Reply, Handler, FromRequest, RouteHandler, AsyncHandler, WrapHandler};
use handler::{Reply, Handler, FromRequest, RouteHandler, AsyncHandler, WrapHandler};
use httpcodes::HTTPNotFound;
use httprequest::HttpRequest;
use httpresponse::HttpResponse;
@@ -31,7 +31,7 @@ impl<S: 'static> Default for Route<S> {
impl<S: 'static> Route<S> {
fn check(&self, req: &mut HttpRequest<S>) -> bool {
pub(crate) fn check(&self, req: &mut HttpRequest<S>) -> bool {
for pred in &self.preds {
if !pred.check(req) {
return false
@@ -40,7 +40,7 @@ impl<S: 'static> Route<S> {
true
}
fn handle(&self, req: HttpRequest<S>) -> Reply {
pub(crate) fn handle(&self, req: HttpRequest<S>) -> Reply {
self.handler.handle(req)
}