From 542782f28a6a2c9215f63be27bd13d68a17b5523 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 8 Aug 2018 13:57:13 -0700 Subject: [PATCH] add HttpRequest::drop_state() --- src/httprequest.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/httprequest.rs b/src/httprequest.rs index 6f3bfe13e..a21d772e8 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -81,6 +81,15 @@ impl HttpRequest { } } + /// 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 {