We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Router::into_router
1 parent d44925b commit ea06a1bCopy full SHA for ea06a1b
tonic/src/transport/server/mod.rs
@@ -571,6 +571,11 @@ impl<L> Router<L> {
571
self
572
}
573
574
+ /// Convert this tonic `Router` into an axum `Router` consuming the tonic one.
575
+ pub fn into_router(self) -> axum::Router {
576
+ self.routes.into_router()
577
+ }
578
+
579
/// Consume this [`Server`] creating a future that will execute the server
580
/// on [tokio]'s default executor.
581
///
tonic/src/transport/service/router.rs
@@ -60,6 +60,11 @@ impl Routes {
60
router: self.router.with_state(()),
61
62
63
64
+ /// Convert this `Routes` into an [`axum::Router`].
65
66
+ self.router
67
68
69
70
async fn unimplemented() -> impl axum::response::IntoResponse {
0 commit comments