You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
robjtede
changed the title
[Feature request] Allow non-destructive access to a request/payload of a ServiceRequest
Allow non-destructive access to a request/payload of a ServiceRequest
Apr 19, 2021
I really don't understand why it was decided to only add a parts_mut and not also a parts. I'm in a situation where I have a &ServiceRequest and I can't find any (non-UB) way of getting a hold of the inner &HttpRequest.
I really don't understand why it was decided to only add a parts_mut and not also a parts. I'm in a situation where I have a &ServiceRequest and I can't find any (non-UB) way of getting a hold of the inner &HttpRequest.
This quite reasonable. Please consider opening another issue that covers ServiceResponse as well.
Expected Behavior
Expose references (mutable references) to a request and a payload of a ServiceRequest.
Current Behavior
ServiceRequest
allows to get a request and a payload by invokinginto_parts
method. But this method consumes aServiceRequest
.Possible Solution
Context
A middleware may have a need to access a request (or a payload) by a borrowed reference to A
ServiceRequest
.Related issues: #2168 #1821
The text was updated successfully, but these errors were encountered: