mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 17:07:01 +02:00
rename FromRequest trait to Responder
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use http::{StatusCode, Error as HttpError};
|
||||
|
||||
use body::Body;
|
||||
use handler::{Reply, Handler, RouteHandler, FromRequest};
|
||||
use handler::{Reply, Handler, RouteHandler, Responder};
|
||||
use httprequest::HttpRequest;
|
||||
use httpresponse::{HttpResponse, HttpResponseBuilder};
|
||||
|
||||
@@ -81,11 +81,11 @@ impl<S> RouteHandler<S> for StaticResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromRequest for StaticResponse {
|
||||
impl Responder for StaticResponse {
|
||||
type Item = HttpResponse;
|
||||
type Error = HttpError;
|
||||
|
||||
fn from_request(self, _: HttpRequest) -> Result<HttpResponse, HttpError> {
|
||||
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError> {
|
||||
self.build().body(Body::Empty)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user