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(tonic): Use BoxBody from http-body crate #622

Merged
merged 4 commits into from
May 18, 2021

Commits on May 8, 2021

  1. tonic: Use BoxBody from http-body crate

    As of `http-body` 0.4.1 its has had a `BoxBody` type similar to
    `tonic::body::BoxBody`. It also has `Empty` and `Body::map_{data,err}`.
    
    That means all the custom body things we had in tonic can basically be
    replaced with that.
    
    Note that this is a breaking change so we should merge this next time we
    decide to ship a breaking release.
    
    The breaking changes are:
    
    - `tonic::body::Body` has been removed. I think its fine for users to
    depend directly on `http-body` if they need this trait.
    - `tonic::body::BoxBody` is now just a type alias for
    `http_body::combinators::BoxBody<Bytes, Status>`. So the methods it
    previously had are gone. The replacements are
      - `tonic::body::Body::new` -> `http_body::Body::boxed`
      - `tonic::body::Body::map_from` -> `http_body::Body::map_data` and
      `http_body::Body::map_err` depending on which part you want to map.
      - `tonic::body::Body::empty` -> `http_body::Empty`
    
    Additionally a `Sync` bound has been added to a few methods. I actually
    don't think this is a breaking change because the old
    `tonic::body::Body` trait had `Sync` as a supertrait meaning the `Sync`
    requirement was already there.
    
    Fixes #557
    davidpdrsn committed May 8, 2021
    Configuration menu
    Copy the full SHA
    1f14b9e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fa29bae View commit details
    Browse the repository at this point in the history
  3. Update to http-body 0.4.2

    davidpdrsn committed May 8, 2021
    Configuration menu
    Copy the full SHA
    560e39a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2a3cd18 View commit details
    Browse the repository at this point in the history