From cbee18c2fcadb258bcee0187fc1f3b9e7048fd0f Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Wed, 2 Aug 2023 15:02:20 -0400 Subject: [PATCH 1/2] fix(codegen): Use stream type from codegen mod --- tonic-build/src/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tonic-build/src/server.rs b/tonic-build/src/server.rs index e4de8d80c..06968f4c0 100644 --- a/tonic-build/src/server.rs +++ b/tonic-build/src/server.rs @@ -313,7 +313,7 @@ fn generate_trait_methods( quote! { #stream_doc - type #stream: tokio_stream::Stream> + Send + 'static; + type #stream: tonic::codegen::tokio_stream::Stream> + Send + 'static; #method_doc async fn #name(#self_param, request: tonic::Request<#req_message>) @@ -329,7 +329,7 @@ fn generate_trait_methods( quote! { #stream_doc - type #stream: tokio_stream::Stream> + Send + 'static; + type #stream: tonic::codegen::tokio_stream::Stream> + Send + 'static; #method_doc async fn #name(#self_param, request: tonic::Request>) From 45d256ed95e7f89054a3aed48201a04efb922e46 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Wed, 2 Aug 2023 15:03:45 -0400 Subject: [PATCH 2/2] Add generated code --- tonic-health/src/generated/grpc.health.v1.rs | 2 +- tonic-reflection/src/generated/grpc.reflection.v1alpha.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tonic-health/src/generated/grpc.health.v1.rs b/tonic-health/src/generated/grpc.health.v1.rs index 9ccba4b0b..9662361f0 100644 --- a/tonic-health/src/generated/grpc.health.v1.rs +++ b/tonic-health/src/generated/grpc.health.v1.rs @@ -216,7 +216,7 @@ pub mod health_server { tonic::Status, >; /// Server streaming response type for the Watch method. - type WatchStream: tokio_stream::Stream< + type WatchStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, > + Send diff --git a/tonic-reflection/src/generated/grpc.reflection.v1alpha.rs b/tonic-reflection/src/generated/grpc.reflection.v1alpha.rs index 0c68b8182..5b899af31 100644 --- a/tonic-reflection/src/generated/grpc.reflection.v1alpha.rs +++ b/tonic-reflection/src/generated/grpc.reflection.v1alpha.rs @@ -271,7 +271,7 @@ pub mod server_reflection_server { #[async_trait] pub trait ServerReflection: Send + Sync + 'static { /// Server streaming response type for the ServerReflectionInfo method. - type ServerReflectionInfoStream: tokio_stream::Stream< + type ServerReflectionInfoStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result< super::ServerReflectionResponse, tonic::Status,