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 https://github.com/hyperium/tonic/issues/557
39 lines
794 B
TOML
39 lines
794 B
TOML
[package]
|
|
name = "interop"
|
|
version = "0.1.0"
|
|
authors = ["Lucio Franco <[email protected]>"]
|
|
edition = "2018"
|
|
publish = false
|
|
license = "MIT"
|
|
|
|
[[bin]]
|
|
name = "client"
|
|
path = "src/bin/client.rs"
|
|
|
|
[[bin]]
|
|
name = "server"
|
|
path = "src/bin/server.rs"
|
|
|
|
[dependencies]
|
|
tokio = { version = "1.0", features = ["rt-multi-thread", "time", "macros", "fs"] }
|
|
tokio-stream = "0.1"
|
|
async-stream = "0.3"
|
|
tonic = { path = "../tonic", features = ["tls"] }
|
|
prost = "0.7"
|
|
prost-derive = "0.7"
|
|
bytes = "1.0"
|
|
http = "0.2"
|
|
futures-core = "0.3"
|
|
futures-util = "0.3"
|
|
tower = { version = "0.4" }
|
|
http-body = "0.4.2"
|
|
hyper = "0.14"
|
|
console = "0.14"
|
|
structopt = "0.3"
|
|
tracing = "0.1"
|
|
tracing-subscriber = "0.2"
|
|
tracing-log = "0.1"
|
|
|
|
[build-dependencies]
|
|
tonic-build = { path = "../tonic-build", features = ["prost"] }
|