@@ -6,6 +6,13 @@ pub struct HealthCheckResponse {
66 #[ prost( bool , tag = "1" ) ]
77 pub status : bool ,
88}
9+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , :: prost:: Message ) ]
10+ pub struct SetupRequest { }
11+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , :: prost:: Message ) ]
12+ pub struct SetupResponse {
13+ #[ prost( bool , tag = "1" ) ]
14+ pub status : bool ,
15+ }
916/// Generated client implementations.
1017pub mod misc_client {
1118 #![ allow(
@@ -17,7 +24,7 @@ pub mod misc_client {
1724 ) ]
1825 use tonic:: codegen:: * ;
1926 use tonic:: codegen:: http:: Uri ;
20- /// Misc is a simple service that provides miscellaneous RPC methods.
27+ /// / Misc is a simple service that provides miscellaneous RPC methods.
2128 #[ derive( Debug , Clone ) ]
2229 pub struct MiscClient < T > {
2330 inner : tonic:: client:: Grpc < T > ,
@@ -98,7 +105,7 @@ pub mod misc_client {
98105 self . inner = self . inner . max_encoding_message_size ( limit) ;
99106 self
100107 }
101- /// HealthCheck is a simple RPC method that can be used to check the health of the service.
108+ /// / HealthCheck is a simple RPC method that can be used to check the health of the service.
102109 pub async fn health_check (
103110 & mut self ,
104111 request : impl tonic:: IntoRequest < super :: HealthCheckRequest > ,
@@ -120,6 +127,25 @@ pub mod misc_client {
120127 req. extensions_mut ( ) . insert ( GrpcMethod :: new ( "misc.Misc" , "HealthCheck" ) ) ;
121128 self . inner . unary ( req, path, codec) . await
122129 }
130+ /// / Setup is a simple RPC method that can be used to setup the service.
131+ pub async fn setup (
132+ & mut self ,
133+ request : impl tonic:: IntoRequest < super :: SetupRequest > ,
134+ ) -> std:: result:: Result < tonic:: Response < super :: SetupResponse > , tonic:: Status > {
135+ self . inner
136+ . ready ( )
137+ . await
138+ . map_err ( |e| {
139+ tonic:: Status :: unknown (
140+ format ! ( "Service was not ready: {}" , e. into( ) ) ,
141+ )
142+ } ) ?;
143+ let codec = tonic_prost:: ProstCodec :: default ( ) ;
144+ let path = http:: uri:: PathAndQuery :: from_static ( "/misc.Misc/Setup" ) ;
145+ let mut req = request. into_request ( ) ;
146+ req. extensions_mut ( ) . insert ( GrpcMethod :: new ( "misc.Misc" , "Setup" ) ) ;
147+ self . inner . unary ( req, path, codec) . await
148+ }
123149 }
124150}
125151/// Generated server implementations.
@@ -135,16 +161,21 @@ pub mod misc_server {
135161 /// Generated trait containing gRPC methods that should be implemented for use with MiscServer.
136162 #[ async_trait]
137163 pub trait Misc : std:: marker:: Send + std:: marker:: Sync + ' static {
138- /// HealthCheck is a simple RPC method that can be used to check the health of the service.
164+ /// / HealthCheck is a simple RPC method that can be used to check the health of the service.
139165 async fn health_check (
140166 & self ,
141167 request : tonic:: Request < super :: HealthCheckRequest > ,
142168 ) -> std:: result:: Result <
143169 tonic:: Response < super :: HealthCheckResponse > ,
144170 tonic:: Status ,
145171 > ;
172+ /// / Setup is a simple RPC method that can be used to setup the service.
173+ async fn setup (
174+ & self ,
175+ request : tonic:: Request < super :: SetupRequest > ,
176+ ) -> std:: result:: Result < tonic:: Response < super :: SetupResponse > , tonic:: Status > ;
146177 }
147- /// Misc is a simple service that provides miscellaneous RPC methods.
178+ /// / Misc is a simple service that provides miscellaneous RPC methods.
148179 #[ derive( Debug ) ]
149180 pub struct MiscServer < T > {
150181 inner : Arc < T > ,
@@ -264,6 +295,49 @@ pub mod misc_server {
264295 } ;
265296 Box :: pin ( fut)
266297 }
298+ "/misc.Misc/Setup" => {
299+ #[ allow( non_camel_case_types) ]
300+ struct SetupSvc < T : Misc > ( pub Arc < T > ) ;
301+ impl < T : Misc > tonic:: server:: UnaryService < super :: SetupRequest >
302+ for SetupSvc < T > {
303+ type Response = super :: SetupResponse ;
304+ type Future = BoxFuture <
305+ tonic:: Response < Self :: Response > ,
306+ tonic:: Status ,
307+ > ;
308+ fn call (
309+ & mut self ,
310+ request : tonic:: Request < super :: SetupRequest > ,
311+ ) -> Self :: Future {
312+ let inner = Arc :: clone ( & self . 0 ) ;
313+ let fut = async move {
314+ <T as Misc >:: setup ( & inner, request) . await
315+ } ;
316+ Box :: pin ( fut)
317+ }
318+ }
319+ let accept_compression_encodings = self . accept_compression_encodings ;
320+ let send_compression_encodings = self . send_compression_encodings ;
321+ let max_decoding_message_size = self . max_decoding_message_size ;
322+ let max_encoding_message_size = self . max_encoding_message_size ;
323+ let inner = self . inner . clone ( ) ;
324+ let fut = async move {
325+ let method = SetupSvc ( inner) ;
326+ let codec = tonic_prost:: ProstCodec :: default ( ) ;
327+ let mut grpc = tonic:: server:: Grpc :: new ( codec)
328+ . apply_compression_config (
329+ accept_compression_encodings,
330+ send_compression_encodings,
331+ )
332+ . apply_max_message_size_config (
333+ max_decoding_message_size,
334+ max_encoding_message_size,
335+ ) ;
336+ let res = grpc. unary ( method, req) . await ;
337+ Ok ( res)
338+ } ;
339+ Box :: pin ( fut)
340+ }
267341 _ => {
268342 Box :: pin ( async move {
269343 let mut response = http:: Response :: new (
0 commit comments