Cargo Features

[dependencies]
tonic = { version = "0.11.0", default-features = false, features = ["codegen", "gzip", "zstd", "prost", "tls", "tls-roots", "tls-roots-common", "tls-webpki-roots", "transport", "channel"] }
default = codegen, prost, transport

These default features are set whenever tonic is added without default-features = false somewhere in the dependency tree.

codegen default

Enables async-trait

Affects tonic::codegen

gzip

Enables flate2

compression

zstd

Enables zstd ^0.12.3

prost default

Enables prost

tls tls-roots-common? = transport

Enables tokio-rustls ^0.25, rustls-pemfile and rustls-pki-types, macros and rt of tokio

Affects conn::TlsConnectInfo

tls-roots = tls-roots-common

Enables rustls-native-certs

tls-roots-common tls-roots? tls-webpki-roots? = tls
tls-webpki-roots = tls-roots-common

Enables webpki-roots

transport default tls? = channel

Enables tower, net and time of tokio and async-stream, axum ^0.6.9, h2 ^0.3.24, hyper ^0.14.26, and hyper-timeout ^0.4

async-stream:

rustls

Affects tonic::transport

channel transport

Features from optional dependencies

harness = false