diff --git a/tower-batch/src/service.rs b/tower-batch/src/service.rs index 44ed9cc8..ceddcc2f 100644 --- a/tower-batch/src/service.rs +++ b/tower-batch/src/service.rs @@ -17,19 +17,19 @@ use tower::Service; /// /// See the module documentation for more details. #[derive(Debug)] -pub struct Batch +pub struct Batch where - T: Service>, + S: Service>, { - tx: mpsc::Sender>, - handle: Handle, + tx: mpsc::Sender>, + handle: Handle, _e: PhantomData, } -impl Batch +impl Batch where - T: Service>, - T::Error: Into + Clone, + S: Service>, + S::Error: Into + Clone, E2: Send + 'static, crate::error::Closed: Into, // crate::error::Closed: Into<>::Error> + Send + Sync + 'static, @@ -45,11 +45,11 @@ where /// /// The default Tokio executor is used to run the given service, which means /// that this method must be called while on the Tokio runtime. - pub fn new(service: T, max_items: usize, max_latency: std::time::Duration) -> Self + pub fn new(service: S, max_items: usize, max_latency: std::time::Duration) -> Self where - T: Send + 'static, - T::Future: Send, - T::Error: Send + Sync + Clone, + S: Send + 'static, + S::Future: Send, + S::Error: Send + Sync + Clone, Request: Send + 'static, { // XXX(hdevalence): is this bound good @@ -68,16 +68,16 @@ where } } -impl Service for Batch +impl Service for Batch where - T: Service>, + S: Service>, crate::error::Closed: Into, - T::Error: Into + Clone, + S::Error: Into + Clone, E2: Send + 'static, { - type Response = T::Response; + type Response = S::Response; type Error = E2; - type Future = ResponseFuture; + type Future = ResponseFuture; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { // If the inner service has errored, then we error here. @@ -119,9 +119,9 @@ where } } -impl Clone for Batch +impl Clone for Batch where - T: Service>, + S: Service>, { fn clone(&self) -> Self { Self {