juno_rust_proto/prost/cosmos-sdk/
cosmos.base.reflection.v2alpha1.rs

1/// AppDescriptor describes a cosmos-sdk based application
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct AppDescriptor {
5    /// AuthnDescriptor provides information on how to authenticate transactions on the application
6    /// NOTE: experimental and subject to change in future releases.
7    #[prost(message, optional, tag = "1")]
8    pub authn: ::core::option::Option<AuthnDescriptor>,
9    /// chain provides the chain descriptor
10    #[prost(message, optional, tag = "2")]
11    pub chain: ::core::option::Option<ChainDescriptor>,
12    /// codec provides metadata information regarding codec related types
13    #[prost(message, optional, tag = "3")]
14    pub codec: ::core::option::Option<CodecDescriptor>,
15    /// configuration provides metadata information regarding the sdk.Config type
16    #[prost(message, optional, tag = "4")]
17    pub configuration: ::core::option::Option<ConfigurationDescriptor>,
18    /// query_services provides metadata information regarding the available queriable endpoints
19    #[prost(message, optional, tag = "5")]
20    pub query_services: ::core::option::Option<QueryServicesDescriptor>,
21    /// tx provides metadata information regarding how to send transactions to the given application
22    #[prost(message, optional, tag = "6")]
23    pub tx: ::core::option::Option<TxDescriptor>,
24}
25/// TxDescriptor describes the accepted transaction type
26#[allow(clippy::derive_partial_eq_without_eq)]
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct TxDescriptor {
29    /// fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type)
30    /// it is not meant to support polymorphism of transaction types, it is supposed to be used by
31    /// reflection clients to understand if they can handle a specific transaction type in an application.
32    #[prost(string, tag = "1")]
33    pub fullname: ::prost::alloc::string::String,
34    /// msgs lists the accepted application messages (sdk.Msg)
35    #[prost(message, repeated, tag = "2")]
36    pub msgs: ::prost::alloc::vec::Vec<MsgDescriptor>,
37}
38/// AuthnDescriptor provides information on how to sign transactions without relying
39/// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct AuthnDescriptor {
43    /// sign_modes defines the supported signature algorithm
44    #[prost(message, repeated, tag = "1")]
45    pub sign_modes: ::prost::alloc::vec::Vec<SigningModeDescriptor>,
46}
47/// SigningModeDescriptor provides information on a signing flow of the application
48/// NOTE(fdymylja): here we could go as far as providing an entire flow on how
49/// to sign a message given a SigningModeDescriptor, but it's better to think about
50/// this another time
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct SigningModeDescriptor {
54    /// name defines the unique name of the signing mode
55    #[prost(string, tag = "1")]
56    pub name: ::prost::alloc::string::String,
57    /// number is the unique int32 identifier for the sign_mode enum
58    #[prost(int32, tag = "2")]
59    pub number: i32,
60    /// authn_info_provider_method_fullname defines the fullname of the method to call to get
61    /// the metadata required to authenticate using the provided sign_modes
62    #[prost(string, tag = "3")]
63    pub authn_info_provider_method_fullname: ::prost::alloc::string::String,
64}
65/// ChainDescriptor describes chain information of the application
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct ChainDescriptor {
69    /// id is the chain id
70    #[prost(string, tag = "1")]
71    pub id: ::prost::alloc::string::String,
72}
73/// CodecDescriptor describes the registered interfaces and provides metadata information on the types
74#[allow(clippy::derive_partial_eq_without_eq)]
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct CodecDescriptor {
77    /// interfaces is a list of the registerted interfaces descriptors
78    #[prost(message, repeated, tag = "1")]
79    pub interfaces: ::prost::alloc::vec::Vec<InterfaceDescriptor>,
80}
81/// InterfaceDescriptor describes the implementation of an interface
82#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct InterfaceDescriptor {
85    /// fullname is the name of the interface
86    #[prost(string, tag = "1")]
87    pub fullname: ::prost::alloc::string::String,
88    /// interface_accepting_messages contains information regarding the proto messages which contain the interface as
89    /// google.protobuf.Any field
90    #[prost(message, repeated, tag = "2")]
91    pub interface_accepting_messages: ::prost::alloc::vec::Vec<InterfaceAcceptingMessageDescriptor>,
92    /// interface_implementers is a list of the descriptors of the interface implementers
93    #[prost(message, repeated, tag = "3")]
94    pub interface_implementers: ::prost::alloc::vec::Vec<InterfaceImplementerDescriptor>,
95}
96/// InterfaceImplementerDescriptor describes an interface implementer
97#[allow(clippy::derive_partial_eq_without_eq)]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct InterfaceImplementerDescriptor {
100    /// fullname is the protobuf queryable name of the interface implementer
101    #[prost(string, tag = "1")]
102    pub fullname: ::prost::alloc::string::String,
103    /// type_url defines the type URL used when marshalling the type as any
104    /// this is required so we can provide type safe google.protobuf.Any marshalling and
105    /// unmarshalling, making sure that we don't accept just 'any' type
106    /// in our interface fields
107    #[prost(string, tag = "2")]
108    pub type_url: ::prost::alloc::string::String,
109}
110/// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains
111/// an interface represented as a google.protobuf.Any
112#[allow(clippy::derive_partial_eq_without_eq)]
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct InterfaceAcceptingMessageDescriptor {
115    /// fullname is the protobuf fullname of the type containing the interface
116    #[prost(string, tag = "1")]
117    pub fullname: ::prost::alloc::string::String,
118    /// field_descriptor_names is a list of the protobuf name (not fullname) of the field
119    /// which contains the interface as google.protobuf.Any (the interface is the same, but
120    /// it can be in multiple fields of the same proto message)
121    #[prost(string, repeated, tag = "2")]
122    pub field_descriptor_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
123}
124/// ConfigurationDescriptor contains metadata information on the sdk.Config
125#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct ConfigurationDescriptor {
128    /// bech32_account_address_prefix is the account address prefix
129    #[prost(string, tag = "1")]
130    pub bech32_account_address_prefix: ::prost::alloc::string::String,
131}
132/// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction
133#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct MsgDescriptor {
136    /// msg_type_url contains the TypeURL of a sdk.Msg.
137    #[prost(string, tag = "1")]
138    pub msg_type_url: ::prost::alloc::string::String,
139}
140/// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC
141#[allow(clippy::derive_partial_eq_without_eq)]
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct GetAuthnDescriptorRequest {}
144/// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC
145#[allow(clippy::derive_partial_eq_without_eq)]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct GetAuthnDescriptorResponse {
148    /// authn describes how to authenticate to the application when sending transactions
149    #[prost(message, optional, tag = "1")]
150    pub authn: ::core::option::Option<AuthnDescriptor>,
151}
152/// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC
153#[allow(clippy::derive_partial_eq_without_eq)]
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct GetChainDescriptorRequest {}
156/// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC
157#[allow(clippy::derive_partial_eq_without_eq)]
158#[derive(Clone, PartialEq, ::prost::Message)]
159pub struct GetChainDescriptorResponse {
160    /// chain describes application chain information
161    #[prost(message, optional, tag = "1")]
162    pub chain: ::core::option::Option<ChainDescriptor>,
163}
164/// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC
165#[allow(clippy::derive_partial_eq_without_eq)]
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct GetCodecDescriptorRequest {}
168/// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC
169#[allow(clippy::derive_partial_eq_without_eq)]
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct GetCodecDescriptorResponse {
172    /// codec describes the application codec such as registered interfaces and implementations
173    #[prost(message, optional, tag = "1")]
174    pub codec: ::core::option::Option<CodecDescriptor>,
175}
176/// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC
177#[allow(clippy::derive_partial_eq_without_eq)]
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct GetConfigurationDescriptorRequest {}
180/// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC
181#[allow(clippy::derive_partial_eq_without_eq)]
182#[derive(Clone, PartialEq, ::prost::Message)]
183pub struct GetConfigurationDescriptorResponse {
184    /// config describes the application's sdk.Config
185    #[prost(message, optional, tag = "1")]
186    pub config: ::core::option::Option<ConfigurationDescriptor>,
187}
188/// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC
189#[allow(clippy::derive_partial_eq_without_eq)]
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct GetQueryServicesDescriptorRequest {}
192/// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC
193#[allow(clippy::derive_partial_eq_without_eq)]
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct GetQueryServicesDescriptorResponse {
196    /// queries provides information on the available queryable services
197    #[prost(message, optional, tag = "1")]
198    pub queries: ::core::option::Option<QueryServicesDescriptor>,
199}
200/// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC
201#[allow(clippy::derive_partial_eq_without_eq)]
202#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct GetTxDescriptorRequest {}
204/// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC
205#[allow(clippy::derive_partial_eq_without_eq)]
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct GetTxDescriptorResponse {
208    /// tx provides information on msgs that can be forwarded to the application
209    /// alongside the accepted transaction protobuf type
210    #[prost(message, optional, tag = "1")]
211    pub tx: ::core::option::Option<TxDescriptor>,
212}
213/// QueryServicesDescriptor contains the list of cosmos-sdk queriable services
214#[allow(clippy::derive_partial_eq_without_eq)]
215#[derive(Clone, PartialEq, ::prost::Message)]
216pub struct QueryServicesDescriptor {
217    /// query_services is a list of cosmos-sdk QueryServiceDescriptor
218    #[prost(message, repeated, tag = "1")]
219    pub query_services: ::prost::alloc::vec::Vec<QueryServiceDescriptor>,
220}
221/// QueryServiceDescriptor describes a cosmos-sdk queryable service
222#[allow(clippy::derive_partial_eq_without_eq)]
223#[derive(Clone, PartialEq, ::prost::Message)]
224pub struct QueryServiceDescriptor {
225    /// fullname is the protobuf fullname of the service descriptor
226    #[prost(string, tag = "1")]
227    pub fullname: ::prost::alloc::string::String,
228    /// is_module describes if this service is actually exposed by an application's module
229    #[prost(bool, tag = "2")]
230    pub is_module: bool,
231    /// methods provides a list of query service methods
232    #[prost(message, repeated, tag = "3")]
233    pub methods: ::prost::alloc::vec::Vec<QueryMethodDescriptor>,
234}
235/// QueryMethodDescriptor describes a queryable method of a query service
236/// no other info is provided beside method name and tendermint queryable path
237/// because it would be redundant with the grpc reflection service
238#[allow(clippy::derive_partial_eq_without_eq)]
239#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct QueryMethodDescriptor {
241    /// name is the protobuf name (not fullname) of the method
242    #[prost(string, tag = "1")]
243    pub name: ::prost::alloc::string::String,
244    /// full_query_path is the path that can be used to query
245    /// this method via tendermint abci.Query
246    #[prost(string, tag = "2")]
247    pub full_query_path: ::prost::alloc::string::String,
248}
249/// Generated client implementations.
250#[cfg(feature = "grpc")]
251#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
252pub mod reflection_service_client {
253    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
254    use tonic::codegen::http::Uri;
255    use tonic::codegen::*;
256    /// ReflectionService defines a service for application reflection.
257    #[derive(Debug, Clone)]
258    pub struct ReflectionServiceClient<T> {
259        inner: tonic::client::Grpc<T>,
260    }
261    #[cfg(feature = "grpc-transport")]
262    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
263    impl ReflectionServiceClient<tonic::transport::Channel> {
264        /// Attempt to create a new client by connecting to a given endpoint.
265        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
266        where
267            D: std::convert::TryInto<tonic::transport::Endpoint>,
268            D::Error: Into<StdError>,
269        {
270            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
271            Ok(Self::new(conn))
272        }
273    }
274    impl<T> ReflectionServiceClient<T>
275    where
276        T: tonic::client::GrpcService<tonic::body::BoxBody>,
277        T::Error: Into<StdError>,
278        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
279        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
280    {
281        pub fn new(inner: T) -> Self {
282            let inner = tonic::client::Grpc::new(inner);
283            Self { inner }
284        }
285        pub fn with_origin(inner: T, origin: Uri) -> Self {
286            let inner = tonic::client::Grpc::with_origin(inner, origin);
287            Self { inner }
288        }
289        pub fn with_interceptor<F>(
290            inner: T,
291            interceptor: F,
292        ) -> ReflectionServiceClient<InterceptedService<T, F>>
293        where
294            F: tonic::service::Interceptor,
295            T::ResponseBody: Default,
296            T: tonic::codegen::Service<
297                http::Request<tonic::body::BoxBody>,
298                Response = http::Response<
299                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
300                >,
301            >,
302            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
303                Into<StdError> + Send + Sync,
304        {
305            ReflectionServiceClient::new(InterceptedService::new(inner, interceptor))
306        }
307        /// Compress requests with the given encoding.
308        ///
309        /// This requires the server to support it otherwise it might respond with an
310        /// error.
311        #[must_use]
312        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
313            self.inner = self.inner.send_compressed(encoding);
314            self
315        }
316        /// Enable decompressing responses.
317        #[must_use]
318        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
319            self.inner = self.inner.accept_compressed(encoding);
320            self
321        }
322        /// GetAuthnDescriptor returns information on how to authenticate transactions in the application
323        /// NOTE: this RPC is still experimental and might be subject to breaking changes or removal in
324        /// future releases of the cosmos-sdk.
325        pub async fn get_authn_descriptor(
326            &mut self,
327            request: impl tonic::IntoRequest<super::GetAuthnDescriptorRequest>,
328        ) -> Result<tonic::Response<super::GetAuthnDescriptorResponse>, tonic::Status> {
329            self.inner.ready().await.map_err(|e| {
330                tonic::Status::new(
331                    tonic::Code::Unknown,
332                    format!("Service was not ready: {}", e.into()),
333                )
334            })?;
335            let codec = tonic::codec::ProstCodec::default();
336            let path = http::uri::PathAndQuery::from_static(
337                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor",
338            );
339            self.inner.unary(request.into_request(), path, codec).await
340        }
341        /// GetChainDescriptor returns the description of the chain
342        pub async fn get_chain_descriptor(
343            &mut self,
344            request: impl tonic::IntoRequest<super::GetChainDescriptorRequest>,
345        ) -> Result<tonic::Response<super::GetChainDescriptorResponse>, tonic::Status> {
346            self.inner.ready().await.map_err(|e| {
347                tonic::Status::new(
348                    tonic::Code::Unknown,
349                    format!("Service was not ready: {}", e.into()),
350                )
351            })?;
352            let codec = tonic::codec::ProstCodec::default();
353            let path = http::uri::PathAndQuery::from_static(
354                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor",
355            );
356            self.inner.unary(request.into_request(), path, codec).await
357        }
358        /// GetCodecDescriptor returns the descriptor of the codec of the application
359        pub async fn get_codec_descriptor(
360            &mut self,
361            request: impl tonic::IntoRequest<super::GetCodecDescriptorRequest>,
362        ) -> Result<tonic::Response<super::GetCodecDescriptorResponse>, tonic::Status> {
363            self.inner.ready().await.map_err(|e| {
364                tonic::Status::new(
365                    tonic::Code::Unknown,
366                    format!("Service was not ready: {}", e.into()),
367                )
368            })?;
369            let codec = tonic::codec::ProstCodec::default();
370            let path = http::uri::PathAndQuery::from_static(
371                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor",
372            );
373            self.inner.unary(request.into_request(), path, codec).await
374        }
375        /// GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application
376        pub async fn get_configuration_descriptor(
377            &mut self,
378            request: impl tonic::IntoRequest<super::GetConfigurationDescriptorRequest>,
379        ) -> Result<tonic::Response<super::GetConfigurationDescriptorResponse>, tonic::Status>
380        {
381            self.inner.ready().await.map_err(|e| {
382                tonic::Status::new(
383                    tonic::Code::Unknown,
384                    format!("Service was not ready: {}", e.into()),
385                )
386            })?;
387            let codec = tonic::codec::ProstCodec::default();
388            let path = http::uri::PathAndQuery::from_static(
389                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor",
390            );
391            self.inner.unary(request.into_request(), path, codec).await
392        }
393        /// GetQueryServicesDescriptor returns the available gRPC queryable services of the application
394        pub async fn get_query_services_descriptor(
395            &mut self,
396            request: impl tonic::IntoRequest<super::GetQueryServicesDescriptorRequest>,
397        ) -> Result<tonic::Response<super::GetQueryServicesDescriptorResponse>, tonic::Status>
398        {
399            self.inner.ready().await.map_err(|e| {
400                tonic::Status::new(
401                    tonic::Code::Unknown,
402                    format!("Service was not ready: {}", e.into()),
403                )
404            })?;
405            let codec = tonic::codec::ProstCodec::default();
406            let path = http::uri::PathAndQuery::from_static(
407                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor",
408            );
409            self.inner.unary(request.into_request(), path, codec).await
410        }
411        /// GetTxDescriptor returns information on the used transaction object and available msgs that can be used
412        pub async fn get_tx_descriptor(
413            &mut self,
414            request: impl tonic::IntoRequest<super::GetTxDescriptorRequest>,
415        ) -> Result<tonic::Response<super::GetTxDescriptorResponse>, tonic::Status> {
416            self.inner.ready().await.map_err(|e| {
417                tonic::Status::new(
418                    tonic::Code::Unknown,
419                    format!("Service was not ready: {}", e.into()),
420                )
421            })?;
422            let codec = tonic::codec::ProstCodec::default();
423            let path = http::uri::PathAndQuery::from_static(
424                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor",
425            );
426            self.inner.unary(request.into_request(), path, codec).await
427        }
428    }
429}
430/// Generated server implementations.
431#[cfg(feature = "grpc")]
432#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
433pub mod reflection_service_server {
434    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
435    use tonic::codegen::*;
436    /// Generated trait containing gRPC methods that should be implemented for use with ReflectionServiceServer.
437    #[async_trait]
438    pub trait ReflectionService: Send + Sync + 'static {
439        /// GetAuthnDescriptor returns information on how to authenticate transactions in the application
440        /// NOTE: this RPC is still experimental and might be subject to breaking changes or removal in
441        /// future releases of the cosmos-sdk.
442        async fn get_authn_descriptor(
443            &self,
444            request: tonic::Request<super::GetAuthnDescriptorRequest>,
445        ) -> Result<tonic::Response<super::GetAuthnDescriptorResponse>, tonic::Status>;
446        /// GetChainDescriptor returns the description of the chain
447        async fn get_chain_descriptor(
448            &self,
449            request: tonic::Request<super::GetChainDescriptorRequest>,
450        ) -> Result<tonic::Response<super::GetChainDescriptorResponse>, tonic::Status>;
451        /// GetCodecDescriptor returns the descriptor of the codec of the application
452        async fn get_codec_descriptor(
453            &self,
454            request: tonic::Request<super::GetCodecDescriptorRequest>,
455        ) -> Result<tonic::Response<super::GetCodecDescriptorResponse>, tonic::Status>;
456        /// GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application
457        async fn get_configuration_descriptor(
458            &self,
459            request: tonic::Request<super::GetConfigurationDescriptorRequest>,
460        ) -> Result<tonic::Response<super::GetConfigurationDescriptorResponse>, tonic::Status>;
461        /// GetQueryServicesDescriptor returns the available gRPC queryable services of the application
462        async fn get_query_services_descriptor(
463            &self,
464            request: tonic::Request<super::GetQueryServicesDescriptorRequest>,
465        ) -> Result<tonic::Response<super::GetQueryServicesDescriptorResponse>, tonic::Status>;
466        /// GetTxDescriptor returns information on the used transaction object and available msgs that can be used
467        async fn get_tx_descriptor(
468            &self,
469            request: tonic::Request<super::GetTxDescriptorRequest>,
470        ) -> Result<tonic::Response<super::GetTxDescriptorResponse>, tonic::Status>;
471    }
472    /// ReflectionService defines a service for application reflection.
473    #[derive(Debug)]
474    pub struct ReflectionServiceServer<T: ReflectionService> {
475        inner: _Inner<T>,
476        accept_compression_encodings: EnabledCompressionEncodings,
477        send_compression_encodings: EnabledCompressionEncodings,
478    }
479    struct _Inner<T>(Arc<T>);
480    impl<T: ReflectionService> ReflectionServiceServer<T> {
481        pub fn new(inner: T) -> Self {
482            Self::from_arc(Arc::new(inner))
483        }
484        pub fn from_arc(inner: Arc<T>) -> Self {
485            let inner = _Inner(inner);
486            Self {
487                inner,
488                accept_compression_encodings: Default::default(),
489                send_compression_encodings: Default::default(),
490            }
491        }
492        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
493        where
494            F: tonic::service::Interceptor,
495        {
496            InterceptedService::new(Self::new(inner), interceptor)
497        }
498        /// Enable decompressing requests with the given encoding.
499        #[must_use]
500        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
501            self.accept_compression_encodings.enable(encoding);
502            self
503        }
504        /// Compress responses with the given encoding, if the client supports it.
505        #[must_use]
506        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
507            self.send_compression_encodings.enable(encoding);
508            self
509        }
510    }
511    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReflectionServiceServer<T>
512    where
513        T: ReflectionService,
514        B: Body + Send + 'static,
515        B::Error: Into<StdError> + Send + 'static,
516    {
517        type Response = http::Response<tonic::body::BoxBody>;
518        type Error = std::convert::Infallible;
519        type Future = BoxFuture<Self::Response, Self::Error>;
520        fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
521            Poll::Ready(Ok(()))
522        }
523        fn call(&mut self, req: http::Request<B>) -> Self::Future {
524            let inner = self.inner.clone();
525            match req.uri().path() {
526                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor" => {
527                    #[allow(non_camel_case_types)]
528                    struct GetAuthnDescriptorSvc<T: ReflectionService>(pub Arc<T>);
529                    impl<T: ReflectionService>
530                        tonic::server::UnaryService<super::GetAuthnDescriptorRequest>
531                        for GetAuthnDescriptorSvc<T>
532                    {
533                        type Response = super::GetAuthnDescriptorResponse;
534                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
535                        fn call(
536                            &mut self,
537                            request: tonic::Request<super::GetAuthnDescriptorRequest>,
538                        ) -> Self::Future {
539                            let inner = self.0.clone();
540                            let fut = async move { (*inner).get_authn_descriptor(request).await };
541                            Box::pin(fut)
542                        }
543                    }
544                    let accept_compression_encodings = self.accept_compression_encodings;
545                    let send_compression_encodings = self.send_compression_encodings;
546                    let inner = self.inner.clone();
547                    let fut = async move {
548                        let inner = inner.0;
549                        let method = GetAuthnDescriptorSvc(inner);
550                        let codec = tonic::codec::ProstCodec::default();
551                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
552                            accept_compression_encodings,
553                            send_compression_encodings,
554                        );
555                        let res = grpc.unary(method, req).await;
556                        Ok(res)
557                    };
558                    Box::pin(fut)
559                }
560                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor" => {
561                    #[allow(non_camel_case_types)]
562                    struct GetChainDescriptorSvc<T: ReflectionService>(pub Arc<T>);
563                    impl<T: ReflectionService>
564                        tonic::server::UnaryService<super::GetChainDescriptorRequest>
565                        for GetChainDescriptorSvc<T>
566                    {
567                        type Response = super::GetChainDescriptorResponse;
568                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
569                        fn call(
570                            &mut self,
571                            request: tonic::Request<super::GetChainDescriptorRequest>,
572                        ) -> Self::Future {
573                            let inner = self.0.clone();
574                            let fut = async move { (*inner).get_chain_descriptor(request).await };
575                            Box::pin(fut)
576                        }
577                    }
578                    let accept_compression_encodings = self.accept_compression_encodings;
579                    let send_compression_encodings = self.send_compression_encodings;
580                    let inner = self.inner.clone();
581                    let fut = async move {
582                        let inner = inner.0;
583                        let method = GetChainDescriptorSvc(inner);
584                        let codec = tonic::codec::ProstCodec::default();
585                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
586                            accept_compression_encodings,
587                            send_compression_encodings,
588                        );
589                        let res = grpc.unary(method, req).await;
590                        Ok(res)
591                    };
592                    Box::pin(fut)
593                }
594                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor" => {
595                    #[allow(non_camel_case_types)]
596                    struct GetCodecDescriptorSvc<T: ReflectionService>(pub Arc<T>);
597                    impl<T: ReflectionService>
598                        tonic::server::UnaryService<super::GetCodecDescriptorRequest>
599                        for GetCodecDescriptorSvc<T>
600                    {
601                        type Response = super::GetCodecDescriptorResponse;
602                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
603                        fn call(
604                            &mut self,
605                            request: tonic::Request<super::GetCodecDescriptorRequest>,
606                        ) -> Self::Future {
607                            let inner = self.0.clone();
608                            let fut = async move { (*inner).get_codec_descriptor(request).await };
609                            Box::pin(fut)
610                        }
611                    }
612                    let accept_compression_encodings = self.accept_compression_encodings;
613                    let send_compression_encodings = self.send_compression_encodings;
614                    let inner = self.inner.clone();
615                    let fut = async move {
616                        let inner = inner.0;
617                        let method = GetCodecDescriptorSvc(inner);
618                        let codec = tonic::codec::ProstCodec::default();
619                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
620                            accept_compression_encodings,
621                            send_compression_encodings,
622                        );
623                        let res = grpc.unary(method, req).await;
624                        Ok(res)
625                    };
626                    Box::pin(fut)
627                }
628                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor" => {
629                    #[allow(non_camel_case_types)]
630                    struct GetConfigurationDescriptorSvc<T: ReflectionService>(pub Arc<T>);
631                    impl<T: ReflectionService>
632                        tonic::server::UnaryService<super::GetConfigurationDescriptorRequest>
633                        for GetConfigurationDescriptorSvc<T>
634                    {
635                        type Response = super::GetConfigurationDescriptorResponse;
636                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
637                        fn call(
638                            &mut self,
639                            request: tonic::Request<super::GetConfigurationDescriptorRequest>,
640                        ) -> Self::Future {
641                            let inner = self.0.clone();
642                            let fut =
643                                async move { (*inner).get_configuration_descriptor(request).await };
644                            Box::pin(fut)
645                        }
646                    }
647                    let accept_compression_encodings = self.accept_compression_encodings;
648                    let send_compression_encodings = self.send_compression_encodings;
649                    let inner = self.inner.clone();
650                    let fut = async move {
651                        let inner = inner.0;
652                        let method = GetConfigurationDescriptorSvc(inner);
653                        let codec = tonic::codec::ProstCodec::default();
654                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
655                            accept_compression_encodings,
656                            send_compression_encodings,
657                        );
658                        let res = grpc.unary(method, req).await;
659                        Ok(res)
660                    };
661                    Box::pin(fut)
662                }
663                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor" => {
664                    #[allow(non_camel_case_types)]
665                    struct GetQueryServicesDescriptorSvc<T: ReflectionService>(pub Arc<T>);
666                    impl<T: ReflectionService>
667                        tonic::server::UnaryService<super::GetQueryServicesDescriptorRequest>
668                        for GetQueryServicesDescriptorSvc<T>
669                    {
670                        type Response = super::GetQueryServicesDescriptorResponse;
671                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
672                        fn call(
673                            &mut self,
674                            request: tonic::Request<super::GetQueryServicesDescriptorRequest>,
675                        ) -> Self::Future {
676                            let inner = self.0.clone();
677                            let fut = async move {
678                                (*inner).get_query_services_descriptor(request).await
679                            };
680                            Box::pin(fut)
681                        }
682                    }
683                    let accept_compression_encodings = self.accept_compression_encodings;
684                    let send_compression_encodings = self.send_compression_encodings;
685                    let inner = self.inner.clone();
686                    let fut = async move {
687                        let inner = inner.0;
688                        let method = GetQueryServicesDescriptorSvc(inner);
689                        let codec = tonic::codec::ProstCodec::default();
690                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
691                            accept_compression_encodings,
692                            send_compression_encodings,
693                        );
694                        let res = grpc.unary(method, req).await;
695                        Ok(res)
696                    };
697                    Box::pin(fut)
698                }
699                "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor" => {
700                    #[allow(non_camel_case_types)]
701                    struct GetTxDescriptorSvc<T: ReflectionService>(pub Arc<T>);
702                    impl<T: ReflectionService>
703                        tonic::server::UnaryService<super::GetTxDescriptorRequest>
704                        for GetTxDescriptorSvc<T>
705                    {
706                        type Response = super::GetTxDescriptorResponse;
707                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
708                        fn call(
709                            &mut self,
710                            request: tonic::Request<super::GetTxDescriptorRequest>,
711                        ) -> Self::Future {
712                            let inner = self.0.clone();
713                            let fut = async move { (*inner).get_tx_descriptor(request).await };
714                            Box::pin(fut)
715                        }
716                    }
717                    let accept_compression_encodings = self.accept_compression_encodings;
718                    let send_compression_encodings = self.send_compression_encodings;
719                    let inner = self.inner.clone();
720                    let fut = async move {
721                        let inner = inner.0;
722                        let method = GetTxDescriptorSvc(inner);
723                        let codec = tonic::codec::ProstCodec::default();
724                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
725                            accept_compression_encodings,
726                            send_compression_encodings,
727                        );
728                        let res = grpc.unary(method, req).await;
729                        Ok(res)
730                    };
731                    Box::pin(fut)
732                }
733                _ => Box::pin(async move {
734                    Ok(http::Response::builder()
735                        .status(200)
736                        .header("grpc-status", "12")
737                        .header("content-type", "application/grpc")
738                        .body(empty_body())
739                        .unwrap())
740                }),
741            }
742        }
743    }
744    impl<T: ReflectionService> Clone for ReflectionServiceServer<T> {
745        fn clone(&self) -> Self {
746            let inner = self.inner.clone();
747            Self {
748                inner,
749                accept_compression_encodings: self.accept_compression_encodings,
750                send_compression_encodings: self.send_compression_encodings,
751            }
752        }
753    }
754    impl<T: ReflectionService> Clone for _Inner<T> {
755        fn clone(&self) -> Self {
756            Self(self.0.clone())
757        }
758    }
759    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
760        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
761            write!(f, "{:?}", self.0)
762        }
763    }
764    impl<T: ReflectionService> tonic::server::NamedService for ReflectionServiceServer<T> {
765        const NAME: &'static str = "cosmos.base.reflection.v2alpha1.ReflectionService";
766    }
767}