mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-27 15:29:03 +02:00
update actix-service
This commit is contained in:
@ -36,14 +36,13 @@ impl Default for Compress {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, P, B> Transform<S> for Compress
|
||||
impl<S, P, B> Transform<S, ServiceRequest<P>> for Compress
|
||||
where
|
||||
P: 'static,
|
||||
B: MessageBody,
|
||||
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
type Request = ServiceRequest<P>;
|
||||
type Response = ServiceResponse<Encoder<B>>;
|
||||
type Error = S::Error;
|
||||
type InitError = ();
|
||||
@ -63,14 +62,13 @@ pub struct CompressMiddleware<S> {
|
||||
encoding: ContentEncoding,
|
||||
}
|
||||
|
||||
impl<S, P, B> Service for CompressMiddleware<S>
|
||||
impl<S, P, B> Service<ServiceRequest<P>> for CompressMiddleware<S>
|
||||
where
|
||||
P: 'static,
|
||||
B: MessageBody,
|
||||
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
type Request = ServiceRequest<P>;
|
||||
type Response = ServiceResponse<Encoder<B>>;
|
||||
type Error = S::Error;
|
||||
type Future = CompressResponse<S, P, B>;
|
||||
@ -103,7 +101,7 @@ pub struct CompressResponse<S, P, B>
|
||||
where
|
||||
P: 'static,
|
||||
B: MessageBody,
|
||||
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
fut: S::Future,
|
||||
@ -114,7 +112,7 @@ impl<S, P, B> Future for CompressResponse<S, P, B>
|
||||
where
|
||||
P: 'static,
|
||||
B: MessageBody,
|
||||
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
type Item = ServiceResponse<Encoder<B>>;
|
||||
|
@ -84,12 +84,11 @@ impl DefaultHeaders {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, P, B> Transform<S> for DefaultHeaders
|
||||
impl<S, P, B> Transform<S, ServiceRequest<P>> for DefaultHeaders
|
||||
where
|
||||
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
type Request = ServiceRequest<P>;
|
||||
type Response = ServiceResponse<B>;
|
||||
type Error = S::Error;
|
||||
type InitError = ();
|
||||
@ -109,12 +108,11 @@ pub struct DefaultHeadersMiddleware<S> {
|
||||
inner: Rc<Inner>,
|
||||
}
|
||||
|
||||
impl<S, P, B> Service for DefaultHeadersMiddleware<S>
|
||||
impl<S, P, B> Service<ServiceRequest<P>> for DefaultHeadersMiddleware<S>
|
||||
where
|
||||
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
type Request = ServiceRequest<P>;
|
||||
type Response = ServiceResponse<B>;
|
||||
type Error = S::Error;
|
||||
type Future = Box<Future<Item = Self::Response, Error = Self::Error>>;
|
||||
|
@ -5,3 +5,6 @@ pub use self::compress::Compress;
|
||||
|
||||
mod defaultheaders;
|
||||
pub use self::defaultheaders::DefaultHeaders;
|
||||
|
||||
#[cfg(feature = "session")]
|
||||
pub use actix_session as session;
|
||||
|
Reference in New Issue
Block a user