diff --git a/src/client/response.rs b/src/client/response.rs index 396645ac87..66181f1d42 100644 --- a/src/client/response.rs +++ b/src/client/response.rs @@ -26,7 +26,6 @@ pub struct Response { } impl Response { - /// Creates a new response from a server. pub fn new(url: Url, stream: Box) -> ::Result { trace!("Response::new"); @@ -62,6 +61,12 @@ impl Response { pub fn status_raw(&self) -> &RawStatus { &self.status_raw } + + /// Gets a borrowed reference to the underlying `HttpMessage`. + #[inline] + pub fn get_ref(&self) -> &HttpMessage { + &*self.message + } } /// Read the response body. diff --git a/src/http/h1.rs b/src/http/h1.rs index c5ca944280..17207246df 100644 --- a/src/http/h1.rs +++ b/src/http/h1.rs @@ -377,7 +377,7 @@ impl Http11Message { } } - /// Gets a mutable reference to the underlying `NetworkStream`, regardless of the state of the + /// Gets a borrowed reference to the underlying `NetworkStream`, regardless of the state of the /// `Http11Message`. pub fn get_ref(&self) -> &(NetworkStream + Send) { match *self.stream.as_ref() {