diff --git a/tower-util/src/make_connection.rs b/tower-util/src/make_connection.rs index 226079f..3be9443 100644 --- a/tower-util/src/make_connection.rs +++ b/tower-util/src/make_connection.rs @@ -8,7 +8,7 @@ use tower_service::Service; /// The goal of this service is to allow composable methods for creating /// `AsyncRead + AsyncWrite` transports. This could mean creating a TLS /// based connection or using some other method to authenticate the connection. -pub trait MakeConnection: Sealed<(Request,)> { +pub trait MakeConnection: Sealed<(Target,)> { /// The transport provided by this service type Connection: AsyncRead + AsyncWrite; @@ -22,14 +22,14 @@ pub trait MakeConnection: Sealed<(Request,)> { fn poll_ready(&mut self) -> Poll<(), Self::Error>; /// Connect and return a transport asynchronously - fn make_connection(&mut self, target: Request) -> Self::Future; + fn make_connection(&mut self, target: Target) -> Self::Future; } -impl Sealed<(Request,)> for S where S: Service {} +impl Sealed<(Target,)> for S where S: Service {} -impl MakeConnection for C +impl MakeConnection for C where - C: Service, + C: Service, C::Response: AsyncRead + AsyncWrite, { type Connection = C::Response; @@ -40,7 +40,7 @@ where Service::poll_ready(self) } - fn make_connection(&mut self, target: Request) -> Self::Future { + fn make_connection(&mut self, target: Target) -> Self::Future { Service::call(self, target) } }