diff --git a/src/client/conn/http1.rs b/src/client/conn/http1.rs index ecfe6eb8fb..409a3af713 100644 --- a/src/client/conn/http1.rs +++ b/src/client/conn/http1.rs @@ -54,7 +54,7 @@ pub struct Parts { pub struct Connection where T: Read + Write, - B: Body + 'static, + B: Body, { inner: Dispatcher, } @@ -62,7 +62,7 @@ where impl Connection where T: Read + Write + Unpin, - B: Body + 'static, + B: Body, B::Error: Into>, { /// Return the inner IO object, and additional information. @@ -127,7 +127,7 @@ pub struct Builder { pub async fn handshake(io: T) -> crate::Result<(SendRequest, Connection)> where T: Read + Write + Unpin, - B: Body + 'static, + B: Body, B::Data: Send, B::Error: Into>, { @@ -170,7 +170,7 @@ impl SendRequest { impl SendRequest where - B: Body + 'static, + B: Body, { /// Sends a `Request` on the associated connection. /// @@ -255,7 +255,7 @@ impl fmt::Debug for SendRequest { impl Connection where T: Read + Write + Unpin + Send, - B: Body + 'static, + B: Body, B::Error: Into>, { /// Enable this connection to support higher-level HTTP upgrades. @@ -269,7 +269,7 @@ where impl fmt::Debug for Connection where T: Read + Write + fmt::Debug, - B: Body + 'static, + B: Body, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Connection").finish() @@ -279,7 +279,7 @@ where impl Future for Connection where T: Read + Write + Unpin, - B: Body + 'static, + B: Body, B::Data: Send, B::Error: Into>, { @@ -517,7 +517,7 @@ impl Builder { ) -> impl Future, Connection)>> where T: Read + Write + Unpin, - B: Body + 'static, + B: Body, B::Data: Send, B::Error: Into>, { @@ -581,7 +581,7 @@ mod upgrades { pub struct UpgradeableConnection where T: Read + Write + Unpin + Send + 'static, - B: Body + 'static, + B: Body, B::Error: Into>, { pub(super) inner: Option>, @@ -590,7 +590,7 @@ mod upgrades { impl Future for UpgradeableConnection where I: Read + Write + Unpin + Send + 'static, - B: Body + 'static, + B: Body, B::Data: Send, B::Error: Into>, { diff --git a/src/client/conn/http2.rs b/src/client/conn/http2.rs index 3db28957b6..72eefe0e85 100644 --- a/src/client/conn/http2.rs +++ b/src/client/conn/http2.rs @@ -43,7 +43,7 @@ impl Clone for SendRequest { pub struct Connection where T: Read + Write + Unpin, - B: Body + 'static, + B: Body, E: Http2ClientConnExec + Unpin, B::Error: Into>, { @@ -73,8 +73,8 @@ pub async fn handshake( ) -> crate::Result<(SendRequest, Connection)> where T: Read + Write + Unpin, - B: Body + 'static, - B::Data: Send, + B: Body, + B::Data: Send + 'static, B::Error: Into>, E: Http2ClientConnExec + Unpin + Clone, { @@ -121,7 +121,7 @@ impl SendRequest { impl SendRequest where - B: Body + 'static, + B: Body, { /// Sends a `Request` on the associated connection. /// @@ -199,7 +199,7 @@ impl fmt::Debug for SendRequest { impl Connection where T: Read + Write + Unpin + 'static, - B: Body + Unpin + 'static, + B: Body + Unpin, B::Data: Send, B::Error: Into>, E: Http2ClientConnExec + Unpin, @@ -476,8 +476,8 @@ where ) -> impl Future, Connection)>> where T: Read + Write + Unpin, - B: Body + 'static, - B::Data: Send, + B: Body, + B::Data: Send + 'static, B::Error: Into>, Ex: Http2ClientConnExec + Unpin, { diff --git a/src/client/dispatch.rs b/src/client/dispatch.rs index 4ae41c509d..87b6c0e790 100644 --- a/src/client/dispatch.rs +++ b/src/client/dispatch.rs @@ -315,7 +315,6 @@ pin_project! { pub struct SendWhen where B: Body, - B: 'static, { #[pin] pub(crate) when: ResponseFutMap, @@ -327,7 +326,8 @@ pin_project! { #[cfg(feature = "http2")] impl Future for SendWhen where - B: Body + 'static, + B: Body, + B::Data: 'static, { type Output = (); diff --git a/src/proto/h1/dispatch.rs b/src/proto/h1/dispatch.rs index 79ea48be9f..7aa7a6f877 100644 --- a/src/proto/h1/dispatch.rs +++ b/src/proto/h1/dispatch.rs @@ -74,7 +74,7 @@ where D::PollError: Into>, I: Read + Write + Unpin, T: Http1Transaction + Unpin, - Bs: Body + 'static, + Bs: Body, Bs::Error: Into>, { pub(crate) fn new(dispatch: D, conn: Conn) -> Self { @@ -461,7 +461,7 @@ where D::PollError: Into>, I: Read + Write + Unpin, T: Http1Transaction + Unpin, - Bs: Body + 'static, + Bs: Body, Bs::Error: Into>, { type Output = crate::Result; diff --git a/src/proto/h2/client.rs b/src/proto/h2/client.rs index 5e9641e408..749c6e3e0c 100644 --- a/src/proto/h2/client.rs +++ b/src/proto/h2/client.rs @@ -150,7 +150,7 @@ pub(crate) async fn handshake( ) -> crate::Result> where T: Read + Write + Unpin, - B: Body + 'static, + B: Body, B::Data: Send + 'static, E: Http2ClientConnExec + Unpin, B::Error: Into>, @@ -363,7 +363,6 @@ pin_project! { pub enum H2ClientFuture where B: http_body::Body, - B: 'static, B::Error: Into>, T: Read, T: Write, @@ -386,7 +385,8 @@ pin_project! { impl Future for H2ClientFuture where - B: http_body::Body + 'static, + B: http_body::Body, + B::Data: 'static, B::Error: Into>, T: Read + Write + Unpin, { @@ -434,7 +434,7 @@ where impl ClientTask where - B: Body + 'static, + B: Body, E: Http2ClientConnExec + Unpin, B::Error: Into>, T: Read + Write + Unpin, @@ -485,7 +485,7 @@ where impl ClientTask where - B: Body + 'static + Unpin, + B: Body + Unpin, B::Data: Send, E: Http2ClientConnExec + Unpin, B::Error: Into>, @@ -543,7 +543,6 @@ pin_project! { pub(crate) struct ResponseFutMap where B: Body, - B: 'static, { #[pin] fut: ResponseFuture, @@ -556,7 +555,8 @@ pin_project! { impl Future for ResponseFutMap where - B: Body + 'static, + B: Body, + B::Data: 'static, { type Output = Result, (crate::Error, Option>)>; @@ -620,7 +620,7 @@ where impl Future for ClientTask where - B: Body + 'static + Unpin, + B: Body + Unpin, B::Data: Send, B::Error: Into>, E: Http2ClientConnExec + Unpin,