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

update actix-service

This commit is contained in:
Nikolay Kim
2019-03-05 10:08:08 -08:00
parent b6fe1dacf2
commit 03248028a9
11 changed files with 132 additions and 159 deletions

View File

@@ -52,12 +52,11 @@ where
}
}
}
impl<F, T, R> NewService for Handle<F, T, R>
impl<F, T, R> NewService<(T, HttpRequest)> for Handle<F, T, R>
where
F: Factory<T, R>,
R: Responder + 'static,
{
type Request = (T, HttpRequest);
type Response = ServiceResponse;
type Error = Void;
type InitError = ();
@@ -82,12 +81,11 @@ where
_t: PhantomData<(T, R)>,
}
impl<F, T, R> Service for HandleService<F, T, R>
impl<F, T, R> Service<(T, HttpRequest)> for HandleService<F, T, R>
where
F: Factory<T, R>,
R: Responder + 'static,
{
type Request = (T, HttpRequest);
type Response = ServiceResponse;
type Error = Void;
type Future = HandleServiceResponse<<R::Future as IntoFuture>::Future>;
@@ -184,14 +182,13 @@ where
}
}
}
impl<F, T, R> NewService for AsyncHandle<F, T, R>
impl<F, T, R> NewService<(T, HttpRequest)> for AsyncHandle<F, T, R>
where
F: AsyncFactory<T, R>,
R: IntoFuture,
R::Item: Into<Response>,
R::Error: Into<Error>,
{
type Request = (T, HttpRequest);
type Response = ServiceResponse;
type Error = ();
type InitError = ();
@@ -218,14 +215,13 @@ where
_t: PhantomData<(T, R)>,
}
impl<F, T, R> Service for AsyncHandleService<F, T, R>
impl<F, T, R> Service<(T, HttpRequest)> for AsyncHandleService<F, T, R>
where
F: AsyncFactory<T, R>,
R: IntoFuture,
R::Item: Into<Response>,
R::Error: Into<Error>,
{
type Request = (T, HttpRequest);
type Response = ServiceResponse;
type Error = ();
type Future = AsyncHandleServiceResponse<R::Future>;
@@ -290,8 +286,7 @@ impl<P, T: FromRequest<P>> Extract<P, T> {
}
}
impl<P, T: FromRequest<P>> NewService for Extract<P, T> {
type Request = ServiceRequest<P>;
impl<P, T: FromRequest<P>> NewService<ServiceRequest<P>> for Extract<P, T> {
type Response = (T, HttpRequest);
type Error = (Error, ServiceFromRequest<P>);
type InitError = ();
@@ -311,8 +306,7 @@ pub struct ExtractService<P, T: FromRequest<P>> {
_t: PhantomData<(P, T)>,
}
impl<P, T: FromRequest<P>> Service for ExtractService<P, T> {
type Request = ServiceRequest<P>;
impl<P, T: FromRequest<P>> Service<ServiceRequest<P>> for ExtractService<P, T> {
type Response = (T, HttpRequest);
type Error = (Error, ServiceFromRequest<P>);
type Future = ExtractResponse<P, T>;