Skip to content

Commit

Permalink
chore(router): Update to axum 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Oct 10, 2024
1 parent cd76a6d commit a9b22aa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tonic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ hyper-util = { version = "0.1.4", features = ["tokio"], optional = true }
socket2 = { version = "0.5", optional = true, features = ["all"] }
tokio = {version = "1", default-features = false, optional = true}
tower = {version = "0.4.7", default-features = false, optional = true}
axum = {version = "0.7", default-features = false, optional = true}
axum = {version = "=0.8.0-alpha.1", default-features = false, optional = true}

# rustls
rustls-pemfile = { version = "2.0", optional = true }
Expand Down
5 changes: 4 additions & 1 deletion tonic/src/service/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ impl RoutesBuilder {
+ NamedService
+ Clone
+ Send
+ Sync
+ 'static,
S::Future: Send + 'static,
{
Expand Down Expand Up @@ -64,6 +65,7 @@ impl Routes {
+ NamedService
+ Clone
+ Send
+ Sync
+ 'static,
S::Future: Send + 'static,
{
Expand All @@ -82,11 +84,12 @@ impl Routes {
+ NamedService
+ Clone
+ Send
+ Sync
+ 'static,
S::Future: Send + 'static,
{
self.router = self.router.route_service(
&format!("/{}/*rest", S::NAME),
&format!("/{}/{{*rest}}", S::NAME),
svc.map_request(|req: Request<axum::body::Body>| req.map(boxed)),
);
self
Expand Down
2 changes: 1 addition & 1 deletion tonic/src/transport/server/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl TcpIncoming {
/// # fn main() { } // Cannot have type parameters, hence instead define:
/// # fn run<S>(some_service: S) -> Result<(), Box<dyn Error + Send + Sync>>
/// # where
/// # S: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Infallible> + NamedService + Clone + Send + 'static,
/// # S: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Infallible> + NamedService + Clone + Send + Sync + 'static,
/// # S::Future: Send + 'static,
/// # {
/// // Find a free port
Expand Down
4 changes: 4 additions & 0 deletions tonic/src/transport/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ impl<L> Server<L> {
+ NamedService
+ Clone
+ Send
+ Sync
+ 'static,
S::Future: Send + 'static,
L: Clone,
Expand All @@ -423,6 +424,7 @@ impl<L> Server<L> {
+ NamedService
+ Clone
+ Send
+ Sync
+ 'static,
S::Future: Send + 'static,
L: Clone,
Expand Down Expand Up @@ -741,6 +743,7 @@ impl<L> Router<L> {
+ NamedService
+ Clone
+ Send
+ Sync
+ 'static,
S::Future: Send + 'static,
{
Expand All @@ -760,6 +763,7 @@ impl<L> Router<L> {
+ NamedService
+ Clone
+ Send
+ Sync
+ 'static,
S::Future: Send + 'static,
{
Expand Down

0 comments on commit a9b22aa

Please sign in to comment.