From 7730c65bc99b31fec2967fdd2f2b06a0423e6fd0 Mon Sep 17 00:00:00 2001 From: Ash Manning <10554686+A-Manning@users.noreply.github.com> Date: Tue, 19 Dec 2023 22:34:16 +0800 Subject: [PATCH 1/2] tonic-reflection: feature-gate server impl --- tonic-reflection/Cargo.toml | 13 +++++++++++-- tonic-reflection/src/lib.rs | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 6b764354a..fe2d84546 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -2,6 +2,7 @@ authors = [ "James Nugent ", "Samani G. Gikandi ", + "Ash Manning <10554686+A-Manning@users.noreply.github.com>" ] categories = ["network-programming", "asynchronous"] description = """ @@ -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] diff --git a/tonic-reflection/src/lib.rs b/tonic-reflection/src/lib.rs index 01d011083..c15f23229 100644 --- a/tonic-reflection/src/lib.rs +++ b/tonic-reflection/src/lib.rs @@ -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; From faf900b37854a154655ad651eed7a07a001bb21f Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 25 Jan 2024 10:00:31 -0500 Subject: [PATCH 2/2] Update tonic-reflection/Cargo.toml --- tonic-reflection/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index fe2d84546..302107432 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -2,7 +2,6 @@ authors = [ "James Nugent ", "Samani G. Gikandi ", - "Ash Manning <10554686+A-Manning@users.noreply.github.com>" ] categories = ["network-programming", "asynchronous"] description = """