Use http::Response to describe response type #161
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::Response
type to describe a response type instead of defining an own type. When users are familiar withhttp
crate which is one of the famous libraries for HTTP types, users can use it intuitively. Andattohttpc
can free from maintaining the response type itself by delegating it like header types. The first commit changes to usehttp::Response
and moves the existing APIs toResponseExt
trait which is newly introduced, except for the following two APIs. By this changes, TheWrite
trait implementation forResponse
is dropped as Rust's trait rule, and the ability to geturl
fromResponse
is removed as it is not provided byhttp
crate. 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 inResponse
type, it is possible to be misleading as it is for the entire response message.