1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 16:55:08 +02:00

ServiceRequest::parts_mut (#2177)

This commit is contained in:
Ibraheem Ahmed
2021-06-22 19:42:00 -04:00
committed by GitHub
parent 3b6333e65f
commit 8846808804
2 changed files with 8 additions and 0 deletions

View File

@ -80,6 +80,12 @@ impl ServiceRequest {
(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.
pub fn from_parts(req: HttpRequest, payload: Payload) -> Self {
Self { req, payload }