From b0c05976daa6ecfd47d461deae0da1588567c923 Mon Sep 17 00:00:00 2001 From: tottoto Date: Fri, 15 Sep 2023 06:42:36 +0900 Subject: [PATCH] chore(transport): Deprecate re-exported NamedService --- interop/src/server.rs | 2 +- tests/integration_tests/tests/extensions.rs | 3 ++- tonic/src/transport/mod.rs | 1 + tonic/src/transport/server/mod.rs | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/interop/src/server.rs b/interop/src/server.rs index f4dd71bcb..6ffb16309 100644 --- a/interop/src/server.rs +++ b/interop/src/server.rs @@ -7,7 +7,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use std::time::Duration; use tokio_stream::StreamExt; -use tonic::{body::BoxBody, transport::NamedService, Code, Request, Response, Status}; +use tonic::{body::BoxBody, server::NamedService, Code, Request, Response, Status}; use tower::Service; pub use pb::test_service_server::TestServiceServer; diff --git a/tests/integration_tests/tests/extensions.rs b/tests/integration_tests/tests/extensions.rs index 85dde0fc7..b112f8e66 100644 --- a/tests/integration_tests/tests/extensions.rs +++ b/tests/integration_tests/tests/extensions.rs @@ -10,7 +10,8 @@ use std::{ use tokio::sync::oneshot; use tonic::{ body::BoxBody, - transport::{Endpoint, NamedService, Server}, + server::NamedService, + transport::{Endpoint, Server}, Request, Response, Status, }; use tower_service::Service; diff --git a/tonic/src/transport/mod.rs b/tonic/src/transport/mod.rs index d5f217528..3fa2bc8c9 100644 --- a/tonic/src/transport/mod.rs +++ b/tonic/src/transport/mod.rs @@ -105,6 +105,7 @@ pub use self::server::Server; pub use self::service::grpc_timeout::TimeoutExpired; pub use self::tls::Certificate; #[doc(inline)] +/// A deprecated re-export. Please use `tonic::server::NamedService` directly. pub use crate::server::NamedService; pub use axum::{body::BoxBody as AxumBoxBody, Router as AxumRouter}; pub use hyper::{Body, Uri}; diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index 7c9e94635..e10f11f68 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -12,6 +12,8 @@ mod unix; pub use super::service::Routes; pub use super::service::RoutesBuilder; +#[doc(inline)] +/// A deprecated re-export. Please use `tonic::server::NamedService` directly. pub use crate::server::NamedService; pub use conn::{Connected, TcpConnectInfo}; #[cfg(feature = "tls")]