Use http::Response to describe response type#161
Open
tottoto wants to merge 3 commits intosbstp:masterfrom
Open
Use http::Response to describe response type#161tottoto wants to merge 3 commits intosbstp:masterfrom
tottoto wants to merge 3 commits intosbstp:masterfrom
Conversation
Contributor
Considering typical usage, even within the tests here, I'd say forcing users to add calls to |
This reverts commit 1579dd5.
Contributor
Author
|
Thanks for the feedback. That's exactly what I was thinking of as well. Given the philosophies of the easiness to use, it should be better to keep these APIs. Reverted the second commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is like a RFC rather than a proposal. Uses
http::Responsetype to describe a response type instead of defining an own type. When users are familiar withhttpcrate which is one of the famous libraries for HTTP types, users can use it intuitively. Andattohttpccan free from maintaining the response type itself by delegating it like header types. The first commit changes to usehttp::Responseand moves the existing APIs toResponseExttrait which is newly introduced, except for the following two APIs. By this changes, TheWritetrait implementation forResponseis dropped as Rust's trait rule, and the ability to geturlfromResponseis removed as it is not provided byhttpcrate. I think the both of them might be small backward as they have workaround which is easily achieved. The second commit removes APIs which are simply passed toResponseReader. These APIs are actually for the body, but since they are existing inResponsetype, it is possible to be misleading as it is for the entire response message.