}
}
-impl<S> Transform<S> for RateLimited
+impl<S> Transform<S, ServiceRequest> for RateLimited
where
- S: Service<Request = ServiceRequest, Response = ServiceResponse, Error = actix_web::Error>,
+ S: Service<ServiceRequest, Response = ServiceResponse, Error = actix_web::Error>,
S::Future: 'static,
{
- type Request = S::Request;
type Response = S::Response;
type Error = actix_web::Error;
type InitError = ();
type FutResult<T, E> = dyn Future<Output = Result<T, E>>;
-impl<S> Service for RateLimitedMiddleware<S>
+impl<S> Service<ServiceRequest> for RateLimitedMiddleware<S>
where
- S: Service<Request = ServiceRequest, Response = ServiceResponse, Error = actix_web::Error>,
+ S: Service<ServiceRequest, Response = ServiceResponse, Error = actix_web::Error>,
S::Future: 'static,
{
- type Request = S::Request;
type Response = S::Response;
type Error = actix_web::Error;
type Future = Pin<Box<FutResult<Self::Response, Self::Error>>>;
- fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
+ fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
self.service.poll_ready(cx)
}
- fn call(&mut self, req: S::Request) -> Self::Future {
+ fn call(&self, req: ServiceRequest) -> Self::Future {
let ip_addr = get_ip(&req.connection_info());
let fut = self