diff --git a/tonic/src/service/interceptor.rs b/tonic/src/service/interceptor.rs index 398f8efda..5a38aa058 100644 --- a/tonic/src/service/interceptor.rs +++ b/tonic/src/service/interceptor.rs @@ -189,10 +189,9 @@ where } // required to use `InterceptedService` with `Router` -#[cfg(feature = "transport")] -impl crate::transport::NamedService for InterceptedService +impl crate::server::NamedService for InterceptedService where - S: crate::transport::NamedService, + S: crate::server::NamedService, { const NAME: &'static str = S::NAME; } diff --git a/tonic/src/transport/mod.rs b/tonic/src/transport/mod.rs index e83b4c424..da3f3d67f 100644 --- a/tonic/src/transport/mod.rs +++ b/tonic/src/transport/mod.rs @@ -63,7 +63,7 @@ //! # unimplemented!() //! # } //! # } -//! # impl tonic::transport::NamedService for Svc { +//! # impl tonic::server::NamedService for Svc { //! # const NAME: &'static str = "some_svc"; //! # } //! # let my_svc = Svc; @@ -99,10 +99,12 @@ mod tls; pub use self::channel::{Channel, Endpoint}; pub use self::error::Error; #[doc(inline)] -pub use self::server::{NamedService, Server}; +pub use self::server::Server; #[doc(inline)] pub use self::service::grpc_timeout::TimeoutExpired; pub use self::tls::Certificate; +#[doc(inline)] +pub use crate::server::NamedService; pub use hyper::{Body, Uri}; pub(crate) use self::service::executor::Executor; diff --git a/tonic/src/transport/server/incoming.rs b/tonic/src/transport/server/incoming.rs index b71a655bc..3356b1c28 100644 --- a/tonic/src/transport/server/incoming.rs +++ b/tonic/src/transport/server/incoming.rs @@ -142,7 +142,7 @@ impl TcpIncoming { /// ```no_run /// # use tower_service::Service; /// # use http::{request::Request, response::Response}; - /// # use tonic::{body::BoxBody, transport::{Body, NamedService, Server, server::TcpIncoming}}; + /// # use tonic::{body::BoxBody, server::NamedService, transport::{Body, Server, server::TcpIncoming}}; /// # use core::convert::Infallible; /// # use std::error::Error; /// # fn main() { } // Cannot have type parameters, hence instead define: diff --git a/tonic/src/transport/service/router.rs b/tonic/src/transport/service/router.rs index b00fc3f24..dd4071592 100644 --- a/tonic/src/transport/service/router.rs +++ b/tonic/src/transport/service/router.rs @@ -1,6 +1,6 @@ use crate::{ body::{boxed, BoxBody}, - transport::NamedService, + server::NamedService, }; use http::{Request, Response}; use hyper::Body;