ServiceRequest::parts_mut

This commit is contained in:
ibraheemdev 2021-04-19 19:05:09 -04:00
parent 427fe6bd82
commit e5d3fd1f93
1 changed files with 6 additions and 0 deletions

View File

@ -86,6 +86,12 @@ impl ServiceRequest {
(self.req, self.payload) (self.req, self.payload)
} }
/// Get mutable access to inner `HttpRequest` and `Payload`
#[inline]
pub fn parts_mut(&mut self) -> (&mut HttpRequest, &mut Payload) {
(&mut self.req, &mut self.payload)
}
/// Construct request from parts. /// Construct request from parts.
pub fn from_parts(req: HttpRequest, payload: Payload) -> Self { pub fn from_parts(req: HttpRequest, payload: Payload) -> Self {
Self { req, payload } Self { req, payload }