1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct BatchExecuteRequest {
4 #[prost(message, repeated, tag = "1")]
5 pub instructions: ::prost::alloc::vec::Vec<super::super::jit::JitInstruction>,
6}
7#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8pub struct BatchExecuteResponse {
9 #[prost(uint64, repeated, tag = "1")]
11 pub gids: ::prost::alloc::vec::Vec<u64>,
12}
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct BatchOutcomes {
15 #[prost(message, repeated, tag = "1")]
16 pub outcomes: ::prost::alloc::vec::Vec<super::super::coordinator::Outcomes>,
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct BatchReadouts {
20 #[prost(message, repeated, tag = "1")]
22 pub readouts: ::prost::alloc::vec::Vec<super::super::coordinator::Readouts>,
23}
24#[cfg(feature = "cli")]
26pub mod jit_controller_client {
27 #![allow(
28 unused_variables,
29 dead_code,
30 missing_docs,
31 clippy::wildcard_imports,
32 clippy::let_unit_value,
33 )]
34 use tonic::codegen::*;
35 use tonic::codegen::http::Uri;
36 #[derive(Debug, Clone)]
37 pub struct JitControllerClient<T> {
38 inner: tonic::client::Grpc<T>,
39 }
40 impl JitControllerClient<tonic::transport::Channel> {
41 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
43 where
44 D: TryInto<tonic::transport::Endpoint>,
45 D::Error: Into<StdError>,
46 {
47 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
48 Ok(Self::new(conn))
49 }
50 }
51 impl<T> JitControllerClient<T>
52 where
53 T: tonic::client::GrpcService<tonic::body::Body>,
54 T::Error: Into<StdError>,
55 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
56 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
57 {
58 pub fn new(inner: T) -> Self {
59 let inner = tonic::client::Grpc::new(inner);
60 Self { inner }
61 }
62 pub fn with_origin(inner: T, origin: Uri) -> Self {
63 let inner = tonic::client::Grpc::with_origin(inner, origin);
64 Self { inner }
65 }
66 pub fn with_interceptor<F>(
67 inner: T,
68 interceptor: F,
69 ) -> JitControllerClient<InterceptedService<T, F>>
70 where
71 F: tonic::service::Interceptor,
72 T::ResponseBody: Default,
73 T: tonic::codegen::Service<
74 http::Request<tonic::body::Body>,
75 Response = http::Response<
76 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
77 >,
78 >,
79 <T as tonic::codegen::Service<
80 http::Request<tonic::body::Body>,
81 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
82 {
83 JitControllerClient::new(InterceptedService::new(inner, interceptor))
84 }
85 #[must_use]
90 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
91 self.inner = self.inner.send_compressed(encoding);
92 self
93 }
94 #[must_use]
96 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
97 self.inner = self.inner.accept_compressed(encoding);
98 self
99 }
100 #[must_use]
104 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
105 self.inner = self.inner.max_decoding_message_size(limit);
106 self
107 }
108 #[must_use]
112 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
113 self.inner = self.inner.max_encoding_message_size(limit);
114 self
115 }
116 pub async fn load_library(
119 &mut self,
120 request: impl tonic::IntoRequest<super::super::super::jit::JitLibrary>,
121 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
122 self.inner
123 .ready()
124 .await
125 .map_err(|e| {
126 tonic::Status::unknown(
127 format!("Service was not ready: {}", e.into()),
128 )
129 })?;
130 let codec = tonic_prost::ProstCodec::default();
131 let path = http::uri::PathAndQuery::from_static(
132 "/deq.controller.jit_controller.JitController/LoadLibrary",
133 );
134 let mut req = request.into_request();
135 req.extensions_mut()
136 .insert(
137 GrpcMethod::new(
138 "deq.controller.jit_controller.JitController",
139 "LoadLibrary",
140 ),
141 );
142 self.inner.unary(req, path, codec).await
143 }
144 pub async fn unload(
146 &mut self,
147 request: impl tonic::IntoRequest<super::super::super::jit::UnloadJitLibrary>,
148 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
149 self.inner
150 .ready()
151 .await
152 .map_err(|e| {
153 tonic::Status::unknown(
154 format!("Service was not ready: {}", e.into()),
155 )
156 })?;
157 let codec = tonic_prost::ProstCodec::default();
158 let path = http::uri::PathAndQuery::from_static(
159 "/deq.controller.jit_controller.JitController/Unload",
160 );
161 let mut req = request.into_request();
162 req.extensions_mut()
163 .insert(
164 GrpcMethod::new(
165 "deq.controller.jit_controller.JitController",
166 "Unload",
167 ),
168 );
169 self.inner.unary(req, path, codec).await
170 }
171 pub async fn execute(
174 &mut self,
175 request: impl tonic::IntoRequest<super::super::super::jit::JitInstruction>,
176 ) -> std::result::Result<
177 tonic::Response<super::super::super::coordinator::ExecuteResponse>,
178 tonic::Status,
179 > {
180 self.inner
181 .ready()
182 .await
183 .map_err(|e| {
184 tonic::Status::unknown(
185 format!("Service was not ready: {}", e.into()),
186 )
187 })?;
188 let codec = tonic_prost::ProstCodec::default();
189 let path = http::uri::PathAndQuery::from_static(
190 "/deq.controller.jit_controller.JitController/Execute",
191 );
192 let mut req = request.into_request();
193 req.extensions_mut()
194 .insert(
195 GrpcMethod::new(
196 "deq.controller.jit_controller.JitController",
197 "Execute",
198 ),
199 );
200 self.inner.unary(req, path, codec).await
201 }
202 pub async fn batch_execute(
208 &mut self,
209 request: impl tonic::IntoRequest<super::BatchExecuteRequest>,
210 ) -> std::result::Result<
211 tonic::Response<super::BatchExecuteResponse>,
212 tonic::Status,
213 > {
214 self.inner
215 .ready()
216 .await
217 .map_err(|e| {
218 tonic::Status::unknown(
219 format!("Service was not ready: {}", e.into()),
220 )
221 })?;
222 let codec = tonic_prost::ProstCodec::default();
223 let path = http::uri::PathAndQuery::from_static(
224 "/deq.controller.jit_controller.JitController/BatchExecute",
225 );
226 let mut req = request.into_request();
227 req.extensions_mut()
228 .insert(
229 GrpcMethod::new(
230 "deq.controller.jit_controller.JitController",
231 "BatchExecute",
232 ),
233 );
234 self.inner.unary(req, path, codec).await
235 }
236 pub async fn decode(
240 &mut self,
241 request: impl tonic::IntoRequest<super::super::super::coordinator::Outcomes>,
242 ) -> std::result::Result<
243 tonic::Response<super::super::super::coordinator::Readouts>,
244 tonic::Status,
245 > {
246 self.inner
247 .ready()
248 .await
249 .map_err(|e| {
250 tonic::Status::unknown(
251 format!("Service was not ready: {}", e.into()),
252 )
253 })?;
254 let codec = tonic_prost::ProstCodec::default();
255 let path = http::uri::PathAndQuery::from_static(
256 "/deq.controller.jit_controller.JitController/Decode",
257 );
258 let mut req = request.into_request();
259 req.extensions_mut()
260 .insert(
261 GrpcMethod::new(
262 "deq.controller.jit_controller.JitController",
263 "Decode",
264 ),
265 );
266 self.inner.unary(req, path, codec).await
267 }
268 pub async fn batch_decode(
273 &mut self,
274 request: impl tonic::IntoRequest<super::BatchOutcomes>,
275 ) -> std::result::Result<tonic::Response<super::BatchReadouts>, tonic::Status> {
276 self.inner
277 .ready()
278 .await
279 .map_err(|e| {
280 tonic::Status::unknown(
281 format!("Service was not ready: {}", e.into()),
282 )
283 })?;
284 let codec = tonic_prost::ProstCodec::default();
285 let path = http::uri::PathAndQuery::from_static(
286 "/deq.controller.jit_controller.JitController/BatchDecode",
287 );
288 let mut req = request.into_request();
289 req.extensions_mut()
290 .insert(
291 GrpcMethod::new(
292 "deq.controller.jit_controller.JitController",
293 "BatchDecode",
294 ),
295 );
296 self.inner.unary(req, path, codec).await
297 }
298 pub async fn reset(
300 &mut self,
301 request: impl tonic::IntoRequest<
302 super::super::super::coordinator::ResetRequest,
303 >,
304 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
305 self.inner
306 .ready()
307 .await
308 .map_err(|e| {
309 tonic::Status::unknown(
310 format!("Service was not ready: {}", e.into()),
311 )
312 })?;
313 let codec = tonic_prost::ProstCodec::default();
314 let path = http::uri::PathAndQuery::from_static(
315 "/deq.controller.jit_controller.JitController/Reset",
316 );
317 let mut req = request.into_request();
318 req.extensions_mut()
319 .insert(
320 GrpcMethod::new(
321 "deq.controller.jit_controller.JitController",
322 "Reset",
323 ),
324 );
325 self.inner.unary(req, path, codec).await
326 }
327 }
328}
329pub mod jit_controller_server {
331 #![allow(
332 unused_variables,
333 dead_code,
334 missing_docs,
335 clippy::wildcard_imports,
336 clippy::let_unit_value,
337 )]
338 use tonic::codegen::*;
339 #[async_trait]
341 pub trait JitController: std::marker::Send + std::marker::Sync + 'static {
342 async fn load_library(
345 &self,
346 request: tonic::Request<super::super::super::jit::JitLibrary>,
347 ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
348 async fn unload(
350 &self,
351 request: tonic::Request<super::super::super::jit::UnloadJitLibrary>,
352 ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
353 async fn execute(
356 &self,
357 request: tonic::Request<super::super::super::jit::JitInstruction>,
358 ) -> std::result::Result<
359 tonic::Response<super::super::super::coordinator::ExecuteResponse>,
360 tonic::Status,
361 >;
362 async fn batch_execute(
368 &self,
369 request: tonic::Request<super::BatchExecuteRequest>,
370 ) -> std::result::Result<
371 tonic::Response<super::BatchExecuteResponse>,
372 tonic::Status,
373 >;
374 async fn decode(
378 &self,
379 request: tonic::Request<super::super::super::coordinator::Outcomes>,
380 ) -> std::result::Result<
381 tonic::Response<super::super::super::coordinator::Readouts>,
382 tonic::Status,
383 >;
384 async fn batch_decode(
389 &self,
390 request: tonic::Request<super::BatchOutcomes>,
391 ) -> std::result::Result<tonic::Response<super::BatchReadouts>, tonic::Status>;
392 async fn reset(
394 &self,
395 request: tonic::Request<super::super::super::coordinator::ResetRequest>,
396 ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
397 }
398 #[derive(Debug)]
399 pub struct JitControllerServer<T> {
400 inner: Arc<T>,
401 accept_compression_encodings: EnabledCompressionEncodings,
402 send_compression_encodings: EnabledCompressionEncodings,
403 max_decoding_message_size: Option<usize>,
404 max_encoding_message_size: Option<usize>,
405 }
406 impl<T> JitControllerServer<T> {
407 pub fn new(inner: T) -> Self {
408 Self::from_arc(Arc::new(inner))
409 }
410 pub fn from_arc(inner: Arc<T>) -> Self {
411 Self {
412 inner,
413 accept_compression_encodings: Default::default(),
414 send_compression_encodings: Default::default(),
415 max_decoding_message_size: None,
416 max_encoding_message_size: None,
417 }
418 }
419 pub fn with_interceptor<F>(
420 inner: T,
421 interceptor: F,
422 ) -> InterceptedService<Self, F>
423 where
424 F: tonic::service::Interceptor,
425 {
426 InterceptedService::new(Self::new(inner), interceptor)
427 }
428 #[must_use]
430 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
431 self.accept_compression_encodings.enable(encoding);
432 self
433 }
434 #[must_use]
436 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
437 self.send_compression_encodings.enable(encoding);
438 self
439 }
440 #[must_use]
444 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
445 self.max_decoding_message_size = Some(limit);
446 self
447 }
448 #[must_use]
452 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
453 self.max_encoding_message_size = Some(limit);
454 self
455 }
456 }
457 impl<T, B> tonic::codegen::Service<http::Request<B>> for JitControllerServer<T>
458 where
459 T: JitController,
460 B: Body + std::marker::Send + 'static,
461 B::Error: Into<StdError> + std::marker::Send + 'static,
462 {
463 type Response = http::Response<tonic::body::Body>;
464 type Error = std::convert::Infallible;
465 type Future = BoxFuture<Self::Response, Self::Error>;
466 fn poll_ready(
467 &mut self,
468 _cx: &mut Context<'_>,
469 ) -> Poll<std::result::Result<(), Self::Error>> {
470 Poll::Ready(Ok(()))
471 }
472 fn call(&mut self, req: http::Request<B>) -> Self::Future {
473 match req.uri().path() {
474 "/deq.controller.jit_controller.JitController/LoadLibrary" => {
475 #[allow(non_camel_case_types)]
476 struct LoadLibrarySvc<T: JitController>(pub Arc<T>);
477 impl<
478 T: JitController,
479 > tonic::server::UnaryService<super::super::super::jit::JitLibrary>
480 for LoadLibrarySvc<T> {
481 type Response = ();
482 type Future = BoxFuture<
483 tonic::Response<Self::Response>,
484 tonic::Status,
485 >;
486 fn call(
487 &mut self,
488 request: tonic::Request<super::super::super::jit::JitLibrary>,
489 ) -> Self::Future {
490 let inner = Arc::clone(&self.0);
491 let fut = async move {
492 <T as JitController>::load_library(&inner, request).await
493 };
494 Box::pin(fut)
495 }
496 }
497 let accept_compression_encodings = self.accept_compression_encodings;
498 let send_compression_encodings = self.send_compression_encodings;
499 let max_decoding_message_size = self.max_decoding_message_size;
500 let max_encoding_message_size = self.max_encoding_message_size;
501 let inner = self.inner.clone();
502 let fut = async move {
503 let method = LoadLibrarySvc(inner);
504 let codec = tonic_prost::ProstCodec::default();
505 let mut grpc = tonic::server::Grpc::new(codec)
506 .apply_compression_config(
507 accept_compression_encodings,
508 send_compression_encodings,
509 )
510 .apply_max_message_size_config(
511 max_decoding_message_size,
512 max_encoding_message_size,
513 );
514 let res = grpc.unary(method, req).await;
515 Ok(res)
516 };
517 Box::pin(fut)
518 }
519 "/deq.controller.jit_controller.JitController/Unload" => {
520 #[allow(non_camel_case_types)]
521 struct UnloadSvc<T: JitController>(pub Arc<T>);
522 impl<
523 T: JitController,
524 > tonic::server::UnaryService<
525 super::super::super::jit::UnloadJitLibrary,
526 > for UnloadSvc<T> {
527 type Response = ();
528 type Future = BoxFuture<
529 tonic::Response<Self::Response>,
530 tonic::Status,
531 >;
532 fn call(
533 &mut self,
534 request: tonic::Request<
535 super::super::super::jit::UnloadJitLibrary,
536 >,
537 ) -> Self::Future {
538 let inner = Arc::clone(&self.0);
539 let fut = async move {
540 <T as JitController>::unload(&inner, request).await
541 };
542 Box::pin(fut)
543 }
544 }
545 let accept_compression_encodings = self.accept_compression_encodings;
546 let send_compression_encodings = self.send_compression_encodings;
547 let max_decoding_message_size = self.max_decoding_message_size;
548 let max_encoding_message_size = self.max_encoding_message_size;
549 let inner = self.inner.clone();
550 let fut = async move {
551 let method = UnloadSvc(inner);
552 let codec = tonic_prost::ProstCodec::default();
553 let mut grpc = tonic::server::Grpc::new(codec)
554 .apply_compression_config(
555 accept_compression_encodings,
556 send_compression_encodings,
557 )
558 .apply_max_message_size_config(
559 max_decoding_message_size,
560 max_encoding_message_size,
561 );
562 let res = grpc.unary(method, req).await;
563 Ok(res)
564 };
565 Box::pin(fut)
566 }
567 "/deq.controller.jit_controller.JitController/Execute" => {
568 #[allow(non_camel_case_types)]
569 struct ExecuteSvc<T: JitController>(pub Arc<T>);
570 impl<
571 T: JitController,
572 > tonic::server::UnaryService<
573 super::super::super::jit::JitInstruction,
574 > for ExecuteSvc<T> {
575 type Response = super::super::super::coordinator::ExecuteResponse;
576 type Future = BoxFuture<
577 tonic::Response<Self::Response>,
578 tonic::Status,
579 >;
580 fn call(
581 &mut self,
582 request: tonic::Request<
583 super::super::super::jit::JitInstruction,
584 >,
585 ) -> Self::Future {
586 let inner = Arc::clone(&self.0);
587 let fut = async move {
588 <T as JitController>::execute(&inner, request).await
589 };
590 Box::pin(fut)
591 }
592 }
593 let accept_compression_encodings = self.accept_compression_encodings;
594 let send_compression_encodings = self.send_compression_encodings;
595 let max_decoding_message_size = self.max_decoding_message_size;
596 let max_encoding_message_size = self.max_encoding_message_size;
597 let inner = self.inner.clone();
598 let fut = async move {
599 let method = ExecuteSvc(inner);
600 let codec = tonic_prost::ProstCodec::default();
601 let mut grpc = tonic::server::Grpc::new(codec)
602 .apply_compression_config(
603 accept_compression_encodings,
604 send_compression_encodings,
605 )
606 .apply_max_message_size_config(
607 max_decoding_message_size,
608 max_encoding_message_size,
609 );
610 let res = grpc.unary(method, req).await;
611 Ok(res)
612 };
613 Box::pin(fut)
614 }
615 "/deq.controller.jit_controller.JitController/BatchExecute" => {
616 #[allow(non_camel_case_types)]
617 struct BatchExecuteSvc<T: JitController>(pub Arc<T>);
618 impl<
619 T: JitController,
620 > tonic::server::UnaryService<super::BatchExecuteRequest>
621 for BatchExecuteSvc<T> {
622 type Response = super::BatchExecuteResponse;
623 type Future = BoxFuture<
624 tonic::Response<Self::Response>,
625 tonic::Status,
626 >;
627 fn call(
628 &mut self,
629 request: tonic::Request<super::BatchExecuteRequest>,
630 ) -> Self::Future {
631 let inner = Arc::clone(&self.0);
632 let fut = async move {
633 <T as JitController>::batch_execute(&inner, request).await
634 };
635 Box::pin(fut)
636 }
637 }
638 let accept_compression_encodings = self.accept_compression_encodings;
639 let send_compression_encodings = self.send_compression_encodings;
640 let max_decoding_message_size = self.max_decoding_message_size;
641 let max_encoding_message_size = self.max_encoding_message_size;
642 let inner = self.inner.clone();
643 let fut = async move {
644 let method = BatchExecuteSvc(inner);
645 let codec = tonic_prost::ProstCodec::default();
646 let mut grpc = tonic::server::Grpc::new(codec)
647 .apply_compression_config(
648 accept_compression_encodings,
649 send_compression_encodings,
650 )
651 .apply_max_message_size_config(
652 max_decoding_message_size,
653 max_encoding_message_size,
654 );
655 let res = grpc.unary(method, req).await;
656 Ok(res)
657 };
658 Box::pin(fut)
659 }
660 "/deq.controller.jit_controller.JitController/Decode" => {
661 #[allow(non_camel_case_types)]
662 struct DecodeSvc<T: JitController>(pub Arc<T>);
663 impl<
664 T: JitController,
665 > tonic::server::UnaryService<
666 super::super::super::coordinator::Outcomes,
667 > for DecodeSvc<T> {
668 type Response = super::super::super::coordinator::Readouts;
669 type Future = BoxFuture<
670 tonic::Response<Self::Response>,
671 tonic::Status,
672 >;
673 fn call(
674 &mut self,
675 request: tonic::Request<
676 super::super::super::coordinator::Outcomes,
677 >,
678 ) -> Self::Future {
679 let inner = Arc::clone(&self.0);
680 let fut = async move {
681 <T as JitController>::decode(&inner, request).await
682 };
683 Box::pin(fut)
684 }
685 }
686 let accept_compression_encodings = self.accept_compression_encodings;
687 let send_compression_encodings = self.send_compression_encodings;
688 let max_decoding_message_size = self.max_decoding_message_size;
689 let max_encoding_message_size = self.max_encoding_message_size;
690 let inner = self.inner.clone();
691 let fut = async move {
692 let method = DecodeSvc(inner);
693 let codec = tonic_prost::ProstCodec::default();
694 let mut grpc = tonic::server::Grpc::new(codec)
695 .apply_compression_config(
696 accept_compression_encodings,
697 send_compression_encodings,
698 )
699 .apply_max_message_size_config(
700 max_decoding_message_size,
701 max_encoding_message_size,
702 );
703 let res = grpc.unary(method, req).await;
704 Ok(res)
705 };
706 Box::pin(fut)
707 }
708 "/deq.controller.jit_controller.JitController/BatchDecode" => {
709 #[allow(non_camel_case_types)]
710 struct BatchDecodeSvc<T: JitController>(pub Arc<T>);
711 impl<
712 T: JitController,
713 > tonic::server::UnaryService<super::BatchOutcomes>
714 for BatchDecodeSvc<T> {
715 type Response = super::BatchReadouts;
716 type Future = BoxFuture<
717 tonic::Response<Self::Response>,
718 tonic::Status,
719 >;
720 fn call(
721 &mut self,
722 request: tonic::Request<super::BatchOutcomes>,
723 ) -> Self::Future {
724 let inner = Arc::clone(&self.0);
725 let fut = async move {
726 <T as JitController>::batch_decode(&inner, request).await
727 };
728 Box::pin(fut)
729 }
730 }
731 let accept_compression_encodings = self.accept_compression_encodings;
732 let send_compression_encodings = self.send_compression_encodings;
733 let max_decoding_message_size = self.max_decoding_message_size;
734 let max_encoding_message_size = self.max_encoding_message_size;
735 let inner = self.inner.clone();
736 let fut = async move {
737 let method = BatchDecodeSvc(inner);
738 let codec = tonic_prost::ProstCodec::default();
739 let mut grpc = tonic::server::Grpc::new(codec)
740 .apply_compression_config(
741 accept_compression_encodings,
742 send_compression_encodings,
743 )
744 .apply_max_message_size_config(
745 max_decoding_message_size,
746 max_encoding_message_size,
747 );
748 let res = grpc.unary(method, req).await;
749 Ok(res)
750 };
751 Box::pin(fut)
752 }
753 "/deq.controller.jit_controller.JitController/Reset" => {
754 #[allow(non_camel_case_types)]
755 struct ResetSvc<T: JitController>(pub Arc<T>);
756 impl<
757 T: JitController,
758 > tonic::server::UnaryService<
759 super::super::super::coordinator::ResetRequest,
760 > for ResetSvc<T> {
761 type Response = ();
762 type Future = BoxFuture<
763 tonic::Response<Self::Response>,
764 tonic::Status,
765 >;
766 fn call(
767 &mut self,
768 request: tonic::Request<
769 super::super::super::coordinator::ResetRequest,
770 >,
771 ) -> Self::Future {
772 let inner = Arc::clone(&self.0);
773 let fut = async move {
774 <T as JitController>::reset(&inner, request).await
775 };
776 Box::pin(fut)
777 }
778 }
779 let accept_compression_encodings = self.accept_compression_encodings;
780 let send_compression_encodings = self.send_compression_encodings;
781 let max_decoding_message_size = self.max_decoding_message_size;
782 let max_encoding_message_size = self.max_encoding_message_size;
783 let inner = self.inner.clone();
784 let fut = async move {
785 let method = ResetSvc(inner);
786 let codec = tonic_prost::ProstCodec::default();
787 let mut grpc = tonic::server::Grpc::new(codec)
788 .apply_compression_config(
789 accept_compression_encodings,
790 send_compression_encodings,
791 )
792 .apply_max_message_size_config(
793 max_decoding_message_size,
794 max_encoding_message_size,
795 );
796 let res = grpc.unary(method, req).await;
797 Ok(res)
798 };
799 Box::pin(fut)
800 }
801 _ => {
802 Box::pin(async move {
803 let mut response = http::Response::new(
804 tonic::body::Body::default(),
805 );
806 let headers = response.headers_mut();
807 headers
808 .insert(
809 tonic::Status::GRPC_STATUS,
810 (tonic::Code::Unimplemented as i32).into(),
811 );
812 headers
813 .insert(
814 http::header::CONTENT_TYPE,
815 tonic::metadata::GRPC_CONTENT_TYPE,
816 );
817 Ok(response)
818 })
819 }
820 }
821 }
822 }
823 impl<T> Clone for JitControllerServer<T> {
824 fn clone(&self) -> Self {
825 let inner = self.inner.clone();
826 Self {
827 inner,
828 accept_compression_encodings: self.accept_compression_encodings,
829 send_compression_encodings: self.send_compression_encodings,
830 max_decoding_message_size: self.max_decoding_message_size,
831 max_encoding_message_size: self.max_encoding_message_size,
832 }
833 }
834 }
835 pub const SERVICE_NAME: &str = "deq.controller.jit_controller.JitController";
837 impl<T> tonic::server::NamedService for JitControllerServer<T> {
838 const NAME: &'static str = SERVICE_NAME;
839 }
840}