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

feat(body): update Body trait to use Frames #3020

Merged
merged 1 commit into from
Oct 24, 2022
Merged

Conversation

seanmonstar
Copy link
Member

The Body trait was adjusted to be forwards compatible with adding new frame types. That resulted in changing from poll_data and poll_trailers to a single poll_frame function. More can be learned from the proposal in #2840.

Closes #3010

BREAKING CHANGE: The polling functions of the Body trait have been
redesigned.

The free functions hyper::body::to_bytes and aggregate have been
removed. Similar functionality is on
http_body_util::BodyExt::collect.

Comment on lines +65 to +66
while let Some(next) = res.frame().await {
let frame = next?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
while let Some(next) = res.frame().await {
let frame = next?;
while let Some(frame) = res.frame().await.transpose()? {

I think we can write it like this?

src/lib.rs Outdated Show resolved Hide resolved
@seanmonstar seanmonstar force-pushed the http-body-up branch 7 times, most recently from 8c09ade to e49e26d Compare October 24, 2022 19:40
The `Body` trait was adjusted to be forwards compatible with adding new
frame types. That resulted in changing from `poll_data` and `poll_trailers`
to a single `poll_frame` function. More can be learned from the proposal
in #2840.

BREAKING CHANGE: The polling functions of the `Body` trait have been
  redesigned.

  The free functions `hyper::body::to_bytes` and `aggregate` have been
  removed. Similar functionality is on
  `http_body_util::BodyExt::collect`.
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.

Update to use new http-body trait
2 participants