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, diff --git a/tonic/src/transport/mod.rs b/tonic/src/transport/mod.rs index 0f84ddd65..d5f217528 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::{body::BoxBody as AxumBoxBody, Router as AxumRouter}; pub use hyper::{Body, Uri}; pub(crate) use self::service::executor::Executor;