1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-08-02 10:45:05 +00:00

add HttpRequest::drop_state()

This commit is contained in:
Nikolay Kim 2018-08-08 13:57:13 -07:00
parent 8eb9eb4247
commit 542782f28a

View file

@ -81,6 +81,15 @@ impl<S> HttpRequest<S> {
}
}
/// Construct new http request with empty state.
pub fn drop_state(&self) -> HttpRequest {
HttpRequest {
Rc::new(()),
req: self.req.as_ref().map(|r| r.clone()),
resource: self.resource.clone(),
}
}
#[inline]
/// Construct new http request with new RouteInfo.
pub(crate) fn with_route_info(&self, mut resource: ResourceInfo) -> HttpRequest<S> {