From 241e0848b9e88636b3617f3a68e704f552d65187 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 28 Aug 2023 23:34:53 +0900 Subject: [PATCH 1/3] chore(transport) Re-export axum::Router as AxumRouter --- tonic/src/transport/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tonic/src/transport/mod.rs b/tonic/src/transport/mod.rs index 0f84ddd65..d2241d364 100644 --- a/tonic/src/transport/mod.rs +++ b/tonic/src/transport/mod.rs @@ -106,6 +106,7 @@ pub use self::service::grpc_timeout::TimeoutExpired; pub use self::tls::Certificate; #[doc(inline)] pub use crate::server::NamedService; +pub use axum::Router as AxumRouter; pub use hyper::{Body, Uri}; pub(crate) use self::service::executor::Executor; From eb1aa0ef5aa8caaecbb866f89127f3dadc63195c Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 30 Aug 2023 01:19:25 +0900 Subject: [PATCH 2/3] chore(transport): Re-export axum::body::BoxBody As AxumBoxBody --- tonic/src/transport/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/src/transport/mod.rs b/tonic/src/transport/mod.rs index d2241d364..d5f217528 100644 --- a/tonic/src/transport/mod.rs +++ b/tonic/src/transport/mod.rs @@ -106,7 +106,7 @@ pub use self::service::grpc_timeout::TimeoutExpired; pub use self::tls::Certificate; #[doc(inline)] pub use crate::server::NamedService; -pub use axum::Router as AxumRouter; +pub use axum::{body::BoxBody as AxumBoxBody, Router as AxumRouter}; pub use hyper::{Body, Uri}; pub(crate) use self::service::executor::Executor; From fa5d8b37ac5addf91d77433b6a6068ead0a40c8d Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 30 Aug 2023 01:26:34 +0900 Subject: [PATCH 3/3] chore(examples): Use re-exported axum BoxBody --- examples/Cargo.toml | 5 ++--- examples/src/h2c/server.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 545c8c9f1..d627b631a 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -299,10 +299,10 @@ dynamic-load-balance = ["dep:tower"] timeout = ["tokio/time", "dep:tower"] tls-client-auth = ["tonic/tls"] types = ["dep:tonic-types"] -h2c = ["dep:hyper", "dep:axum", "dep:tower", "dep:http"] +h2c = ["dep:hyper", "dep:tower", "dep:http"] cancellation = ["dep:tokio-util"] -full = ["gcp", "routeguide", "reflection", "autoreload", "health", "grpc-web", "tracing", "hyper-warp", "hyper-warp-multiplex", "uds", "streaming", "mock", "tower", "json-codec", "compression", "tls", "tls-rustls", "dynamic-load-balance", "timeout", "tls-client-auth", "types", "cancellation"] +full = ["gcp", "routeguide", "reflection", "autoreload", "health", "grpc-web", "tracing", "hyper-warp", "hyper-warp-multiplex", "uds", "streaming", "mock", "tower", "json-codec", "compression", "tls", "tls-rustls", "dynamic-load-balance", "timeout", "tls-client-auth", "types", "cancellation", "h2c"] default = ["full"] [dependencies] @@ -315,7 +315,6 @@ tonic-web = { path = "../tonic-web", optional = true } tonic-health = { path = "../tonic-health", optional = true } tonic-reflection = { path = "../tonic-reflection", optional = true } tonic-types = { path = "../tonic-types", optional = true } -axum = { version = "0.6", optional = true } either = { version = "1.9", optional = true } async-stream = { version = "0.3", optional = true } tokio-stream = { version = "0.1", optional = true } diff --git a/examples/src/h2c/server.rs b/examples/src/h2c/server.rs index 8fbb17203..92d08a417 100644 --- a/examples/src/h2c/server.rs +++ b/examples/src/h2c/server.rs @@ -61,7 +61,7 @@ mod h2c { impl Service> for H2c where - S: Service, Response = Response> + S: Service, Response = Response> + Clone + Send + 'static,