Merge pull request #1244 from gotham-rs/add-response-body_ref-function
feat(server): Provide reference to Response body
This commit is contained in:
@@ -93,6 +93,10 @@ impl<B> Response<B> {
|
|||||||
self.set_body(body);
|
self.set_body(body);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Read the body.
|
||||||
|
#[inline]
|
||||||
|
pub fn body_ref(&self) -> Option<&B> { self.body.as_ref() }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Response<Body> {
|
impl Response<Body> {
|
||||||
|
|||||||
Reference in New Issue
Block a user