Skip to content

Commit

Permalink
chore(transport) Re-export axum::Router as AxumRouter (#1483)
Browse files Browse the repository at this point in the history
* 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 <luciofranco14@gmail.com>
  • Loading branch information
tottoto and LucioFranco authored Sep 1, 2023
1 parent 76eedc1 commit 6db46e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion examples/src/h2c/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mod h2c {

impl<S> Service<Request<Body>> for H2c<S>
where
S: Service<Request<Body>, Response = Response<axum::body::BoxBody>>
S: Service<Request<Body>, Response = Response<tonic::transport::AxumBoxBody>>
+ Clone
+ Send
+ 'static,
Expand Down
1 change: 1 addition & 0 deletions tonic/src/transport/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6db46e0

Please sign in to comment.