mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 17:07:01 +02:00
renamed Route::handler to Route::f, added Route::h to register Handler
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use http::{StatusCode, Error as HttpError};
|
||||
|
||||
use body::Body;
|
||||
use route::{Reply, RouteHandler, FromRequest};
|
||||
use route::{Reply, Handler, RouteHandler, FromRequest};
|
||||
use httprequest::HttpRequest;
|
||||
use httpresponse::{HttpResponse, HttpResponseBuilder};
|
||||
|
||||
@@ -67,6 +67,14 @@ impl StaticResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> Handler<S> for StaticResponse {
|
||||
type Result = HttpResponse;
|
||||
|
||||
fn handle(&self, _: HttpRequest<S>) -> HttpResponse {
|
||||
HttpResponse::new(self.0, Body::Empty)
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> RouteHandler<S> for StaticResponse {
|
||||
fn handle(&self, _: HttpRequest<S>) -> Reply {
|
||||
Reply::response(HttpResponse::new(self.0, Body::Empty))
|
||||
|
Reference in New Issue
Block a user