Skip to content

Commit

Permalink
tonic-reflection: feature-gate server impl (#1605)
Browse files Browse the repository at this point in the history
* tonic-reflection: feature-gate server impl

* Update tonic-reflection/Cargo.toml

---------

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
  • Loading branch information
A-Manning and LucioFranco authored Jan 25, 2024
1 parent 0c4fd0b commit a1d6daa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tonic-reflection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,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 a1d6daa

Please sign in to comment.