Merge pull request #1244 from gotham-rs/add-response-body_ref-function

feat(server): Provide reference to Response body
This commit is contained in:
Sean McArthur
2017-07-13 09:08:14 -07:00
committed by GitHub

View File

@@ -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> {