Skip to content

Commit

Permalink
feat: reduce Send requirements on auto connections (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored Nov 17, 2023
1 parent f1ddfb1 commit e7cf0c1
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/server/conn/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ impl<E> Builder<E> {
/// Bind a connection together with a [`Service`].
pub async fn serve_connection<I, S, B>(&self, io: I, service: S) -> Result<()>
where
S: Service<Request<Incoming>, Response = Response<B>> + Send,
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
B: Body + Send + 'static,
B::Data: Send,
B: Body + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
I: Read + Write + Unpin + 'static,
E: Http2ServerConnExec<S::Future, B>,
Expand All @@ -90,11 +89,10 @@ impl<E> Builder<E> {
/// `Send`.
pub async fn serve_connection_with_upgrades<I, S, B>(&self, io: I, service: S) -> Result<()>
where
S: Service<Request<Incoming>, Response = Response<B>> + Send,
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
B: Body + Send + 'static,
B::Data: Send,
B: Body + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
I: Read + Write + Unpin + Send + 'static,
E: Http2ServerConnExec<S::Future, B>,
Expand Down Expand Up @@ -295,11 +293,10 @@ impl<E> Http1Builder<'_, E> {
/// Bind a connection together with a [`Service`].
pub async fn serve_connection<I, S, B>(&self, io: I, service: S) -> Result<()>
where
S: Service<Request<Incoming>, Response = Response<B>> + Send,
S::Future: Send + 'static,
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
B: Body + Send + 'static,
B::Data: Send,
B: Body + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
I: Read + Write + Unpin + 'static,
E: Http2ServerConnExec<S::Future, B>,
Expand Down Expand Up @@ -443,11 +440,10 @@ impl<E> Http2Builder<'_, E> {
/// Bind a connection together with a [`Service`].
pub async fn serve_connection<I, S, B>(&self, io: I, service: S) -> Result<()>
where
S: Service<Request<Incoming>, Response = Response<B>> + Send,
S::Future: Send + 'static,
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
B: Body + Send + 'static,
B::Data: Send,
B: Body + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
I: Read + Write + Unpin + 'static,
E: Http2ServerConnExec<S::Future, B>,
Expand Down

0 comments on commit e7cf0c1

Please sign in to comment.