Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Response#into_parts and Response#from_parts #1263

Conversation

tonyvelichko
Copy link
Contributor

Motivation

In cases when you have to build for example an L7 gRPC proxy with data injection into responses from downstream API it's required to perform copying the whole responses to shift ownership this can be easily avoided by implementing the approach suggested for Request in PR: #1118

Solution

This PR contains two changes:

One is to expose Response#into_parts to easily control the ownership without making unnecessary copying.
Another one is to expose Response#from_parts, in order to have a symmetric API, consistent with Request as well

tonic/src/response.rs Outdated Show resolved Hide resolved
@LucioFranco LucioFranco added this pull request to the merge queue Feb 13, 2023
Merged via the queue into hyperium:master with commit aa69a02 Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants