fix(build): Allow Services to be named Result (#1203)

closes #1156
This commit is contained in:
Shrutesh Pachineela
2022-12-21 22:37:07 +05:30
committed by GitHub
parent a72cf04b44
commit a562a3ce32
10 changed files with 86 additions and 21 deletions
+12 -6
View File
@@ -119,7 +119,10 @@ pub mod health_client {
pub async fn check(
&mut self,
request: impl tonic::IntoRequest<super::HealthCheckRequest>,
) -> Result<tonic::Response<super::HealthCheckResponse>, tonic::Status> {
) -> std::result::Result<
tonic::Response<super::HealthCheckResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
@@ -153,7 +156,7 @@ pub mod health_client {
pub async fn watch(
&mut self,
request: impl tonic::IntoRequest<super::HealthCheckRequest>,
) -> Result<
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::HealthCheckResponse>>,
tonic::Status,
> {
@@ -186,10 +189,13 @@ pub mod health_server {
async fn check(
&self,
request: tonic::Request<super::HealthCheckRequest>,
) -> Result<tonic::Response<super::HealthCheckResponse>, tonic::Status>;
) -> std::result::Result<
tonic::Response<super::HealthCheckResponse>,
tonic::Status,
>;
/// Server streaming response type for the Watch method.
type WatchStream: futures_core::Stream<
Item = Result<super::HealthCheckResponse, tonic::Status>,
Item = std::result::Result<super::HealthCheckResponse, tonic::Status>,
>
+ Send
+ 'static;
@@ -211,7 +217,7 @@ pub mod health_server {
async fn watch(
&self,
request: tonic::Request<super::HealthCheckRequest>,
) -> Result<tonic::Response<Self::WatchStream>, tonic::Status>;
) -> std::result::Result<tonic::Response<Self::WatchStream>, tonic::Status>;
}
#[derive(Debug)]
pub struct HealthServer<T: Health> {
@@ -266,7 +272,7 @@ pub mod health_server {
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {