feat: add GrpcMethod extension into request for client (#1275)

* feat: add GrpcMethod extension into request for client

* refactor: change GrpcMethod fields into private and expose methods instead

* refactor: hide GrpcMethod::new in doc

---------

Co-authored-by: Lucio Franco <[email protected]>
This commit is contained in:
林玮 (Jade Lin)
2023-02-23 10:06:45 +00:00
committed by GitHub
co-authored by Lucio Franco
parent 1547f968b4
commit 7a6b20d8ef
9 changed files with 207 additions and 85 deletions
@@ -247,7 +247,15 @@ pub mod server_reflection_client {
let path = http::uri::PathAndQuery::from_static(
"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo",
);
self.inner.streaming(request.into_streaming_request(), path, codec).await
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.reflection.v1alpha.ServerReflection",
"ServerReflectionInfo",
),
);
self.inner.streaming(req, path, codec).await
}
}
}