From e7cf0c142bbd2009f0501b9be0faea827faeb1a5 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Fri, 17 Nov 2023 13:20:16 -0500 Subject: [PATCH] feat: reduce Send requirements on auto connections (#59) --- src/server/conn/auto.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/server/conn/auto.rs b/src/server/conn/auto.rs index 4761c45..fcb370b 100644 --- a/src/server/conn/auto.rs +++ b/src/server/conn/auto.rs @@ -67,11 +67,10 @@ impl Builder { /// Bind a connection together with a [`Service`]. pub async fn serve_connection(&self, io: I, service: S) -> Result<()> where - S: Service, Response = Response> + Send, + S: Service, Response = Response>, S::Future: 'static, S::Error: Into>, - B: Body + Send + 'static, - B::Data: Send, + B: Body + 'static, B::Error: Into>, I: Read + Write + Unpin + 'static, E: Http2ServerConnExec, @@ -90,11 +89,10 @@ impl Builder { /// `Send`. pub async fn serve_connection_with_upgrades(&self, io: I, service: S) -> Result<()> where - S: Service, Response = Response> + Send, + S: Service, Response = Response>, S::Future: 'static, S::Error: Into>, - B: Body + Send + 'static, - B::Data: Send, + B: Body + 'static, B::Error: Into>, I: Read + Write + Unpin + Send + 'static, E: Http2ServerConnExec, @@ -295,11 +293,10 @@ impl Http1Builder<'_, E> { /// Bind a connection together with a [`Service`]. pub async fn serve_connection(&self, io: I, service: S) -> Result<()> where - S: Service, Response = Response> + Send, - S::Future: Send + 'static, + S: Service, Response = Response>, + S::Future: 'static, S::Error: Into>, - B: Body + Send + 'static, - B::Data: Send, + B: Body + 'static, B::Error: Into>, I: Read + Write + Unpin + 'static, E: Http2ServerConnExec, @@ -443,11 +440,10 @@ impl Http2Builder<'_, E> { /// Bind a connection together with a [`Service`]. pub async fn serve_connection(&self, io: I, service: S) -> Result<()> where - S: Service, Response = Response> + Send, - S::Future: Send + 'static, + S: Service, Response = Response>, + S::Future: 'static, S::Error: Into>, - B: Body + Send + 'static, - B::Data: Send, + B: Body + 'static, B::Error: Into>, I: Read + Write + Unpin + 'static, E: Http2ServerConnExec,