From f731b6c0b64ac450326ea215ea31f3576d2c7910 Mon Sep 17 00:00:00 2001 From: tottoto Date: Thu, 20 Jun 2024 14:47:29 +0900 Subject: [PATCH] chore(server): Move io service to server module --- tonic/src/transport/server/incoming.rs | 3 +-- tonic/src/transport/server/mod.rs | 4 ++-- tonic/src/transport/{ => server}/service/io.rs | 0 tonic/src/transport/server/service/mod.rs | 3 +++ tonic/src/transport/service/mod.rs | 4 ---- 5 files changed, 6 insertions(+), 8 deletions(-) rename tonic/src/transport/{ => server}/service/io.rs (100%) diff --git a/tonic/src/transport/server/incoming.rs b/tonic/src/transport/server/incoming.rs index 7f5f76c25..75f40650e 100644 --- a/tonic/src/transport/server/incoming.rs +++ b/tonic/src/transport/server/incoming.rs @@ -1,5 +1,4 @@ -use super::{Connected, Server}; -use crate::transport::service::ServerIo; +use super::{service::ServerIo, Connected, Server}; use std::{ net::{SocketAddr, TcpListener as StdTcpListener}, pin::{pin, Pin}, diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index 9c76391df..ab9afe6f3 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -41,8 +41,8 @@ pub(crate) use tokio_rustls::server::TlsStream; #[cfg(feature = "tls")] use crate::transport::Error; -use self::recover_error::RecoverError; -use super::service::{GrpcTimeout, ServerIo}; +use self::{recover_error::RecoverError, service::ServerIo}; +use super::service::GrpcTimeout; use crate::body::{boxed, BoxBody}; use crate::server::NamedService; use bytes::Bytes; diff --git a/tonic/src/transport/service/io.rs b/tonic/src/transport/server/service/io.rs similarity index 100% rename from tonic/src/transport/service/io.rs rename to tonic/src/transport/server/service/io.rs diff --git a/tonic/src/transport/server/service/mod.rs b/tonic/src/transport/server/service/mod.rs index ef823c467..bcd9bbd73 100644 --- a/tonic/src/transport/server/service/mod.rs +++ b/tonic/src/transport/server/service/mod.rs @@ -1,3 +1,6 @@ +mod io; +pub(crate) use self::io::ServerIo; + #[cfg(feature = "tls")] mod tls; #[cfg(feature = "tls")] diff --git a/tonic/src/transport/service/mod.rs b/tonic/src/transport/service/mod.rs index 7272a6947..7f1e3fcae 100644 --- a/tonic/src/transport/service/mod.rs +++ b/tonic/src/transport/service/mod.rs @@ -1,9 +1,5 @@ pub(crate) mod grpc_timeout; -#[cfg(feature = "server")] -mod io; #[cfg(feature = "tls")] pub(crate) mod tls; pub(crate) use self::grpc_timeout::GrpcTimeout; -#[cfg(feature = "server")] -pub(crate) use self::io::ServerIo;