1#![allow(unknown_lints)]
6#![allow(clippy::all)]
7#![allow(box_pointers)]
8#![allow(dead_code)]
9#![allow(missing_docs)]
10#![allow(non_camel_case_types)]
11#![allow(non_snake_case)]
12#![allow(non_upper_case_globals)]
13#![allow(trivial_casts)]
14#![allow(unsafe_code)]
15#![allow(unused_imports)]
16#![allow(unused_results)]
17
18const METHOD_TEST_SERVICE_EMPTY_CALL: ::grpcio::Method<super::empty::Empty, super::empty::Empty> =
19 ::grpcio::Method {
20 ty: ::grpcio::MethodType::Unary,
21 name: "/grpc.testing.TestService/EmptyCall",
22 req_mar: ::grpcio::Marshaller {
23 ser: ::grpcio::pb_ser,
24 de: ::grpcio::pb_de,
25 },
26 resp_mar: ::grpcio::Marshaller {
27 ser: ::grpcio::pb_ser,
28 de: ::grpcio::pb_de,
29 },
30 };
31
32const METHOD_TEST_SERVICE_UNARY_CALL: ::grpcio::Method<
33 super::messages::SimpleRequest,
34 super::messages::SimpleResponse,
35> = ::grpcio::Method {
36 ty: ::grpcio::MethodType::Unary,
37 name: "/grpc.testing.TestService/UnaryCall",
38 req_mar: ::grpcio::Marshaller {
39 ser: ::grpcio::pb_ser,
40 de: ::grpcio::pb_de,
41 },
42 resp_mar: ::grpcio::Marshaller {
43 ser: ::grpcio::pb_ser,
44 de: ::grpcio::pb_de,
45 },
46};
47
48const METHOD_TEST_SERVICE_CACHEABLE_UNARY_CALL: ::grpcio::Method<
49 super::messages::SimpleRequest,
50 super::messages::SimpleResponse,
51> = ::grpcio::Method {
52 ty: ::grpcio::MethodType::Unary,
53 name: "/grpc.testing.TestService/CacheableUnaryCall",
54 req_mar: ::grpcio::Marshaller {
55 ser: ::grpcio::pb_ser,
56 de: ::grpcio::pb_de,
57 },
58 resp_mar: ::grpcio::Marshaller {
59 ser: ::grpcio::pb_ser,
60 de: ::grpcio::pb_de,
61 },
62};
63
64const METHOD_TEST_SERVICE_STREAMING_OUTPUT_CALL: ::grpcio::Method<
65 super::messages::StreamingOutputCallRequest,
66 super::messages::StreamingOutputCallResponse,
67> = ::grpcio::Method {
68 ty: ::grpcio::MethodType::ServerStreaming,
69 name: "/grpc.testing.TestService/StreamingOutputCall",
70 req_mar: ::grpcio::Marshaller {
71 ser: ::grpcio::pb_ser,
72 de: ::grpcio::pb_de,
73 },
74 resp_mar: ::grpcio::Marshaller {
75 ser: ::grpcio::pb_ser,
76 de: ::grpcio::pb_de,
77 },
78};
79
80const METHOD_TEST_SERVICE_STREAMING_INPUT_CALL: ::grpcio::Method<
81 super::messages::StreamingInputCallRequest,
82 super::messages::StreamingInputCallResponse,
83> = ::grpcio::Method {
84 ty: ::grpcio::MethodType::ClientStreaming,
85 name: "/grpc.testing.TestService/StreamingInputCall",
86 req_mar: ::grpcio::Marshaller {
87 ser: ::grpcio::pb_ser,
88 de: ::grpcio::pb_de,
89 },
90 resp_mar: ::grpcio::Marshaller {
91 ser: ::grpcio::pb_ser,
92 de: ::grpcio::pb_de,
93 },
94};
95
96const METHOD_TEST_SERVICE_FULL_DUPLEX_CALL: ::grpcio::Method<
97 super::messages::StreamingOutputCallRequest,
98 super::messages::StreamingOutputCallResponse,
99> = ::grpcio::Method {
100 ty: ::grpcio::MethodType::Duplex,
101 name: "/grpc.testing.TestService/FullDuplexCall",
102 req_mar: ::grpcio::Marshaller {
103 ser: ::grpcio::pb_ser,
104 de: ::grpcio::pb_de,
105 },
106 resp_mar: ::grpcio::Marshaller {
107 ser: ::grpcio::pb_ser,
108 de: ::grpcio::pb_de,
109 },
110};
111
112const METHOD_TEST_SERVICE_HALF_DUPLEX_CALL: ::grpcio::Method<
113 super::messages::StreamingOutputCallRequest,
114 super::messages::StreamingOutputCallResponse,
115> = ::grpcio::Method {
116 ty: ::grpcio::MethodType::Duplex,
117 name: "/grpc.testing.TestService/HalfDuplexCall",
118 req_mar: ::grpcio::Marshaller {
119 ser: ::grpcio::pb_ser,
120 de: ::grpcio::pb_de,
121 },
122 resp_mar: ::grpcio::Marshaller {
123 ser: ::grpcio::pb_ser,
124 de: ::grpcio::pb_de,
125 },
126};
127
128const METHOD_TEST_SERVICE_UNIMPLEMENTED_CALL: ::grpcio::Method<
129 super::empty::Empty,
130 super::empty::Empty,
131> = ::grpcio::Method {
132 ty: ::grpcio::MethodType::Unary,
133 name: "/grpc.testing.TestService/UnimplementedCall",
134 req_mar: ::grpcio::Marshaller {
135 ser: ::grpcio::pb_ser,
136 de: ::grpcio::pb_de,
137 },
138 resp_mar: ::grpcio::Marshaller {
139 ser: ::grpcio::pb_ser,
140 de: ::grpcio::pb_de,
141 },
142};
143
144#[derive(Clone)]
145pub struct TestServiceClient {
146 pub client: ::grpcio::Client,
147}
148
149impl TestServiceClient {
150 pub fn new(channel: ::grpcio::Channel) -> Self {
151 TestServiceClient {
152 client: ::grpcio::Client::new(channel),
153 }
154 }
155
156 pub fn empty_call_opt(
157 &self,
158 req: &super::empty::Empty,
159 opt: ::grpcio::CallOption,
160 ) -> ::grpcio::Result<super::empty::Empty> {
161 self.client
162 .unary_call(&METHOD_TEST_SERVICE_EMPTY_CALL, req, opt)
163 }
164
165 pub fn empty_call(&self, req: &super::empty::Empty) -> ::grpcio::Result<super::empty::Empty> {
166 self.empty_call_opt(req, ::grpcio::CallOption::default())
167 }
168
169 pub fn empty_call_async_opt(
170 &self,
171 req: &super::empty::Empty,
172 opt: ::grpcio::CallOption,
173 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
174 self.client
175 .unary_call_async(&METHOD_TEST_SERVICE_EMPTY_CALL, req, opt)
176 }
177
178 pub fn empty_call_async(
179 &self,
180 req: &super::empty::Empty,
181 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
182 self.empty_call_async_opt(req, ::grpcio::CallOption::default())
183 }
184
185 pub fn unary_call_opt(
186 &self,
187 req: &super::messages::SimpleRequest,
188 opt: ::grpcio::CallOption,
189 ) -> ::grpcio::Result<super::messages::SimpleResponse> {
190 self.client
191 .unary_call(&METHOD_TEST_SERVICE_UNARY_CALL, req, opt)
192 }
193
194 pub fn unary_call(
195 &self,
196 req: &super::messages::SimpleRequest,
197 ) -> ::grpcio::Result<super::messages::SimpleResponse> {
198 self.unary_call_opt(req, ::grpcio::CallOption::default())
199 }
200
201 pub fn unary_call_async_opt(
202 &self,
203 req: &super::messages::SimpleRequest,
204 opt: ::grpcio::CallOption,
205 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::messages::SimpleResponse>> {
206 self.client
207 .unary_call_async(&METHOD_TEST_SERVICE_UNARY_CALL, req, opt)
208 }
209
210 pub fn unary_call_async(
211 &self,
212 req: &super::messages::SimpleRequest,
213 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::messages::SimpleResponse>> {
214 self.unary_call_async_opt(req, ::grpcio::CallOption::default())
215 }
216
217 pub fn cacheable_unary_call_opt(
218 &self,
219 req: &super::messages::SimpleRequest,
220 opt: ::grpcio::CallOption,
221 ) -> ::grpcio::Result<super::messages::SimpleResponse> {
222 self.client
223 .unary_call(&METHOD_TEST_SERVICE_CACHEABLE_UNARY_CALL, req, opt)
224 }
225
226 pub fn cacheable_unary_call(
227 &self,
228 req: &super::messages::SimpleRequest,
229 ) -> ::grpcio::Result<super::messages::SimpleResponse> {
230 self.cacheable_unary_call_opt(req, ::grpcio::CallOption::default())
231 }
232
233 pub fn cacheable_unary_call_async_opt(
234 &self,
235 req: &super::messages::SimpleRequest,
236 opt: ::grpcio::CallOption,
237 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::messages::SimpleResponse>> {
238 self.client
239 .unary_call_async(&METHOD_TEST_SERVICE_CACHEABLE_UNARY_CALL, req, opt)
240 }
241
242 pub fn cacheable_unary_call_async(
243 &self,
244 req: &super::messages::SimpleRequest,
245 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::messages::SimpleResponse>> {
246 self.cacheable_unary_call_async_opt(req, ::grpcio::CallOption::default())
247 }
248
249 pub fn streaming_output_call_opt(
250 &self,
251 req: &super::messages::StreamingOutputCallRequest,
252 opt: ::grpcio::CallOption,
253 ) -> ::grpcio::Result<
254 ::grpcio::ClientSStreamReceiver<super::messages::StreamingOutputCallResponse>,
255 > {
256 self.client
257 .server_streaming(&METHOD_TEST_SERVICE_STREAMING_OUTPUT_CALL, req, opt)
258 }
259
260 pub fn streaming_output_call(
261 &self,
262 req: &super::messages::StreamingOutputCallRequest,
263 ) -> ::grpcio::Result<
264 ::grpcio::ClientSStreamReceiver<super::messages::StreamingOutputCallResponse>,
265 > {
266 self.streaming_output_call_opt(req, ::grpcio::CallOption::default())
267 }
268
269 pub fn streaming_input_call_opt(
270 &self,
271 opt: ::grpcio::CallOption,
272 ) -> ::grpcio::Result<(
273 ::grpcio::ClientCStreamSender<super::messages::StreamingInputCallRequest>,
274 ::grpcio::ClientCStreamReceiver<super::messages::StreamingInputCallResponse>,
275 )> {
276 self.client
277 .client_streaming(&METHOD_TEST_SERVICE_STREAMING_INPUT_CALL, opt)
278 }
279
280 pub fn streaming_input_call(
281 &self,
282 ) -> ::grpcio::Result<(
283 ::grpcio::ClientCStreamSender<super::messages::StreamingInputCallRequest>,
284 ::grpcio::ClientCStreamReceiver<super::messages::StreamingInputCallResponse>,
285 )> {
286 self.streaming_input_call_opt(::grpcio::CallOption::default())
287 }
288
289 pub fn full_duplex_call_opt(
290 &self,
291 opt: ::grpcio::CallOption,
292 ) -> ::grpcio::Result<(
293 ::grpcio::ClientDuplexSender<super::messages::StreamingOutputCallRequest>,
294 ::grpcio::ClientDuplexReceiver<super::messages::StreamingOutputCallResponse>,
295 )> {
296 self.client
297 .duplex_streaming(&METHOD_TEST_SERVICE_FULL_DUPLEX_CALL, opt)
298 }
299
300 pub fn full_duplex_call(
301 &self,
302 ) -> ::grpcio::Result<(
303 ::grpcio::ClientDuplexSender<super::messages::StreamingOutputCallRequest>,
304 ::grpcio::ClientDuplexReceiver<super::messages::StreamingOutputCallResponse>,
305 )> {
306 self.full_duplex_call_opt(::grpcio::CallOption::default())
307 }
308
309 pub fn half_duplex_call_opt(
310 &self,
311 opt: ::grpcio::CallOption,
312 ) -> ::grpcio::Result<(
313 ::grpcio::ClientDuplexSender<super::messages::StreamingOutputCallRequest>,
314 ::grpcio::ClientDuplexReceiver<super::messages::StreamingOutputCallResponse>,
315 )> {
316 self.client
317 .duplex_streaming(&METHOD_TEST_SERVICE_HALF_DUPLEX_CALL, opt)
318 }
319
320 pub fn half_duplex_call(
321 &self,
322 ) -> ::grpcio::Result<(
323 ::grpcio::ClientDuplexSender<super::messages::StreamingOutputCallRequest>,
324 ::grpcio::ClientDuplexReceiver<super::messages::StreamingOutputCallResponse>,
325 )> {
326 self.half_duplex_call_opt(::grpcio::CallOption::default())
327 }
328
329 pub fn unimplemented_call_opt(
330 &self,
331 req: &super::empty::Empty,
332 opt: ::grpcio::CallOption,
333 ) -> ::grpcio::Result<super::empty::Empty> {
334 self.client
335 .unary_call(&METHOD_TEST_SERVICE_UNIMPLEMENTED_CALL, req, opt)
336 }
337
338 pub fn unimplemented_call(
339 &self,
340 req: &super::empty::Empty,
341 ) -> ::grpcio::Result<super::empty::Empty> {
342 self.unimplemented_call_opt(req, ::grpcio::CallOption::default())
343 }
344
345 pub fn unimplemented_call_async_opt(
346 &self,
347 req: &super::empty::Empty,
348 opt: ::grpcio::CallOption,
349 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
350 self.client
351 .unary_call_async(&METHOD_TEST_SERVICE_UNIMPLEMENTED_CALL, req, opt)
352 }
353
354 pub fn unimplemented_call_async(
355 &self,
356 req: &super::empty::Empty,
357 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
358 self.unimplemented_call_async_opt(req, ::grpcio::CallOption::default())
359 }
360 pub fn spawn<F>(&self, f: F)
361 where
362 F: ::std::future::Future<Output = ()> + Send + 'static,
363 {
364 self.client.spawn(f)
365 }
366}
367
368pub trait TestService {
369 fn empty_call(
370 &mut self,
371 ctx: ::grpcio::RpcContext,
372 _req: super::empty::Empty,
373 sink: ::grpcio::UnarySink<super::empty::Empty>,
374 ) {
375 grpcio::unimplemented_call!(ctx, sink)
376 }
377 fn unary_call(
378 &mut self,
379 ctx: ::grpcio::RpcContext,
380 _req: super::messages::SimpleRequest,
381 sink: ::grpcio::UnarySink<super::messages::SimpleResponse>,
382 ) {
383 grpcio::unimplemented_call!(ctx, sink)
384 }
385 fn cacheable_unary_call(
386 &mut self,
387 ctx: ::grpcio::RpcContext,
388 _req: super::messages::SimpleRequest,
389 sink: ::grpcio::UnarySink<super::messages::SimpleResponse>,
390 ) {
391 grpcio::unimplemented_call!(ctx, sink)
392 }
393 fn streaming_output_call(
394 &mut self,
395 ctx: ::grpcio::RpcContext,
396 _req: super::messages::StreamingOutputCallRequest,
397 sink: ::grpcio::ServerStreamingSink<super::messages::StreamingOutputCallResponse>,
398 ) {
399 grpcio::unimplemented_call!(ctx, sink)
400 }
401 fn streaming_input_call(
402 &mut self,
403 ctx: ::grpcio::RpcContext,
404 _stream: ::grpcio::RequestStream<super::messages::StreamingInputCallRequest>,
405 sink: ::grpcio::ClientStreamingSink<super::messages::StreamingInputCallResponse>,
406 ) {
407 grpcio::unimplemented_call!(ctx, sink)
408 }
409 fn full_duplex_call(
410 &mut self,
411 ctx: ::grpcio::RpcContext,
412 _stream: ::grpcio::RequestStream<super::messages::StreamingOutputCallRequest>,
413 sink: ::grpcio::DuplexSink<super::messages::StreamingOutputCallResponse>,
414 ) {
415 grpcio::unimplemented_call!(ctx, sink)
416 }
417 fn half_duplex_call(
418 &mut self,
419 ctx: ::grpcio::RpcContext,
420 _stream: ::grpcio::RequestStream<super::messages::StreamingOutputCallRequest>,
421 sink: ::grpcio::DuplexSink<super::messages::StreamingOutputCallResponse>,
422 ) {
423 grpcio::unimplemented_call!(ctx, sink)
424 }
425 fn unimplemented_call(
426 &mut self,
427 ctx: ::grpcio::RpcContext,
428 _req: super::empty::Empty,
429 sink: ::grpcio::UnarySink<super::empty::Empty>,
430 ) {
431 grpcio::unimplemented_call!(ctx, sink)
432 }
433}
434
435pub fn create_test_service<S: TestService + Send + Clone + 'static>(s: S) -> ::grpcio::Service {
436 let mut builder = ::grpcio::ServiceBuilder::new();
437 let mut instance = s.clone();
438 builder = builder.add_unary_handler(&METHOD_TEST_SERVICE_EMPTY_CALL, move |ctx, req, resp| {
439 instance.empty_call(ctx, req, resp)
440 });
441 let mut instance = s.clone();
442 builder = builder.add_unary_handler(&METHOD_TEST_SERVICE_UNARY_CALL, move |ctx, req, resp| {
443 instance.unary_call(ctx, req, resp)
444 });
445 let mut instance = s.clone();
446 builder = builder.add_unary_handler(
447 &METHOD_TEST_SERVICE_CACHEABLE_UNARY_CALL,
448 move |ctx, req, resp| instance.cacheable_unary_call(ctx, req, resp),
449 );
450 let mut instance = s.clone();
451 builder = builder.add_server_streaming_handler(
452 &METHOD_TEST_SERVICE_STREAMING_OUTPUT_CALL,
453 move |ctx, req, resp| instance.streaming_output_call(ctx, req, resp),
454 );
455 let mut instance = s.clone();
456 builder = builder.add_client_streaming_handler(
457 &METHOD_TEST_SERVICE_STREAMING_INPUT_CALL,
458 move |ctx, req, resp| instance.streaming_input_call(ctx, req, resp),
459 );
460 let mut instance = s.clone();
461 builder = builder.add_duplex_streaming_handler(
462 &METHOD_TEST_SERVICE_FULL_DUPLEX_CALL,
463 move |ctx, req, resp| instance.full_duplex_call(ctx, req, resp),
464 );
465 let mut instance = s.clone();
466 builder = builder.add_duplex_streaming_handler(
467 &METHOD_TEST_SERVICE_HALF_DUPLEX_CALL,
468 move |ctx, req, resp| instance.half_duplex_call(ctx, req, resp),
469 );
470 let mut instance = s;
471 builder = builder.add_unary_handler(
472 &METHOD_TEST_SERVICE_UNIMPLEMENTED_CALL,
473 move |ctx, req, resp| instance.unimplemented_call(ctx, req, resp),
474 );
475 builder.build()
476}
477
478const METHOD_UNIMPLEMENTED_SERVICE_UNIMPLEMENTED_CALL: ::grpcio::Method<
479 super::empty::Empty,
480 super::empty::Empty,
481> = ::grpcio::Method {
482 ty: ::grpcio::MethodType::Unary,
483 name: "/grpc.testing.UnimplementedService/UnimplementedCall",
484 req_mar: ::grpcio::Marshaller {
485 ser: ::grpcio::pb_ser,
486 de: ::grpcio::pb_de,
487 },
488 resp_mar: ::grpcio::Marshaller {
489 ser: ::grpcio::pb_ser,
490 de: ::grpcio::pb_de,
491 },
492};
493
494#[derive(Clone)]
495pub struct UnimplementedServiceClient {
496 pub client: ::grpcio::Client,
497}
498
499impl UnimplementedServiceClient {
500 pub fn new(channel: ::grpcio::Channel) -> Self {
501 UnimplementedServiceClient {
502 client: ::grpcio::Client::new(channel),
503 }
504 }
505
506 pub fn unimplemented_call_opt(
507 &self,
508 req: &super::empty::Empty,
509 opt: ::grpcio::CallOption,
510 ) -> ::grpcio::Result<super::empty::Empty> {
511 self.client
512 .unary_call(&METHOD_UNIMPLEMENTED_SERVICE_UNIMPLEMENTED_CALL, req, opt)
513 }
514
515 pub fn unimplemented_call(
516 &self,
517 req: &super::empty::Empty,
518 ) -> ::grpcio::Result<super::empty::Empty> {
519 self.unimplemented_call_opt(req, ::grpcio::CallOption::default())
520 }
521
522 pub fn unimplemented_call_async_opt(
523 &self,
524 req: &super::empty::Empty,
525 opt: ::grpcio::CallOption,
526 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
527 self.client
528 .unary_call_async(&METHOD_UNIMPLEMENTED_SERVICE_UNIMPLEMENTED_CALL, req, opt)
529 }
530
531 pub fn unimplemented_call_async(
532 &self,
533 req: &super::empty::Empty,
534 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
535 self.unimplemented_call_async_opt(req, ::grpcio::CallOption::default())
536 }
537 pub fn spawn<F>(&self, f: F)
538 where
539 F: ::std::future::Future<Output = ()> + Send + 'static,
540 {
541 self.client.spawn(f)
542 }
543}
544
545pub trait UnimplementedService {
546 fn unimplemented_call(
547 &mut self,
548 ctx: ::grpcio::RpcContext,
549 _req: super::empty::Empty,
550 sink: ::grpcio::UnarySink<super::empty::Empty>,
551 ) {
552 grpcio::unimplemented_call!(ctx, sink)
553 }
554}
555
556pub fn create_unimplemented_service<S: UnimplementedService + Send + Clone + 'static>(
557 s: S,
558) -> ::grpcio::Service {
559 let mut builder = ::grpcio::ServiceBuilder::new();
560 let mut instance = s;
561 builder = builder.add_unary_handler(
562 &METHOD_UNIMPLEMENTED_SERVICE_UNIMPLEMENTED_CALL,
563 move |ctx, req, resp| instance.unimplemented_call(ctx, req, resp),
564 );
565 builder.build()
566}
567
568const METHOD_RECONNECT_SERVICE_START: ::grpcio::Method<
569 super::messages::ReconnectParams,
570 super::empty::Empty,
571> = ::grpcio::Method {
572 ty: ::grpcio::MethodType::Unary,
573 name: "/grpc.testing.ReconnectService/Start",
574 req_mar: ::grpcio::Marshaller {
575 ser: ::grpcio::pb_ser,
576 de: ::grpcio::pb_de,
577 },
578 resp_mar: ::grpcio::Marshaller {
579 ser: ::grpcio::pb_ser,
580 de: ::grpcio::pb_de,
581 },
582};
583
584const METHOD_RECONNECT_SERVICE_STOP: ::grpcio::Method<
585 super::empty::Empty,
586 super::messages::ReconnectInfo,
587> = ::grpcio::Method {
588 ty: ::grpcio::MethodType::Unary,
589 name: "/grpc.testing.ReconnectService/Stop",
590 req_mar: ::grpcio::Marshaller {
591 ser: ::grpcio::pb_ser,
592 de: ::grpcio::pb_de,
593 },
594 resp_mar: ::grpcio::Marshaller {
595 ser: ::grpcio::pb_ser,
596 de: ::grpcio::pb_de,
597 },
598};
599
600#[derive(Clone)]
601pub struct ReconnectServiceClient {
602 pub client: ::grpcio::Client,
603}
604
605impl ReconnectServiceClient {
606 pub fn new(channel: ::grpcio::Channel) -> Self {
607 ReconnectServiceClient {
608 client: ::grpcio::Client::new(channel),
609 }
610 }
611
612 pub fn start_opt(
613 &self,
614 req: &super::messages::ReconnectParams,
615 opt: ::grpcio::CallOption,
616 ) -> ::grpcio::Result<super::empty::Empty> {
617 self.client
618 .unary_call(&METHOD_RECONNECT_SERVICE_START, req, opt)
619 }
620
621 pub fn start(
622 &self,
623 req: &super::messages::ReconnectParams,
624 ) -> ::grpcio::Result<super::empty::Empty> {
625 self.start_opt(req, ::grpcio::CallOption::default())
626 }
627
628 pub fn start_async_opt(
629 &self,
630 req: &super::messages::ReconnectParams,
631 opt: ::grpcio::CallOption,
632 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
633 self.client
634 .unary_call_async(&METHOD_RECONNECT_SERVICE_START, req, opt)
635 }
636
637 pub fn start_async(
638 &self,
639 req: &super::messages::ReconnectParams,
640 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
641 self.start_async_opt(req, ::grpcio::CallOption::default())
642 }
643
644 pub fn stop_opt(
645 &self,
646 req: &super::empty::Empty,
647 opt: ::grpcio::CallOption,
648 ) -> ::grpcio::Result<super::messages::ReconnectInfo> {
649 self.client
650 .unary_call(&METHOD_RECONNECT_SERVICE_STOP, req, opt)
651 }
652
653 pub fn stop(
654 &self,
655 req: &super::empty::Empty,
656 ) -> ::grpcio::Result<super::messages::ReconnectInfo> {
657 self.stop_opt(req, ::grpcio::CallOption::default())
658 }
659
660 pub fn stop_async_opt(
661 &self,
662 req: &super::empty::Empty,
663 opt: ::grpcio::CallOption,
664 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::messages::ReconnectInfo>> {
665 self.client
666 .unary_call_async(&METHOD_RECONNECT_SERVICE_STOP, req, opt)
667 }
668
669 pub fn stop_async(
670 &self,
671 req: &super::empty::Empty,
672 ) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::messages::ReconnectInfo>> {
673 self.stop_async_opt(req, ::grpcio::CallOption::default())
674 }
675 pub fn spawn<F>(&self, f: F)
676 where
677 F: ::std::future::Future<Output = ()> + Send + 'static,
678 {
679 self.client.spawn(f)
680 }
681}
682
683pub trait ReconnectService {
684 fn start(
685 &mut self,
686 ctx: ::grpcio::RpcContext,
687 _req: super::messages::ReconnectParams,
688 sink: ::grpcio::UnarySink<super::empty::Empty>,
689 ) {
690 grpcio::unimplemented_call!(ctx, sink)
691 }
692 fn stop(
693 &mut self,
694 ctx: ::grpcio::RpcContext,
695 _req: super::empty::Empty,
696 sink: ::grpcio::UnarySink<super::messages::ReconnectInfo>,
697 ) {
698 grpcio::unimplemented_call!(ctx, sink)
699 }
700}
701
702pub fn create_reconnect_service<S: ReconnectService + Send + Clone + 'static>(
703 s: S,
704) -> ::grpcio::Service {
705 let mut builder = ::grpcio::ServiceBuilder::new();
706 let mut instance = s.clone();
707 builder = builder.add_unary_handler(&METHOD_RECONNECT_SERVICE_START, move |ctx, req, resp| {
708 instance.start(ctx, req, resp)
709 });
710 let mut instance = s;
711 builder = builder.add_unary_handler(&METHOD_RECONNECT_SERVICE_STOP, move |ctx, req, resp| {
712 instance.stop(ctx, req, resp)
713 });
714 builder.build()
715}