feat(request): add Request::body_mut() method

This commit is contained in:
Sean McArthur
2018-02-24 12:16:25 -08:00
parent 2f45d5394a
commit 3fa191a267

View File

@@ -58,6 +58,10 @@ impl<B> Request<B> {
#[inline] #[inline]
pub fn body_ref(&self) -> Option<&B> { self.body.as_ref() } pub fn body_ref(&self) -> Option<&B> { self.body.as_ref() }
/// Get a mutable reference to the Request body.
#[inline]
pub fn body_mut(&mut self) -> &mut Option<B> { &mut self.body }
#[doc(hidden)] #[doc(hidden)]
#[inline] #[inline]
#[deprecated(since="0.11.12", note="This method will be gone in future versions.")] #[deprecated(since="0.11.12", note="This method will be gone in future versions.")]