mirror of
https://github.com/actix/actix-web.git
synced 2025-01-02 21:38:46 +00:00
add HttpRequest::drop_state()
This commit is contained in:
parent
8eb9eb4247
commit
542782f28a
1 changed files with 9 additions and 0 deletions
|
@ -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> {
|
||||||
|
|
Loading…
Reference in a new issue