Skip to content

Commit

Permalink
Merge pull request #1244 from gotham-rs/add-response-body_ref-function
Browse files Browse the repository at this point in the history
feat(server): Provide reference to Response body
  • Loading branch information
seanmonstar authored Jul 13, 2017
2 parents 258584a + a79fc98 commit 5f47d72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/http/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ impl<B> Response<B> {
self.set_body(body);
self
}

/// Read the body.
#[inline]
pub fn body_ref(&self) -> Option<&B> { self.body.as_ref() }
}

impl Response<Body> {
Expand Down

0 comments on commit 5f47d72

Please sign in to comment.