1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 09:42:40 +01: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] #[inline]
/// Construct new http request with new RouteInfo. /// Construct new http request with new RouteInfo.
pub(crate) fn with_route_info(&self, mut resource: ResourceInfo) -> HttpRequest<S> { pub(crate) fn with_route_info(&self, mut resource: ResourceInfo) -> HttpRequest<S> {