shuttle_proto/generated/
runtime.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct LoadRequest {
4    #[prost(string, tag = "1")]
5    pub project_name: ::prost::alloc::string::String,
6    /// "local" or "deployment"
7    #[prost(string, tag = "3")]
8    pub env: ::prost::alloc::string::String,
9    /// Secrets that belong to this deployment
10    #[prost(map = "string, string", tag = "20")]
11    pub secrets:
12        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
13    /// deprecated
14    #[prost(string, tag = "2")]
15    pub path: ::prost::alloc::string::String,
16    /// deprecated
17    #[prost(bytes = "vec", repeated, tag = "10")]
18    pub resources: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
19}
20#[allow(clippy::derive_partial_eq_without_eq)]
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct LoadResponse {
23    /// Could the service be loaded
24    #[prost(bool, tag = "1")]
25    pub success: bool,
26    /// Error message if not successful
27    #[prost(string, tag = "2")]
28    pub message: ::prost::alloc::string::String,
29    /// Which resources where requested
30    #[prost(bytes = "vec", repeated, tag = "10")]
31    pub resources: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
32}
33#[allow(clippy::derive_partial_eq_without_eq)]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct StartRequest {
36    /// Address and port to start the service on
37    #[prost(string, tag = "1")]
38    pub ip: ::prost::alloc::string::String,
39    /// The resources available
40    #[prost(bytes = "vec", repeated, tag = "10")]
41    pub resources: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
42}
43#[allow(clippy::derive_partial_eq_without_eq)]
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct StartResponse {
46    /// Was the start successful
47    #[prost(bool, tag = "1")]
48    pub success: bool,
49    /// Error message if not successful
50    #[prost(string, tag = "2")]
51    pub message: ::prost::alloc::string::String,
52}
53#[allow(clippy::derive_partial_eq_without_eq)]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct StopRequest {}
56#[allow(clippy::derive_partial_eq_without_eq)]
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct StopResponse {
59    /// Was the stop successful
60    #[prost(bool, tag = "1")]
61    pub success: bool,
62}
63#[allow(clippy::derive_partial_eq_without_eq)]
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct SubscribeStopRequest {}
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct SubscribeStopResponse {
69    /// Reason the service has stopped
70    #[prost(enumeration = "StopReason", tag = "1")]
71    pub reason: i32,
72    /// Any extra message to go with the reason. If there are any
73    #[prost(string, tag = "2")]
74    pub message: ::prost::alloc::string::String,
75}
76#[allow(clippy::derive_partial_eq_without_eq)]
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct Ping {}
79#[allow(clippy::derive_partial_eq_without_eq)]
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct Pong {}
82#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct VersionInfo {
85    #[prost(string, tag = "1")]
86    pub version: ::prost::alloc::string::String,
87}
88#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
89#[repr(i32)]
90pub enum StopReason {
91    /// User requested this stop
92    Request = 0,
93    /// Service stopped by itself
94    End = 1,
95    /// Service crashed
96    Crash = 2,
97}
98impl StopReason {
99    /// String value of the enum field names used in the ProtoBuf definition.
100    ///
101    /// The values are not transformed in any way and thus are considered stable
102    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
103    pub fn as_str_name(&self) -> &'static str {
104        match self {
105            StopReason::Request => "Request",
106            StopReason::End => "End",
107            StopReason::Crash => "Crash",
108        }
109    }
110    /// Creates an enum from field names used in the ProtoBuf definition.
111    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
112        match value {
113            "Request" => Some(Self::Request),
114            "End" => Some(Self::End),
115            "Crash" => Some(Self::Crash),
116            _ => None,
117        }
118    }
119}
120/// Generated client implementations.
121pub mod runtime_client {
122    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
123    use tonic::codegen::http::Uri;
124    use tonic::codegen::*;
125    #[derive(Debug, Clone)]
126    pub struct RuntimeClient<T> {
127        inner: tonic::client::Grpc<T>,
128    }
129    impl RuntimeClient<tonic::transport::Channel> {
130        /// Attempt to create a new client by connecting to a given endpoint.
131        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
132        where
133            D: TryInto<tonic::transport::Endpoint>,
134            D::Error: Into<StdError>,
135        {
136            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
137            Ok(Self::new(conn))
138        }
139    }
140    impl<T> RuntimeClient<T>
141    where
142        T: tonic::client::GrpcService<tonic::body::BoxBody>,
143        T::Error: Into<StdError>,
144        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
145        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
146    {
147        pub fn new(inner: T) -> Self {
148            let inner = tonic::client::Grpc::new(inner);
149            Self { inner }
150        }
151        pub fn with_origin(inner: T, origin: Uri) -> Self {
152            let inner = tonic::client::Grpc::with_origin(inner, origin);
153            Self { inner }
154        }
155        pub fn with_interceptor<F>(
156            inner: T,
157            interceptor: F,
158        ) -> RuntimeClient<InterceptedService<T, F>>
159        where
160            F: tonic::service::Interceptor,
161            T::ResponseBody: Default,
162            T: tonic::codegen::Service<
163                http::Request<tonic::body::BoxBody>,
164                Response = http::Response<
165                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
166                >,
167            >,
168            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
169                Into<StdError> + Send + Sync,
170        {
171            RuntimeClient::new(InterceptedService::new(inner, interceptor))
172        }
173        /// Compress requests with the given encoding.
174        ///
175        /// This requires the server to support it otherwise it might respond with an
176        /// error.
177        #[must_use]
178        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
179            self.inner = self.inner.send_compressed(encoding);
180            self
181        }
182        /// Enable decompressing responses.
183        #[must_use]
184        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
185            self.inner = self.inner.accept_compressed(encoding);
186            self
187        }
188        /// Limits the maximum size of a decoded message.
189        ///
190        /// Default: `4MB`
191        #[must_use]
192        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
193            self.inner = self.inner.max_decoding_message_size(limit);
194            self
195        }
196        /// Limits the maximum size of an encoded message.
197        ///
198        /// Default: `usize::MAX`
199        #[must_use]
200        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
201            self.inner = self.inner.max_encoding_message_size(limit);
202            self
203        }
204        /// Load a service file to be ready to start it
205        pub async fn load(
206            &mut self,
207            request: impl tonic::IntoRequest<super::LoadRequest>,
208        ) -> std::result::Result<tonic::Response<super::LoadResponse>, tonic::Status> {
209            self.inner.ready().await.map_err(|e| {
210                tonic::Status::new(
211                    tonic::Code::Unknown,
212                    format!("Service was not ready: {}", e.into()),
213                )
214            })?;
215            let codec = tonic::codec::ProstCodec::default();
216            let path = http::uri::PathAndQuery::from_static("/runtime.Runtime/Load");
217            let mut req = request.into_request();
218            req.extensions_mut()
219                .insert(GrpcMethod::new("runtime.Runtime", "Load"));
220            self.inner.unary(req, path, codec).await
221        }
222        /// Start a loaded service file
223        pub async fn start(
224            &mut self,
225            request: impl tonic::IntoRequest<super::StartRequest>,
226        ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> {
227            self.inner.ready().await.map_err(|e| {
228                tonic::Status::new(
229                    tonic::Code::Unknown,
230                    format!("Service was not ready: {}", e.into()),
231                )
232            })?;
233            let codec = tonic::codec::ProstCodec::default();
234            let path = http::uri::PathAndQuery::from_static("/runtime.Runtime/Start");
235            let mut req = request.into_request();
236            req.extensions_mut()
237                .insert(GrpcMethod::new("runtime.Runtime", "Start"));
238            self.inner.unary(req, path, codec).await
239        }
240        /// Stop a started service
241        pub async fn stop(
242            &mut self,
243            request: impl tonic::IntoRequest<super::StopRequest>,
244        ) -> std::result::Result<tonic::Response<super::StopResponse>, tonic::Status> {
245            self.inner.ready().await.map_err(|e| {
246                tonic::Status::new(
247                    tonic::Code::Unknown,
248                    format!("Service was not ready: {}", e.into()),
249                )
250            })?;
251            let codec = tonic::codec::ProstCodec::default();
252            let path = http::uri::PathAndQuery::from_static("/runtime.Runtime/Stop");
253            let mut req = request.into_request();
254            req.extensions_mut()
255                .insert(GrpcMethod::new("runtime.Runtime", "Stop"));
256            self.inner.unary(req, path, codec).await
257        }
258        /// Channel to notify a service has been stopped
259        pub async fn subscribe_stop(
260            &mut self,
261            request: impl tonic::IntoRequest<super::SubscribeStopRequest>,
262        ) -> std::result::Result<
263            tonic::Response<tonic::codec::Streaming<super::SubscribeStopResponse>>,
264            tonic::Status,
265        > {
266            self.inner.ready().await.map_err(|e| {
267                tonic::Status::new(
268                    tonic::Code::Unknown,
269                    format!("Service was not ready: {}", e.into()),
270                )
271            })?;
272            let codec = tonic::codec::ProstCodec::default();
273            let path = http::uri::PathAndQuery::from_static("/runtime.Runtime/SubscribeStop");
274            let mut req = request.into_request();
275            req.extensions_mut()
276                .insert(GrpcMethod::new("runtime.Runtime", "SubscribeStop"));
277            self.inner.server_streaming(req, path, codec).await
278        }
279        pub async fn version(
280            &mut self,
281            request: impl tonic::IntoRequest<super::Ping>,
282        ) -> std::result::Result<tonic::Response<super::VersionInfo>, tonic::Status> {
283            self.inner.ready().await.map_err(|e| {
284                tonic::Status::new(
285                    tonic::Code::Unknown,
286                    format!("Service was not ready: {}", e.into()),
287                )
288            })?;
289            let codec = tonic::codec::ProstCodec::default();
290            let path = http::uri::PathAndQuery::from_static("/runtime.Runtime/Version");
291            let mut req = request.into_request();
292            req.extensions_mut()
293                .insert(GrpcMethod::new("runtime.Runtime", "Version"));
294            self.inner.unary(req, path, codec).await
295        }
296        pub async fn health_check(
297            &mut self,
298            request: impl tonic::IntoRequest<super::Ping>,
299        ) -> std::result::Result<tonic::Response<super::Pong>, tonic::Status> {
300            self.inner.ready().await.map_err(|e| {
301                tonic::Status::new(
302                    tonic::Code::Unknown,
303                    format!("Service was not ready: {}", e.into()),
304                )
305            })?;
306            let codec = tonic::codec::ProstCodec::default();
307            let path = http::uri::PathAndQuery::from_static("/runtime.Runtime/HealthCheck");
308            let mut req = request.into_request();
309            req.extensions_mut()
310                .insert(GrpcMethod::new("runtime.Runtime", "HealthCheck"));
311            self.inner.unary(req, path, codec).await
312        }
313    }
314}
315/// Generated server implementations.
316pub mod runtime_server {
317    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
318    use tonic::codegen::*;
319    /// Generated trait containing gRPC methods that should be implemented for use with RuntimeServer.
320    #[async_trait]
321    pub trait Runtime: Send + Sync + 'static {
322        /// Load a service file to be ready to start it
323        async fn load(
324            &self,
325            request: tonic::Request<super::LoadRequest>,
326        ) -> std::result::Result<tonic::Response<super::LoadResponse>, tonic::Status>;
327        /// Start a loaded service file
328        async fn start(
329            &self,
330            request: tonic::Request<super::StartRequest>,
331        ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status>;
332        /// Stop a started service
333        async fn stop(
334            &self,
335            request: tonic::Request<super::StopRequest>,
336        ) -> std::result::Result<tonic::Response<super::StopResponse>, tonic::Status>;
337        /// Server streaming response type for the SubscribeStop method.
338        type SubscribeStopStream: tonic::codegen::tokio_stream::Stream<
339                Item = std::result::Result<super::SubscribeStopResponse, tonic::Status>,
340            > + Send
341            + 'static;
342        /// Channel to notify a service has been stopped
343        async fn subscribe_stop(
344            &self,
345            request: tonic::Request<super::SubscribeStopRequest>,
346        ) -> std::result::Result<tonic::Response<Self::SubscribeStopStream>, tonic::Status>;
347        async fn version(
348            &self,
349            request: tonic::Request<super::Ping>,
350        ) -> std::result::Result<tonic::Response<super::VersionInfo>, tonic::Status>;
351        async fn health_check(
352            &self,
353            request: tonic::Request<super::Ping>,
354        ) -> std::result::Result<tonic::Response<super::Pong>, tonic::Status>;
355    }
356    #[derive(Debug)]
357    pub struct RuntimeServer<T: Runtime> {
358        inner: _Inner<T>,
359        accept_compression_encodings: EnabledCompressionEncodings,
360        send_compression_encodings: EnabledCompressionEncodings,
361        max_decoding_message_size: Option<usize>,
362        max_encoding_message_size: Option<usize>,
363    }
364    struct _Inner<T>(Arc<T>);
365    impl<T: Runtime> RuntimeServer<T> {
366        pub fn new(inner: T) -> Self {
367            Self::from_arc(Arc::new(inner))
368        }
369        pub fn from_arc(inner: Arc<T>) -> Self {
370            let inner = _Inner(inner);
371            Self {
372                inner,
373                accept_compression_encodings: Default::default(),
374                send_compression_encodings: Default::default(),
375                max_decoding_message_size: None,
376                max_encoding_message_size: None,
377            }
378        }
379        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
380        where
381            F: tonic::service::Interceptor,
382        {
383            InterceptedService::new(Self::new(inner), interceptor)
384        }
385        /// Enable decompressing requests with the given encoding.
386        #[must_use]
387        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
388            self.accept_compression_encodings.enable(encoding);
389            self
390        }
391        /// Compress responses with the given encoding, if the client supports it.
392        #[must_use]
393        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
394            self.send_compression_encodings.enable(encoding);
395            self
396        }
397        /// Limits the maximum size of a decoded message.
398        ///
399        /// Default: `4MB`
400        #[must_use]
401        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
402            self.max_decoding_message_size = Some(limit);
403            self
404        }
405        /// Limits the maximum size of an encoded message.
406        ///
407        /// Default: `usize::MAX`
408        #[must_use]
409        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
410            self.max_encoding_message_size = Some(limit);
411            self
412        }
413    }
414    impl<T, B> tonic::codegen::Service<http::Request<B>> for RuntimeServer<T>
415    where
416        T: Runtime,
417        B: Body + Send + 'static,
418        B::Error: Into<StdError> + Send + 'static,
419    {
420        type Response = http::Response<tonic::body::BoxBody>;
421        type Error = std::convert::Infallible;
422        type Future = BoxFuture<Self::Response, Self::Error>;
423        fn poll_ready(
424            &mut self,
425            _cx: &mut Context<'_>,
426        ) -> Poll<std::result::Result<(), Self::Error>> {
427            Poll::Ready(Ok(()))
428        }
429        fn call(&mut self, req: http::Request<B>) -> Self::Future {
430            let inner = self.inner.clone();
431            match req.uri().path() {
432                "/runtime.Runtime/Load" => {
433                    #[allow(non_camel_case_types)]
434                    struct LoadSvc<T: Runtime>(pub Arc<T>);
435                    impl<T: Runtime> tonic::server::UnaryService<super::LoadRequest> for LoadSvc<T> {
436                        type Response = super::LoadResponse;
437                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
438                        fn call(
439                            &mut self,
440                            request: tonic::Request<super::LoadRequest>,
441                        ) -> Self::Future {
442                            let inner = Arc::clone(&self.0);
443                            let fut = async move { <T as Runtime>::load(&inner, request).await };
444                            Box::pin(fut)
445                        }
446                    }
447                    let accept_compression_encodings = self.accept_compression_encodings;
448                    let send_compression_encodings = self.send_compression_encodings;
449                    let max_decoding_message_size = self.max_decoding_message_size;
450                    let max_encoding_message_size = self.max_encoding_message_size;
451                    let inner = self.inner.clone();
452                    let fut = async move {
453                        let inner = inner.0;
454                        let method = LoadSvc(inner);
455                        let codec = tonic::codec::ProstCodec::default();
456                        let mut grpc = tonic::server::Grpc::new(codec)
457                            .apply_compression_config(
458                                accept_compression_encodings,
459                                send_compression_encodings,
460                            )
461                            .apply_max_message_size_config(
462                                max_decoding_message_size,
463                                max_encoding_message_size,
464                            );
465                        let res = grpc.unary(method, req).await;
466                        Ok(res)
467                    };
468                    Box::pin(fut)
469                }
470                "/runtime.Runtime/Start" => {
471                    #[allow(non_camel_case_types)]
472                    struct StartSvc<T: Runtime>(pub Arc<T>);
473                    impl<T: Runtime> tonic::server::UnaryService<super::StartRequest> for StartSvc<T> {
474                        type Response = super::StartResponse;
475                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
476                        fn call(
477                            &mut self,
478                            request: tonic::Request<super::StartRequest>,
479                        ) -> Self::Future {
480                            let inner = Arc::clone(&self.0);
481                            let fut = async move { <T as Runtime>::start(&inner, request).await };
482                            Box::pin(fut)
483                        }
484                    }
485                    let accept_compression_encodings = self.accept_compression_encodings;
486                    let send_compression_encodings = self.send_compression_encodings;
487                    let max_decoding_message_size = self.max_decoding_message_size;
488                    let max_encoding_message_size = self.max_encoding_message_size;
489                    let inner = self.inner.clone();
490                    let fut = async move {
491                        let inner = inner.0;
492                        let method = StartSvc(inner);
493                        let codec = tonic::codec::ProstCodec::default();
494                        let mut grpc = tonic::server::Grpc::new(codec)
495                            .apply_compression_config(
496                                accept_compression_encodings,
497                                send_compression_encodings,
498                            )
499                            .apply_max_message_size_config(
500                                max_decoding_message_size,
501                                max_encoding_message_size,
502                            );
503                        let res = grpc.unary(method, req).await;
504                        Ok(res)
505                    };
506                    Box::pin(fut)
507                }
508                "/runtime.Runtime/Stop" => {
509                    #[allow(non_camel_case_types)]
510                    struct StopSvc<T: Runtime>(pub Arc<T>);
511                    impl<T: Runtime> tonic::server::UnaryService<super::StopRequest> for StopSvc<T> {
512                        type Response = super::StopResponse;
513                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
514                        fn call(
515                            &mut self,
516                            request: tonic::Request<super::StopRequest>,
517                        ) -> Self::Future {
518                            let inner = Arc::clone(&self.0);
519                            let fut = async move { <T as Runtime>::stop(&inner, request).await };
520                            Box::pin(fut)
521                        }
522                    }
523                    let accept_compression_encodings = self.accept_compression_encodings;
524                    let send_compression_encodings = self.send_compression_encodings;
525                    let max_decoding_message_size = self.max_decoding_message_size;
526                    let max_encoding_message_size = self.max_encoding_message_size;
527                    let inner = self.inner.clone();
528                    let fut = async move {
529                        let inner = inner.0;
530                        let method = StopSvc(inner);
531                        let codec = tonic::codec::ProstCodec::default();
532                        let mut grpc = tonic::server::Grpc::new(codec)
533                            .apply_compression_config(
534                                accept_compression_encodings,
535                                send_compression_encodings,
536                            )
537                            .apply_max_message_size_config(
538                                max_decoding_message_size,
539                                max_encoding_message_size,
540                            );
541                        let res = grpc.unary(method, req).await;
542                        Ok(res)
543                    };
544                    Box::pin(fut)
545                }
546                "/runtime.Runtime/SubscribeStop" => {
547                    #[allow(non_camel_case_types)]
548                    struct SubscribeStopSvc<T: Runtime>(pub Arc<T>);
549                    impl<T: Runtime>
550                        tonic::server::ServerStreamingService<super::SubscribeStopRequest>
551                        for SubscribeStopSvc<T>
552                    {
553                        type Response = super::SubscribeStopResponse;
554                        type ResponseStream = T::SubscribeStopStream;
555                        type Future =
556                            BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
557                        fn call(
558                            &mut self,
559                            request: tonic::Request<super::SubscribeStopRequest>,
560                        ) -> Self::Future {
561                            let inner = Arc::clone(&self.0);
562                            let fut = async move {
563                                <T as Runtime>::subscribe_stop(&inner, request).await
564                            };
565                            Box::pin(fut)
566                        }
567                    }
568                    let accept_compression_encodings = self.accept_compression_encodings;
569                    let send_compression_encodings = self.send_compression_encodings;
570                    let max_decoding_message_size = self.max_decoding_message_size;
571                    let max_encoding_message_size = self.max_encoding_message_size;
572                    let inner = self.inner.clone();
573                    let fut = async move {
574                        let inner = inner.0;
575                        let method = SubscribeStopSvc(inner);
576                        let codec = tonic::codec::ProstCodec::default();
577                        let mut grpc = tonic::server::Grpc::new(codec)
578                            .apply_compression_config(
579                                accept_compression_encodings,
580                                send_compression_encodings,
581                            )
582                            .apply_max_message_size_config(
583                                max_decoding_message_size,
584                                max_encoding_message_size,
585                            );
586                        let res = grpc.server_streaming(method, req).await;
587                        Ok(res)
588                    };
589                    Box::pin(fut)
590                }
591                "/runtime.Runtime/Version" => {
592                    #[allow(non_camel_case_types)]
593                    struct VersionSvc<T: Runtime>(pub Arc<T>);
594                    impl<T: Runtime> tonic::server::UnaryService<super::Ping> for VersionSvc<T> {
595                        type Response = super::VersionInfo;
596                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
597                        fn call(&mut self, request: tonic::Request<super::Ping>) -> Self::Future {
598                            let inner = Arc::clone(&self.0);
599                            let fut = async move { <T as Runtime>::version(&inner, request).await };
600                            Box::pin(fut)
601                        }
602                    }
603                    let accept_compression_encodings = self.accept_compression_encodings;
604                    let send_compression_encodings = self.send_compression_encodings;
605                    let max_decoding_message_size = self.max_decoding_message_size;
606                    let max_encoding_message_size = self.max_encoding_message_size;
607                    let inner = self.inner.clone();
608                    let fut = async move {
609                        let inner = inner.0;
610                        let method = VersionSvc(inner);
611                        let codec = tonic::codec::ProstCodec::default();
612                        let mut grpc = tonic::server::Grpc::new(codec)
613                            .apply_compression_config(
614                                accept_compression_encodings,
615                                send_compression_encodings,
616                            )
617                            .apply_max_message_size_config(
618                                max_decoding_message_size,
619                                max_encoding_message_size,
620                            );
621                        let res = grpc.unary(method, req).await;
622                        Ok(res)
623                    };
624                    Box::pin(fut)
625                }
626                "/runtime.Runtime/HealthCheck" => {
627                    #[allow(non_camel_case_types)]
628                    struct HealthCheckSvc<T: Runtime>(pub Arc<T>);
629                    impl<T: Runtime> tonic::server::UnaryService<super::Ping> for HealthCheckSvc<T> {
630                        type Response = super::Pong;
631                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
632                        fn call(&mut self, request: tonic::Request<super::Ping>) -> Self::Future {
633                            let inner = Arc::clone(&self.0);
634                            let fut =
635                                async move { <T as Runtime>::health_check(&inner, request).await };
636                            Box::pin(fut)
637                        }
638                    }
639                    let accept_compression_encodings = self.accept_compression_encodings;
640                    let send_compression_encodings = self.send_compression_encodings;
641                    let max_decoding_message_size = self.max_decoding_message_size;
642                    let max_encoding_message_size = self.max_encoding_message_size;
643                    let inner = self.inner.clone();
644                    let fut = async move {
645                        let inner = inner.0;
646                        let method = HealthCheckSvc(inner);
647                        let codec = tonic::codec::ProstCodec::default();
648                        let mut grpc = tonic::server::Grpc::new(codec)
649                            .apply_compression_config(
650                                accept_compression_encodings,
651                                send_compression_encodings,
652                            )
653                            .apply_max_message_size_config(
654                                max_decoding_message_size,
655                                max_encoding_message_size,
656                            );
657                        let res = grpc.unary(method, req).await;
658                        Ok(res)
659                    };
660                    Box::pin(fut)
661                }
662                _ => Box::pin(async move {
663                    Ok(http::Response::builder()
664                        .status(200)
665                        .header("grpc-status", "12")
666                        .header("content-type", "application/grpc")
667                        .body(empty_body())
668                        .unwrap())
669                }),
670            }
671        }
672    }
673    impl<T: Runtime> Clone for RuntimeServer<T> {
674        fn clone(&self) -> Self {
675            let inner = self.inner.clone();
676            Self {
677                inner,
678                accept_compression_encodings: self.accept_compression_encodings,
679                send_compression_encodings: self.send_compression_encodings,
680                max_decoding_message_size: self.max_decoding_message_size,
681                max_encoding_message_size: self.max_encoding_message_size,
682            }
683        }
684    }
685    impl<T: Runtime> Clone for _Inner<T> {
686        fn clone(&self) -> Self {
687            Self(Arc::clone(&self.0))
688        }
689    }
690    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
691        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
692            write!(f, "{:?}", self.0)
693        }
694    }
695    impl<T: Runtime> tonic::server::NamedService for RuntimeServer<T> {
696        const NAME: &'static str = "runtime.Runtime";
697    }
698}