Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/server/conn/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ 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<()>
pub fn serve_connection<I, S, B>(&self, io: I, service: S) -> Connection<I, S, E>
where
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
Expand All @@ -532,7 +532,7 @@ impl<E> Http1Builder<'_, E> {
I: Read + Write + Unpin + 'static,
E: Http2ServerConnExec<S::Future, B>,
{
self.inner.serve_connection(io, service).await
self.inner.serve_connection(io, service)
}
}

Expand Down Expand Up @@ -667,7 +667,7 @@ 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<()>
pub fn serve_connection<I, S, B>(&self, io: I, service: S) -> Connection<I, S, E>
where
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
Expand All @@ -677,7 +677,7 @@ impl<E> Http2Builder<'_, E> {
I: Read + Write + Unpin + 'static,
E: Http2ServerConnExec<S::Future, B>,
{
self.inner.serve_connection(io, service).await
self.inner.serve_connection(io, service)
}
}

Expand Down