Skip to content

Commit

Permalink
feat(client): introduce Response::get_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Apr 10, 2017
1 parent 1fe4a0a commit 5ef0ec2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub struct Response {
}

impl Response {

/// Creates a new response from a server.
pub fn new(url: Url, stream: Box<NetworkStream + Send>) -> ::Result<Response> {
trace!("Response::new");
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 5ef0ec2

Please sign in to comment.