mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
add HttpRequest::drop_state()
This commit is contained in:
parent
8eb9eb4247
commit
542782f28a
@ -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 New Issue
Block a user