Skip to content

Commit 6db46e0

Browse files
tottotoLucioFranco
andauthored
chore(transport) Re-export axum::Router as AxumRouter (#1483)
* chore(transport) Re-export axum::Router as AxumRouter * chore(transport): Re-export axum::body::BoxBody As AxumBoxBody * chore(examples): Use re-exported axum BoxBody --------- Co-authored-by: Lucio Franco <[email protected]>
1 parent 76eedc1 commit 6db46e0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ dynamic-load-balance = ["dep:tower"]
299299
timeout = ["tokio/time", "dep:tower"]
300300
tls-client-auth = ["tonic/tls"]
301301
types = ["dep:tonic-types"]
302-
h2c = ["dep:hyper", "dep:axum", "dep:tower", "dep:http"]
302+
h2c = ["dep:hyper", "dep:tower", "dep:http"]
303303
cancellation = ["dep:tokio-util"]
304304

305-
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"]
305+
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"]
306306
default = ["full"]
307307

308308
[dependencies]
@@ -315,7 +315,6 @@ tonic-web = { path = "../tonic-web", optional = true }
315315
tonic-health = { path = "../tonic-health", optional = true }
316316
tonic-reflection = { path = "../tonic-reflection", optional = true }
317317
tonic-types = { path = "../tonic-types", optional = true }
318-
axum = { version = "0.6", optional = true }
319318
either = { version = "1.9", optional = true }
320319
async-stream = { version = "0.3", optional = true }
321320
tokio-stream = { version = "0.1", optional = true }

examples/src/h2c/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ mod h2c {
6161

6262
impl<S> Service<Request<Body>> for H2c<S>
6363
where
64-
S: Service<Request<Body>, Response = Response<axum::body::BoxBody>>
64+
S: Service<Request<Body>, Response = Response<tonic::transport::AxumBoxBody>>
6565
+ Clone
6666
+ Send
6767
+ 'static,

tonic/src/transport/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ pub use self::service::grpc_timeout::TimeoutExpired;
106106
pub use self::tls::Certificate;
107107
#[doc(inline)]
108108
pub use crate::server::NamedService;
109+
pub use axum::{body::BoxBody as AxumBoxBody, Router as AxumRouter};
109110
pub use hyper::{Body, Uri};
110111

111112
pub(crate) use self::service::executor::Executor;

0 commit comments

Comments
 (0)