1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

use custom request for FromRequest trait

This commit is contained in:
Nikolay Kim
2019-03-02 19:19:56 -08:00
parent e4198a037a
commit 8103d33270
12 changed files with 342 additions and 216 deletions

View File

@@ -9,11 +9,11 @@ use actix_router::{Path, Url};
use futures::future::{ok, FutureResult};
use crate::handler::FromRequest;
use crate::service::ServiceRequest;
use crate::service::ServiceFromRequest;
#[derive(Clone)]
pub struct HttpRequest {
head: Message<RequestHead>,
pub(crate) head: Message<RequestHead>,
pub(crate) path: Path<Url>,
extensions: Rc<Extensions>,
}
@@ -145,7 +145,7 @@ impl<P> FromRequest<P> for HttpRequest {
type Future = FutureResult<Self, Error>;
#[inline]
fn from_request(req: &mut ServiceRequest<P>) -> Self::Future {
fn from_request(req: &mut ServiceFromRequest<P>) -> Self::Future {
ok(req.clone())
}
}