Files
tonic/examples/Cargo.toml
T
David Pedersen 4dda4cbcca feat(tonic): Use BoxBody from http-body crate (#622)
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
2021-05-18 10:41:21 +02:00

186 lines
3.6 KiB
TOML

[package]
name = "examples"
version = "0.1.0"
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
publish = false
license = "MIT"
[[bin]]
name = "helloworld-server"
path = "src/helloworld/server.rs"
[[bin]]
name = "helloworld-client"
path = "src/helloworld/client.rs"
[[bin]]
name = "blocking-client"
path = "src/blocking/client.rs"
[[bin]]
name = "routeguide-server"
path = "src/routeguide/server.rs"
[[bin]]
name = "routeguide-client"
path = "src/routeguide/client.rs"
[[bin]]
name = "authentication-client"
path = "src/authentication/client.rs"
[[bin]]
name = "authentication-server"
path = "src/authentication/server.rs"
[[bin]]
name = "load-balance-client"
path = "src/load_balance/client.rs"
[[bin]]
name = "load-balance-server"
path = "src/load_balance/server.rs"
[[bin]]
name = "dynamic-load-balance-client"
path = "src/dynamic_load_balance/client.rs"
[[bin]]
name = "dynamic-load-balance-server"
path = "src/dynamic_load_balance/server.rs"
[[bin]]
name = "tls-client"
path = "src/tls/client.rs"
[[bin]]
name = "tls-server"
path = "src/tls/server.rs"
[[bin]]
name = "tls-client-auth-server"
path = "src/tls_client_auth/server.rs"
[[bin]]
name = "tls-client-auth-client"
path = "src/tls_client_auth/client.rs"
[[bin]]
name = "tower-server"
path = "src/tower/server.rs"
[[bin]]
name = "tower-client"
path = "src/tower/client.rs"
[[bin]]
name = "timeout-server"
path = "src/timeout/server.rs"
[[bin]]
name = "timeout-client"
path = "src/timeout/client.rs"
[[bin]]
name = "multiplex-server"
path = "src/multiplex/server.rs"
[[bin]]
name = "multiplex-client"
path = "src/multiplex/client.rs"
[[bin]]
name = "gcp-client"
path = "src/gcp/client.rs"
[[bin]]
name = "tracing-client"
path = "src/tracing/client.rs"
[[bin]]
name = "tracing-server"
path = "src/tracing/server.rs"
[[bin]]
name = "uds-client"
path = "src/uds/client.rs"
[[bin]]
name = "uds-server"
path = "src/uds/server.rs"
[[bin]]
name = "interceptor-client"
path = "src/interceptor/client.rs"
[[bin]]
name = "interceptor-server"
path = "src/interceptor/server.rs"
[[bin]]
name = "hyper-warp-client"
path = "src/hyper_warp/client.rs"
[[bin]]
name = "hyper-warp-server"
path = "src/hyper_warp/server.rs"
[[bin]]
name = "health-server"
path = "src/health/server.rs"
[[bin]]
name = "reflection-server"
path = "src/reflection/server.rs"
[[bin]]
name = "autoreload-server"
path = "src/autoreload/server.rs"
[[bin]]
name = "optional-server"
path = "src/optional/server.rs"
[[bin]]
name = "hyper-warp-multiplex-client"
path = "src/hyper_warp_multiplex/client.rs"
[[bin]]
name = "hyper-warp-multiplex-server"
path = "src/hyper_warp_multiplex/server.rs"
[dependencies]
tonic = { path = "../tonic", features = ["tls"] }
prost = "0.7"
tokio = { version = "1.0", features = ["rt-multi-thread", "time", "fs", "macros", "net"] }
tokio-stream = { version = "0.1", features = ["net"] }
async-stream = "0.3"
futures = { version = "0.3", default-features = false, features = ["alloc"] }
tower = { version = "0.4" }
# Required for routeguide
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rand = "0.8"
# Tracing
tracing = "0.1.16"
tracing-subscriber = { version = "0.2", features = ["tracing-log"] }
tracing-attributes = "0.1"
tracing-futures = "0.2"
# Required for wellknown types
prost-types = "0.7"
# Hyper example
hyper = "0.14"
warp = "0.3"
http = "0.2"
http-body = "0.4.2"
pin-project = "1.0"
# Health example
tonic-health = { path = "../tonic-health" }
# Reflection example
tonic-reflection = { path = "../tonic-reflection" }
listenfd = "0.3"
[build-dependencies]
tonic-build = { path = "../tonic-build", features = ["prost"] }