Files
tonic/tonic/Cargo.toml
T
David PedersenandGitHub 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

94 lines
2.4 KiB
TOML

[package]
name = "tonic"
# When releasing to crates.io:
# - Remove path dependencies
# - Update html_root_url.
# - Update doc url
# - Cargo.toml
# - README.md
# - Update CHANGELOG.md.
# - Create "v0.4.x" git tag.
version = "0.4.3"
authors = ["Lucio Franco <[email protected]>"]
edition = "2018"
license = "MIT"
documentation = "https://docs.rs/tonic/0.4.3/tonic/"
repository = "https://github.com/hyperium/tonic"
homepage = "https://github.com/hyperium/tonic"
description = """
A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.
"""
readme = "../README.md"
categories = ["web-programming", "network-programming", "asynchronous"]
keywords = ["rpc", "grpc", "async", "futures", "protobuf"]
[features]
default = ["transport", "codegen", "prost"]
codegen = ["async-trait"]
transport = [
"h2",
"hyper",
"tokio",
"tower",
"tracing-futures",
"tokio/macros",
"tokio/time",
]
tls = ["transport", "tokio-rustls"]
tls-roots = ["tls", "rustls-native-certs"]
prost = ["prost1", "prost-derive"]
# [[bench]]
# name = "bench_main"
# harness = false
[dependencies]
bytes = "1.0"
futures-core = { version = "0.3", default-features = false }
futures-util = { version = "0.3", default-features = false }
tracing = "0.1"
http = "0.2"
base64 = "0.13"
percent-encoding = "2.1"
tower-service = "0.3"
tokio-util = { version = "0.6", features = ["codec"] }
async-stream = "0.3"
http-body = "0.4.2"
pin-project = "1.0"
# prost
prost1 = { package = "prost", version = "0.7", optional = true }
prost-derive = { version = "0.7", optional = true }
# codegen
async-trait = { version = "0.1.13", optional = true }
# transport
h2 = { version = "0.3", optional = true }
hyper = { version = "0.14.2", features = ["full"], optional = true }
tokio = { version = "1.0.1", features = ["net"], optional = true }
tokio-stream = "0.1"
tower = { version = "0.4.7", features = ["balance", "buffer", "discover", "limit", "load", "make", "timeout", "util"], optional = true }
tracing-futures = { version = "0.2", optional = true }
# rustls
tokio-rustls = { version = "0.22", optional = true }
rustls-native-certs = { version = "0.5", optional = true }
[dev-dependencies]
tokio = { version = "1.0", features = ["rt", "macros"] }
static_assertions = "1.0"
rand = "0.8"
bencher = "0.1.5"
quickcheck = "1.0"
quickcheck_macros = "1.0"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[[bench]]
name = "decode"
harness = false