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

export Handler

This commit is contained in:
Nikolay Kim
2017-11-29 13:41:51 -08:00
parent 16ceb741b8
commit 427566b90d
4 changed files with 7 additions and 8 deletions

View File

@ -10,7 +10,6 @@
// dev specific
pub use task::Task;
pub use route::Handler;
pub use pipeline::Pipeline;
pub use recognizer::RouteRecognizer;
pub use channel::HttpChannel;

View File

@ -82,7 +82,7 @@ pub use application::Application;
pub use httprequest::{HttpRequest, UrlEncoded};
pub use httpresponse::HttpResponse;
pub use payload::{Payload, PayloadItem};
pub use route::{Frame, Reply};
pub use route::{Frame, Reply, Handler};
pub use resource::Resource;
pub use recognizer::Params;
pub use server::HttpServer;

View File

@ -80,28 +80,28 @@ impl<S> Resource<S> where S: 'static {
self.default = Box::new(WrapHandler::new(handler));
}
/// Handler for `GET` method.
/// Register handler for `GET` method.
pub fn get<F, R>(&mut self, handler: F)
where F: Fn(HttpRequest<S>) -> R + 'static,
R: Into<Reply> + 'static, {
self.routes.insert(Method::GET, Box::new(WrapHandler::new(handler)));
}
/// Handler for `POST` method.
/// Register handler for `POST` method.
pub fn post<F, R>(&mut self, handler: F)
where F: Fn(HttpRequest<S>) -> R + 'static,
R: Into<Reply> + 'static, {
self.routes.insert(Method::POST, Box::new(WrapHandler::new(handler)));
}
/// Handler for `PUT` method.
/// Register handler for `PUT` method.
pub fn put<F, R>(&mut self, handler: F)
where F: Fn(HttpRequest<S>) -> R + 'static,
R: Into<Reply> + 'static, {
self.routes.insert(Method::PUT, Box::new(WrapHandler::new(handler)));
}
/// Handler for `DELETE` method.
/// Register handler for `DELETE` method.
pub fn delete<F, R>(&mut self, handler: F)
where F: Fn(HttpRequest<S>) -> R + 'static,
R: Into<Reply> + 'static, {