We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
http1::Connection
without_shutdown()
1 parent abf696a commit 210bfaaCopy full SHA for 210bfaa
src/client/conn/http1.rs
@@ -88,6 +88,17 @@ where
88
pub fn poll_without_shutdown(&mut self, cx: &mut Context<'_>) -> Poll<crate::Result<()>> {
89
self.inner.poll_without_shutdown(cx)
90
}
91
+
92
+ /// Prevent shutdown of the underlying IO object at the end of service the request,
93
+ /// instead run `into_parts`. This is a convenience wrapper over `poll_without_shutdown`.
94
+ pub async fn without_shutdown(self) -> crate::Result<Parts<T>> {
95
+ let mut conn = Some(self);
96
+ futures_util::future::poll_fn(move |cx| -> Poll<crate::Result<Parts<T>>> {
97
+ ready!(conn.as_mut().unwrap().poll_without_shutdown(cx))?;
98
+ Poll::Ready(Ok(conn.take().unwrap().into_parts()))
99
+ })
100
+ .await
101
+ }
102
103
104
/// A builder to configure an HTTP connection.
0 commit comments