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

Add consume API #284

Merged
merged 5 commits into from
Jan 12, 2021
Merged

Add consume API #284

merged 5 commits into from
Jan 12, 2021

Conversation

sagebind
Copy link
Owner

@sagebind sagebind commented Dec 31, 2020

Add ReadResponseExt::consume and AsyncReadResponseExt::consume methods for reading and discarding a response body as described in #257.

Also update future types used by AsyncReadResponseExt to be Send whenever T is Send as appropriate. Consolidate the newtype futures with a macro that handles conditional Send properly to reduce boilerplate and chance of mistakes.

Fixes #257.

Add `ReadResponseExt::consume` and `AsyncReadResponseExt::consume` methods for reading and discarding a response bod as described in #257.

Also update future types used by `AsyncReadResponseExt` to be `Send` whenever `T` is `Send` as appropriate.

Fixes #257 and #283.
@codecov
Copy link

codecov bot commented Dec 31, 2020

Codecov Report

Merging #284 (1efdc56) into master (dacdad2) will increase coverage by 0.47%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #284      +/-   ##
==========================================
+ Coverage   72.87%   73.35%   +0.47%     
==========================================
  Files          51       52       +1     
  Lines        2728     2762      +34     
==========================================
+ Hits         1988     2026      +38     
+ Misses        740      736       -4     
Impacted Files Coverage Δ
src/response.rs 77.77% <100.00%> (+7.77%) ⬆️
tests/response_body.rs 100.00% <100.00%> (ø)
src/macros.rs 100.00% <0.00%> (ø)
src/client.rs 66.99% <0.00%> (+0.77%) ⬆️
src/body/mod.rs 83.17% <0.00%> (+1.86%) ⬆️
src/lib.rs 76.19% <0.00%> (+2.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dacdad2...1efdc56. Read the comment docs.

@sagebind sagebind merged commit d4f33cc into master Jan 12, 2021
@sagebind sagebind deleted the consume branch January 12, 2021 04:25
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.

Convenience methods to consume response body
1 participant