1#[cfg(feature = "grpc")]
4pub mod service_client {
5 #![allow(
6 unused_variables,
7 dead_code,
8 missing_docs,
9 clippy::wildcard_imports,
10 clippy::let_unit_value
11 )]
12 use tonic::codegen::http::Uri;
13 use tonic::codegen::*;
14 #[derive(Debug, Clone)]
15 pub struct ServiceClient<T> {
16 inner: tonic::client::Grpc<T>,
17 }
18 #[cfg(feature = "grpc-transport")]
19 impl ServiceClient<tonic::transport::Channel> {
20 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
22 where
23 D: TryInto<tonic::transport::Endpoint>,
24 D::Error: Into<StdError>,
25 {
26 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
27 Ok(Self::new(conn))
28 }
29 }
30 impl<T> ServiceClient<T>
31 where
32 T: tonic::client::GrpcService<tonic::body::Body>,
33 T::Error: Into<StdError>,
34 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
35 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
36 {
37 pub fn new(inner: T) -> Self {
38 let inner = tonic::client::Grpc::new(inner);
39 Self { inner }
40 }
41 pub fn with_origin(inner: T, origin: Uri) -> Self {
42 let inner = tonic::client::Grpc::with_origin(inner, origin);
43 Self { inner }
44 }
45 pub fn with_interceptor<F>(
46 inner: T,
47 interceptor: F,
48 ) -> ServiceClient<InterceptedService<T, F>>
49 where
50 F: tonic::service::Interceptor,
51 T::ResponseBody: Default,
52 T: tonic::codegen::Service<
53 http::Request<tonic::body::Body>,
54 Response = http::Response<
55 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
56 >,
57 >,
58 <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
59 Into<StdError> + std::marker::Send + std::marker::Sync,
60 {
61 ServiceClient::new(InterceptedService::new(inner, interceptor))
62 }
63 #[must_use]
68 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
69 self.inner = self.inner.send_compressed(encoding);
70 self
71 }
72 #[must_use]
74 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
75 self.inner = self.inner.accept_compressed(encoding);
76 self
77 }
78 #[must_use]
82 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
83 self.inner = self.inner.max_decoding_message_size(limit);
84 self
85 }
86 #[must_use]
90 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
91 self.inner = self.inner.max_encoding_message_size(limit);
92 self
93 }
94 pub async fn get_node_info(
95 &mut self,
96 request: impl tonic::IntoRequest<super::GetNodeInfoRequest>,
97 ) -> core::result::Result<tonic::Response<super::GetNodeInfoResponse>, tonic::Status>
98 {
99 self.inner.ready().await.map_err(|e| {
100 tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into()))
101 })?;
102 let codec = tonic::codec::ProstCodec::default();
103 let path = http::uri::PathAndQuery::from_static(
104 "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo",
105 );
106 let mut req = request.into_request();
107 req.extensions_mut().insert(GrpcMethod::new(
108 "cosmos.base.tendermint.v1beta1.Service",
109 "GetNodeInfo",
110 ));
111 self.inner.unary(req, path, codec).await
112 }
113 pub async fn get_syncing(
114 &mut self,
115 request: impl tonic::IntoRequest<super::GetSyncingRequest>,
116 ) -> core::result::Result<tonic::Response<super::GetSyncingResponse>, tonic::Status>
117 {
118 self.inner.ready().await.map_err(|e| {
119 tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into()))
120 })?;
121 let codec = tonic::codec::ProstCodec::default();
122 let path = http::uri::PathAndQuery::from_static(
123 "/cosmos.base.tendermint.v1beta1.Service/GetSyncing",
124 );
125 let mut req = request.into_request();
126 req.extensions_mut().insert(GrpcMethod::new(
127 "cosmos.base.tendermint.v1beta1.Service",
128 "GetSyncing",
129 ));
130 self.inner.unary(req, path, codec).await
131 }
132 pub async fn get_latest_block(
133 &mut self,
134 request: impl tonic::IntoRequest<super::GetLatestBlockRequest>,
135 ) -> core::result::Result<tonic::Response<super::GetLatestBlockResponse>, tonic::Status>
136 {
137 self.inner.ready().await.map_err(|e| {
138 tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into()))
139 })?;
140 let codec = tonic::codec::ProstCodec::default();
141 let path = http::uri::PathAndQuery::from_static(
142 "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock",
143 );
144 let mut req = request.into_request();
145 req.extensions_mut().insert(GrpcMethod::new(
146 "cosmos.base.tendermint.v1beta1.Service",
147 "GetLatestBlock",
148 ));
149 self.inner.unary(req, path, codec).await
150 }
151 pub async fn get_block_by_height(
152 &mut self,
153 request: impl tonic::IntoRequest<super::GetBlockByHeightRequest>,
154 ) -> core::result::Result<tonic::Response<super::GetBlockByHeightResponse>, tonic::Status>
155 {
156 self.inner.ready().await.map_err(|e| {
157 tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into()))
158 })?;
159 let codec = tonic::codec::ProstCodec::default();
160 let path = http::uri::PathAndQuery::from_static(
161 "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight",
162 );
163 let mut req = request.into_request();
164 req.extensions_mut().insert(GrpcMethod::new(
165 "cosmos.base.tendermint.v1beta1.Service",
166 "GetBlockByHeight",
167 ));
168 self.inner.unary(req, path, codec).await
169 }
170 pub async fn get_latest_validator_set(
171 &mut self,
172 request: impl tonic::IntoRequest<super::GetLatestValidatorSetRequest>,
173 ) -> core::result::Result<
174 tonic::Response<super::GetLatestValidatorSetResponse>,
175 tonic::Status,
176 > {
177 self.inner.ready().await.map_err(|e| {
178 tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into()))
179 })?;
180 let codec = tonic::codec::ProstCodec::default();
181 let path = http::uri::PathAndQuery::from_static(
182 "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet",
183 );
184 let mut req = request.into_request();
185 req.extensions_mut().insert(GrpcMethod::new(
186 "cosmos.base.tendermint.v1beta1.Service",
187 "GetLatestValidatorSet",
188 ));
189 self.inner.unary(req, path, codec).await
190 }
191 pub async fn get_validator_set_by_height(
192 &mut self,
193 request: impl tonic::IntoRequest<super::GetValidatorSetByHeightRequest>,
194 ) -> core::result::Result<
195 tonic::Response<super::GetValidatorSetByHeightResponse>,
196 tonic::Status,
197 > {
198 self.inner.ready().await.map_err(|e| {
199 tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into()))
200 })?;
201 let codec = tonic::codec::ProstCodec::default();
202 let path = http::uri::PathAndQuery::from_static(
203 "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight",
204 );
205 let mut req = request.into_request();
206 req.extensions_mut().insert(GrpcMethod::new(
207 "cosmos.base.tendermint.v1beta1.Service",
208 "GetValidatorSetByHeight",
209 ));
210 self.inner.unary(req, path, codec).await
211 }
212 pub async fn abci_query(
213 &mut self,
214 request: impl tonic::IntoRequest<super::AbciQueryRequest>,
215 ) -> core::result::Result<tonic::Response<super::AbciQueryResponse>, tonic::Status>
216 {
217 self.inner.ready().await.map_err(|e| {
218 tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into()))
219 })?;
220 let codec = tonic::codec::ProstCodec::default();
221 let path = http::uri::PathAndQuery::from_static(
222 "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery",
223 );
224 let mut req = request.into_request();
225 req.extensions_mut().insert(GrpcMethod::new(
226 "cosmos.base.tendermint.v1beta1.Service",
227 "ABCIQuery",
228 ));
229 self.inner.unary(req, path, codec).await
230 }
231 }
232}
233#[cfg(feature = "grpc")]
235pub mod service_server {
236 #![allow(
237 unused_variables,
238 dead_code,
239 missing_docs,
240 clippy::wildcard_imports,
241 clippy::let_unit_value
242 )]
243 use tonic::codegen::*;
244 #[async_trait]
246 pub trait Service: std::marker::Send + std::marker::Sync + 'static {
247 async fn get_node_info(
248 &self,
249 request: tonic::Request<super::GetNodeInfoRequest>,
250 ) -> core::result::Result<tonic::Response<super::GetNodeInfoResponse>, tonic::Status>;
251 async fn get_syncing(
252 &self,
253 request: tonic::Request<super::GetSyncingRequest>,
254 ) -> core::result::Result<tonic::Response<super::GetSyncingResponse>, tonic::Status>;
255 async fn get_latest_block(
256 &self,
257 request: tonic::Request<super::GetLatestBlockRequest>,
258 ) -> core::result::Result<tonic::Response<super::GetLatestBlockResponse>, tonic::Status>;
259 async fn get_block_by_height(
260 &self,
261 request: tonic::Request<super::GetBlockByHeightRequest>,
262 ) -> core::result::Result<tonic::Response<super::GetBlockByHeightResponse>, tonic::Status>;
263 async fn get_latest_validator_set(
264 &self,
265 request: tonic::Request<super::GetLatestValidatorSetRequest>,
266 ) -> core::result::Result<
267 tonic::Response<super::GetLatestValidatorSetResponse>,
268 tonic::Status,
269 >;
270 async fn get_validator_set_by_height(
271 &self,
272 request: tonic::Request<super::GetValidatorSetByHeightRequest>,
273 ) -> core::result::Result<
274 tonic::Response<super::GetValidatorSetByHeightResponse>,
275 tonic::Status,
276 >;
277 async fn abci_query(
278 &self,
279 request: tonic::Request<super::AbciQueryRequest>,
280 ) -> core::result::Result<tonic::Response<super::AbciQueryResponse>, tonic::Status>;
281 }
282 #[derive(Debug)]
283 pub struct ServiceServer<T> {
284 inner: Arc<T>,
285 accept_compression_encodings: EnabledCompressionEncodings,
286 send_compression_encodings: EnabledCompressionEncodings,
287 max_decoding_message_size: Option<usize>,
288 max_encoding_message_size: Option<usize>,
289 }
290 impl<T> ServiceServer<T> {
291 pub fn new(inner: T) -> Self {
292 Self::from_arc(Arc::new(inner))
293 }
294 pub fn from_arc(inner: Arc<T>) -> Self {
295 Self {
296 inner,
297 accept_compression_encodings: Default::default(),
298 send_compression_encodings: Default::default(),
299 max_decoding_message_size: None,
300 max_encoding_message_size: None,
301 }
302 }
303 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
304 where
305 F: tonic::service::Interceptor,
306 {
307 InterceptedService::new(Self::new(inner), interceptor)
308 }
309 #[must_use]
311 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
312 self.accept_compression_encodings.enable(encoding);
313 self
314 }
315 #[must_use]
317 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
318 self.send_compression_encodings.enable(encoding);
319 self
320 }
321 #[must_use]
325 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
326 self.max_decoding_message_size = Some(limit);
327 self
328 }
329 #[must_use]
333 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
334 self.max_encoding_message_size = Some(limit);
335 self
336 }
337 }
338 impl<T, B> tonic::codegen::Service<http::Request<B>> for ServiceServer<T>
339 where
340 T: Service,
341 B: Body + std::marker::Send + 'static,
342 B::Error: Into<StdError> + std::marker::Send + 'static,
343 {
344 type Response = http::Response<tonic::body::Body>;
345 type Error = std::convert::Infallible;
346 type Future = BoxFuture<Self::Response, Self::Error>;
347 fn poll_ready(
348 &mut self,
349 _cx: &mut Context<'_>,
350 ) -> Poll<core::result::Result<(), Self::Error>> {
351 Poll::Ready(Ok(()))
352 }
353 fn call(&mut self, req: http::Request<B>) -> Self::Future {
354 match req.uri().path() {
355 "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo" => {
356 #[allow(non_camel_case_types)]
357 struct GetNodeInfoSvc<T: Service>(pub Arc<T>);
358 impl<T: Service> tonic::server::UnaryService<super::GetNodeInfoRequest> for GetNodeInfoSvc<T> {
359 type Response = super::GetNodeInfoResponse;
360 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
361 fn call(
362 &mut self,
363 request: tonic::Request<super::GetNodeInfoRequest>,
364 ) -> Self::Future {
365 let inner = Arc::clone(&self.0);
366 let fut =
367 async move { <T as Service>::get_node_info(&inner, request).await };
368 Box::pin(fut)
369 }
370 }
371 let accept_compression_encodings = self.accept_compression_encodings;
372 let send_compression_encodings = self.send_compression_encodings;
373 let max_decoding_message_size = self.max_decoding_message_size;
374 let max_encoding_message_size = self.max_encoding_message_size;
375 let inner = self.inner.clone();
376 let fut = async move {
377 let method = GetNodeInfoSvc(inner);
378 let codec = tonic::codec::ProstCodec::default();
379 let mut grpc = tonic::server::Grpc::new(codec)
380 .apply_compression_config(
381 accept_compression_encodings,
382 send_compression_encodings,
383 )
384 .apply_max_message_size_config(
385 max_decoding_message_size,
386 max_encoding_message_size,
387 );
388 let res = grpc.unary(method, req).await;
389 Ok(res)
390 };
391 Box::pin(fut)
392 }
393 "/cosmos.base.tendermint.v1beta1.Service/GetSyncing" => {
394 #[allow(non_camel_case_types)]
395 struct GetSyncingSvc<T: Service>(pub Arc<T>);
396 impl<T: Service> tonic::server::UnaryService<super::GetSyncingRequest> for GetSyncingSvc<T> {
397 type Response = super::GetSyncingResponse;
398 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
399 fn call(
400 &mut self,
401 request: tonic::Request<super::GetSyncingRequest>,
402 ) -> Self::Future {
403 let inner = Arc::clone(&self.0);
404 let fut =
405 async move { <T as Service>::get_syncing(&inner, request).await };
406 Box::pin(fut)
407 }
408 }
409 let accept_compression_encodings = self.accept_compression_encodings;
410 let send_compression_encodings = self.send_compression_encodings;
411 let max_decoding_message_size = self.max_decoding_message_size;
412 let max_encoding_message_size = self.max_encoding_message_size;
413 let inner = self.inner.clone();
414 let fut = async move {
415 let method = GetSyncingSvc(inner);
416 let codec = tonic::codec::ProstCodec::default();
417 let mut grpc = tonic::server::Grpc::new(codec)
418 .apply_compression_config(
419 accept_compression_encodings,
420 send_compression_encodings,
421 )
422 .apply_max_message_size_config(
423 max_decoding_message_size,
424 max_encoding_message_size,
425 );
426 let res = grpc.unary(method, req).await;
427 Ok(res)
428 };
429 Box::pin(fut)
430 }
431 "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock" => {
432 #[allow(non_camel_case_types)]
433 struct GetLatestBlockSvc<T: Service>(pub Arc<T>);
434 impl<T: Service> tonic::server::UnaryService<super::GetLatestBlockRequest>
435 for GetLatestBlockSvc<T>
436 {
437 type Response = super::GetLatestBlockResponse;
438 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
439 fn call(
440 &mut self,
441 request: tonic::Request<super::GetLatestBlockRequest>,
442 ) -> Self::Future {
443 let inner = Arc::clone(&self.0);
444 let fut = async move {
445 <T as Service>::get_latest_block(&inner, request).await
446 };
447 Box::pin(fut)
448 }
449 }
450 let accept_compression_encodings = self.accept_compression_encodings;
451 let send_compression_encodings = self.send_compression_encodings;
452 let max_decoding_message_size = self.max_decoding_message_size;
453 let max_encoding_message_size = self.max_encoding_message_size;
454 let inner = self.inner.clone();
455 let fut = async move {
456 let method = GetLatestBlockSvc(inner);
457 let codec = tonic::codec::ProstCodec::default();
458 let mut grpc = tonic::server::Grpc::new(codec)
459 .apply_compression_config(
460 accept_compression_encodings,
461 send_compression_encodings,
462 )
463 .apply_max_message_size_config(
464 max_decoding_message_size,
465 max_encoding_message_size,
466 );
467 let res = grpc.unary(method, req).await;
468 Ok(res)
469 };
470 Box::pin(fut)
471 }
472 "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight" => {
473 #[allow(non_camel_case_types)]
474 struct GetBlockByHeightSvc<T: Service>(pub Arc<T>);
475 impl<T: Service> tonic::server::UnaryService<super::GetBlockByHeightRequest>
476 for GetBlockByHeightSvc<T>
477 {
478 type Response = super::GetBlockByHeightResponse;
479 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
480 fn call(
481 &mut self,
482 request: tonic::Request<super::GetBlockByHeightRequest>,
483 ) -> Self::Future {
484 let inner = Arc::clone(&self.0);
485 let fut = async move {
486 <T as Service>::get_block_by_height(&inner, request).await
487 };
488 Box::pin(fut)
489 }
490 }
491 let accept_compression_encodings = self.accept_compression_encodings;
492 let send_compression_encodings = self.send_compression_encodings;
493 let max_decoding_message_size = self.max_decoding_message_size;
494 let max_encoding_message_size = self.max_encoding_message_size;
495 let inner = self.inner.clone();
496 let fut = async move {
497 let method = GetBlockByHeightSvc(inner);
498 let codec = tonic::codec::ProstCodec::default();
499 let mut grpc = tonic::server::Grpc::new(codec)
500 .apply_compression_config(
501 accept_compression_encodings,
502 send_compression_encodings,
503 )
504 .apply_max_message_size_config(
505 max_decoding_message_size,
506 max_encoding_message_size,
507 );
508 let res = grpc.unary(method, req).await;
509 Ok(res)
510 };
511 Box::pin(fut)
512 }
513 "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet" => {
514 #[allow(non_camel_case_types)]
515 struct GetLatestValidatorSetSvc<T: Service>(pub Arc<T>);
516 impl<T: Service>
517 tonic::server::UnaryService<super::GetLatestValidatorSetRequest>
518 for GetLatestValidatorSetSvc<T>
519 {
520 type Response = super::GetLatestValidatorSetResponse;
521 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
522 fn call(
523 &mut self,
524 request: tonic::Request<super::GetLatestValidatorSetRequest>,
525 ) -> Self::Future {
526 let inner = Arc::clone(&self.0);
527 let fut = async move {
528 <T as Service>::get_latest_validator_set(&inner, request).await
529 };
530 Box::pin(fut)
531 }
532 }
533 let accept_compression_encodings = self.accept_compression_encodings;
534 let send_compression_encodings = self.send_compression_encodings;
535 let max_decoding_message_size = self.max_decoding_message_size;
536 let max_encoding_message_size = self.max_encoding_message_size;
537 let inner = self.inner.clone();
538 let fut = async move {
539 let method = GetLatestValidatorSetSvc(inner);
540 let codec = tonic::codec::ProstCodec::default();
541 let mut grpc = tonic::server::Grpc::new(codec)
542 .apply_compression_config(
543 accept_compression_encodings,
544 send_compression_encodings,
545 )
546 .apply_max_message_size_config(
547 max_decoding_message_size,
548 max_encoding_message_size,
549 );
550 let res = grpc.unary(method, req).await;
551 Ok(res)
552 };
553 Box::pin(fut)
554 }
555 "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight" => {
556 #[allow(non_camel_case_types)]
557 struct GetValidatorSetByHeightSvc<T: Service>(pub Arc<T>);
558 impl<T: Service>
559 tonic::server::UnaryService<super::GetValidatorSetByHeightRequest>
560 for GetValidatorSetByHeightSvc<T>
561 {
562 type Response = super::GetValidatorSetByHeightResponse;
563 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
564 fn call(
565 &mut self,
566 request: tonic::Request<super::GetValidatorSetByHeightRequest>,
567 ) -> Self::Future {
568 let inner = Arc::clone(&self.0);
569 let fut = async move {
570 <T as Service>::get_validator_set_by_height(&inner, request).await
571 };
572 Box::pin(fut)
573 }
574 }
575 let accept_compression_encodings = self.accept_compression_encodings;
576 let send_compression_encodings = self.send_compression_encodings;
577 let max_decoding_message_size = self.max_decoding_message_size;
578 let max_encoding_message_size = self.max_encoding_message_size;
579 let inner = self.inner.clone();
580 let fut = async move {
581 let method = GetValidatorSetByHeightSvc(inner);
582 let codec = tonic::codec::ProstCodec::default();
583 let mut grpc = tonic::server::Grpc::new(codec)
584 .apply_compression_config(
585 accept_compression_encodings,
586 send_compression_encodings,
587 )
588 .apply_max_message_size_config(
589 max_decoding_message_size,
590 max_encoding_message_size,
591 );
592 let res = grpc.unary(method, req).await;
593 Ok(res)
594 };
595 Box::pin(fut)
596 }
597 "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery" => {
598 #[allow(non_camel_case_types)]
599 struct ABCIQuerySvc<T: Service>(pub Arc<T>);
600 impl<T: Service> tonic::server::UnaryService<super::AbciQueryRequest> for ABCIQuerySvc<T> {
601 type Response = super::AbciQueryResponse;
602 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
603 fn call(
604 &mut self,
605 request: tonic::Request<super::AbciQueryRequest>,
606 ) -> Self::Future {
607 let inner = Arc::clone(&self.0);
608 let fut =
609 async move { <T as Service>::abci_query(&inner, request).await };
610 Box::pin(fut)
611 }
612 }
613 let accept_compression_encodings = self.accept_compression_encodings;
614 let send_compression_encodings = self.send_compression_encodings;
615 let max_decoding_message_size = self.max_decoding_message_size;
616 let max_encoding_message_size = self.max_encoding_message_size;
617 let inner = self.inner.clone();
618 let fut = async move {
619 let method = ABCIQuerySvc(inner);
620 let codec = tonic::codec::ProstCodec::default();
621 let mut grpc = tonic::server::Grpc::new(codec)
622 .apply_compression_config(
623 accept_compression_encodings,
624 send_compression_encodings,
625 )
626 .apply_max_message_size_config(
627 max_decoding_message_size,
628 max_encoding_message_size,
629 );
630 let res = grpc.unary(method, req).await;
631 Ok(res)
632 };
633 Box::pin(fut)
634 }
635 _ => Box::pin(async move {
636 let mut response = http::Response::new(tonic::body::Body::default());
637 let headers = response.headers_mut();
638 headers.insert(
639 tonic::Status::GRPC_STATUS,
640 (tonic::Code::Unimplemented as i32).into(),
641 );
642 headers.insert(
643 http::header::CONTENT_TYPE,
644 tonic::metadata::GRPC_CONTENT_TYPE,
645 );
646 Ok(response)
647 }),
648 }
649 }
650 }
651 impl<T> Clone for ServiceServer<T> {
652 fn clone(&self) -> Self {
653 let inner = self.inner.clone();
654 Self {
655 inner,
656 accept_compression_encodings: self.accept_compression_encodings,
657 send_compression_encodings: self.send_compression_encodings,
658 max_decoding_message_size: self.max_decoding_message_size,
659 max_encoding_message_size: self.max_encoding_message_size,
660 }
661 }
662 }
663 pub const SERVICE_NAME: &str = "cosmos.base.tendermint.v1beta1.Service";
665 impl<T> tonic::server::NamedService for ServiceServer<T> {
666 const NAME: &'static str = SERVICE_NAME;
667 }
668}