1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-20 06:25:37 +02:00

update utils; add NewTransform::map_init_err

This commit is contained in:
Nikolay Kim
2019-03-02 13:18:01 -08:00
parent d0b8b6940c
commit 668e4f9ac4
10 changed files with 127 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
use actix_service::{NewTransform, Service, Transform};
use actix_service::{NewTransform, Service, Transform, Void};
use futures::future::{ok, FutureResult};
use futures::{Async, Future, Poll};
@@ -24,15 +24,15 @@ impl Default for InFlight {
}
}
impl<T: Service> NewTransform<T> for InFlight {
impl<T: Service, C> NewTransform<T, C> for InFlight {
type Request = T::Request;
type Response = T::Response;
type Error = T::Error;
type InitError = ();
type InitError = Void;
type Transform = InFlightService;
type Future = FutureResult<Self::Transform, Self::InitError>;
fn new_transform(&self) -> Self::Future {
fn new_transform(&self, _: &C) -> Self::Future {
ok(InFlightService::new(self.max_inflight))
}
}