9797
9898 /// Prevent shutdown of the underlying IO object at the end of service the request,
9999 /// instead run `into_parts`. This is a convenience wrapper over `poll_without_shutdown`.
100+ ///
101+ /// # Errors
102+ ///
103+ /// Returns an error if the connection encounters an error while being polled to completion.
100104 pub async fn without_shutdown ( self ) -> crate :: Result < Parts < T > > {
101105 let mut conn = Some ( self ) ;
102106 crate :: common:: future:: poll_fn ( move |cx| -> Poll < crate :: Result < Parts < T > > > {
@@ -137,6 +141,10 @@ pub struct Builder {
137141///
138142/// This is a shortcut for `Builder::new().handshake(io)`.
139143/// See [`client::conn`](crate::client::conn) for more.
144+ ///
145+ /// # Errors
146+ ///
147+ /// Returns an error if the HTTP/1 connection handshake fails.
140148pub async fn handshake < T , B > ( io : T ) -> crate :: Result < ( SendRequest < B > , Connection < T , B > ) >
141149where
142150 T : Read + Write + Unpin ,
@@ -159,6 +167,8 @@ impl<B> SendRequest<B> {
159167
160168 /// Waits until the dispatcher is ready.
161169 ///
170+ /// # Errors
171+ ///
162172 /// If the associated connection is closed, this returns an Error.
163173 pub async fn ready ( & mut self ) -> crate :: Result < ( ) > {
164174 crate :: common:: future:: poll_fn ( |cx| self . poll_ready ( cx) ) . await
@@ -210,6 +220,11 @@ where
210220 /// hyper closes the underlying connection when a request future is
211221 /// dropped before completion. Any subsequent calls on the same
212222 /// [`SendRequest`] will return a `canceled` error.
223+ ///
224+ /// # Errors
225+ ///
226+ /// Returns an error if the connection is not ready or if an error occurs while
227+ /// processing the request.
213228 pub fn send_request (
214229 & mut self ,
215230 req : Request < B > ,
@@ -236,7 +251,7 @@ where
236251 ///
237252 /// Returns a future that if successful, yields the `Response`.
238253 ///
239- /// # Error
254+ /// # Errors
240255 ///
241256 /// If there was an error before trying to serialize the request to the
242257 /// connection, the message will be returned as part of this error.
@@ -533,6 +548,10 @@ impl Builder {
533548 ///
534549 /// Note, if [`Connection`] is not `await`-ed, [`SendRequest`] will
535550 /// do nothing.
551+ ///
552+ /// # Errors
553+ ///
554+ /// Returns an error if the HTTP/1connection handshake fails.
536555 pub fn handshake < T , B > (
537556 & self ,
538557 io : T ,
0 commit comments