Skip to content

Commit

Permalink
tonic-reflection: feature-gate server impl
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Manning committed Jan 16, 2024
1 parent 177c1f3 commit 7730c65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tonic-reflection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
authors = [
"James Nugent <james@jen20.com>",
"Samani G. Gikandi <samani@gojulas.com>",
"Ash Manning <10554686+A-Manning@users.noreply.github.com>"
]
categories = ["network-programming", "asynchronous"]
description = """
Expand All @@ -17,11 +18,19 @@ readme = "README.md"
repository = "https://github.com/hyperium/tonic"
version = "0.10.2"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
server = ["dep:tokio", "dep:tokio-stream"]
default = ["server"]

[dependencies]
prost = "0.12"
prost-types = "0.12"
tokio = {version = "1.0", features = ["sync", "rt"]}
tokio-stream = {version = "0.1", features = ["net"]}
tokio = { version = "1.0", features = ["sync", "rt"], optional = true }
tokio-stream = {version = "0.1", features = ["net"], optional = true }
tonic = { version = "0.10", path = "../tonic", default-features = false, features = ["codegen", "prost"] }

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions tonic-reflection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ pub mod pb {
}

/// Implementation of the server component of gRPC Server Reflection.
#[cfg(feature = "server")]
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
pub mod server;

0 comments on commit 7730c65

Please sign in to comment.