1#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct NonVerifiableKeyValueRequest {
6 #[prost(message, optional, tag = "1")]
7 pub key: ::core::option::Option<non_verifiable_key_value_request::Key>,
8}
9pub mod non_verifiable_key_value_request {
11 #[derive(Clone, PartialEq, ::prost::Message)]
12 pub struct Key {
13 #[prost(bytes = "vec", tag = "1")]
14 pub inner: ::prost::alloc::vec::Vec<u8>,
15 }
16 impl ::prost::Name for Key {
17 const NAME: &'static str = "Key";
18 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
19 fn full_name() -> ::prost::alloc::string::String {
20 "penumbra.cnidarium.v1.NonVerifiableKeyValueRequest.Key".into()
21 }
22 fn type_url() -> ::prost::alloc::string::String {
23 "/penumbra.cnidarium.v1.NonVerifiableKeyValueRequest.Key".into()
24 }
25 }
26}
27impl ::prost::Name for NonVerifiableKeyValueRequest {
28 const NAME: &'static str = "NonVerifiableKeyValueRequest";
29 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
30 fn full_name() -> ::prost::alloc::string::String {
31 "penumbra.cnidarium.v1.NonVerifiableKeyValueRequest".into()
32 }
33 fn type_url() -> ::prost::alloc::string::String {
34 "/penumbra.cnidarium.v1.NonVerifiableKeyValueRequest".into()
35 }
36}
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct NonVerifiableKeyValueResponse {
39 #[prost(message, optional, tag = "1")]
41 pub value: ::core::option::Option<non_verifiable_key_value_response::Value>,
42}
43pub mod non_verifiable_key_value_response {
45 #[derive(Clone, PartialEq, ::prost::Message)]
46 pub struct Value {
47 #[prost(bytes = "vec", tag = "1")]
48 pub value: ::prost::alloc::vec::Vec<u8>,
49 }
50 impl ::prost::Name for Value {
51 const NAME: &'static str = "Value";
52 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
53 fn full_name() -> ::prost::alloc::string::String {
54 "penumbra.cnidarium.v1.NonVerifiableKeyValueResponse.Value".into()
55 }
56 fn type_url() -> ::prost::alloc::string::String {
57 "/penumbra.cnidarium.v1.NonVerifiableKeyValueResponse.Value".into()
58 }
59 }
60}
61impl ::prost::Name for NonVerifiableKeyValueResponse {
62 const NAME: &'static str = "NonVerifiableKeyValueResponse";
63 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
64 fn full_name() -> ::prost::alloc::string::String {
65 "penumbra.cnidarium.v1.NonVerifiableKeyValueResponse".into()
66 }
67 fn type_url() -> ::prost::alloc::string::String {
68 "/penumbra.cnidarium.v1.NonVerifiableKeyValueResponse".into()
69 }
70}
71#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct KeyValueRequest {
76 #[prost(string, tag = "2")]
78 pub key: ::prost::alloc::string::String,
79 #[prost(bool, tag = "3")]
81 pub proof: bool,
82}
83impl ::prost::Name for KeyValueRequest {
84 const NAME: &'static str = "KeyValueRequest";
85 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
86 fn full_name() -> ::prost::alloc::string::String {
87 "penumbra.cnidarium.v1.KeyValueRequest".into()
88 }
89 fn type_url() -> ::prost::alloc::string::String {
90 "/penumbra.cnidarium.v1.KeyValueRequest".into()
91 }
92}
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct KeyValueResponse {
95 #[prost(message, optional, tag = "1")]
97 pub value: ::core::option::Option<key_value_response::Value>,
98 #[prost(message, optional, tag = "2")]
100 pub proof: ::core::option::Option<
101 ::ibc_proto::ibc::core::commitment::v1::MerkleProof,
102 >,
103}
104pub mod key_value_response {
106 #[derive(Clone, PartialEq, ::prost::Message)]
107 pub struct Value {
108 #[prost(bytes = "vec", tag = "1")]
109 pub value: ::prost::alloc::vec::Vec<u8>,
110 }
111 impl ::prost::Name for Value {
112 const NAME: &'static str = "Value";
113 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
114 fn full_name() -> ::prost::alloc::string::String {
115 "penumbra.cnidarium.v1.KeyValueResponse.Value".into()
116 }
117 fn type_url() -> ::prost::alloc::string::String {
118 "/penumbra.cnidarium.v1.KeyValueResponse.Value".into()
119 }
120 }
121}
122impl ::prost::Name for KeyValueResponse {
123 const NAME: &'static str = "KeyValueResponse";
124 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
125 fn full_name() -> ::prost::alloc::string::String {
126 "penumbra.cnidarium.v1.KeyValueResponse".into()
127 }
128 fn type_url() -> ::prost::alloc::string::String {
129 "/penumbra.cnidarium.v1.KeyValueResponse".into()
130 }
131}
132#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct PrefixValueRequest {
135 #[prost(string, tag = "2")]
137 pub prefix: ::prost::alloc::string::String,
138}
139impl ::prost::Name for PrefixValueRequest {
140 const NAME: &'static str = "PrefixValueRequest";
141 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
142 fn full_name() -> ::prost::alloc::string::String {
143 "penumbra.cnidarium.v1.PrefixValueRequest".into()
144 }
145 fn type_url() -> ::prost::alloc::string::String {
146 "/penumbra.cnidarium.v1.PrefixValueRequest".into()
147 }
148}
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct PrefixValueResponse {
151 #[prost(string, tag = "1")]
152 pub key: ::prost::alloc::string::String,
153 #[prost(bytes = "vec", tag = "2")]
154 pub value: ::prost::alloc::vec::Vec<u8>,
155}
156impl ::prost::Name for PrefixValueResponse {
157 const NAME: &'static str = "PrefixValueResponse";
158 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
159 fn full_name() -> ::prost::alloc::string::String {
160 "penumbra.cnidarium.v1.PrefixValueResponse".into()
161 }
162 fn type_url() -> ::prost::alloc::string::String {
163 "/penumbra.cnidarium.v1.PrefixValueResponse".into()
164 }
165}
166#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct WatchRequest {
169 #[prost(string, tag = "1")]
175 pub key_regex: ::prost::alloc::string::String,
176 #[prost(string, tag = "2")]
182 pub nv_key_regex: ::prost::alloc::string::String,
183}
184impl ::prost::Name for WatchRequest {
185 const NAME: &'static str = "WatchRequest";
186 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
187 fn full_name() -> ::prost::alloc::string::String {
188 "penumbra.cnidarium.v1.WatchRequest".into()
189 }
190 fn type_url() -> ::prost::alloc::string::String {
191 "/penumbra.cnidarium.v1.WatchRequest".into()
192 }
193}
194#[derive(Clone, PartialEq, ::prost::Message)]
196pub struct WatchResponse {
197 #[prost(uint64, tag = "1")]
199 pub version: u64,
200 #[prost(oneof = "watch_response::Entry", tags = "5, 6")]
202 pub entry: ::core::option::Option<watch_response::Entry>,
203}
204pub mod watch_response {
206 #[derive(Clone, PartialEq, ::prost::Message)]
208 pub struct KeyValue {
209 #[prost(string, tag = "1")]
210 pub key: ::prost::alloc::string::String,
211 #[prost(bytes = "vec", tag = "2")]
212 pub value: ::prost::alloc::vec::Vec<u8>,
213 #[prost(bool, tag = "3")]
216 pub deleted: bool,
217 }
218 impl ::prost::Name for KeyValue {
219 const NAME: &'static str = "KeyValue";
220 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
221 fn full_name() -> ::prost::alloc::string::String {
222 "penumbra.cnidarium.v1.WatchResponse.KeyValue".into()
223 }
224 fn type_url() -> ::prost::alloc::string::String {
225 "/penumbra.cnidarium.v1.WatchResponse.KeyValue".into()
226 }
227 }
228 #[derive(Clone, PartialEq, ::prost::Message)]
230 pub struct NvKeyValue {
231 #[prost(bytes = "vec", tag = "1")]
232 pub key: ::prost::alloc::vec::Vec<u8>,
233 #[prost(bytes = "vec", tag = "2")]
234 pub value: ::prost::alloc::vec::Vec<u8>,
235 #[prost(bool, tag = "3")]
238 pub deleted: bool,
239 }
240 impl ::prost::Name for NvKeyValue {
241 const NAME: &'static str = "NvKeyValue";
242 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
243 fn full_name() -> ::prost::alloc::string::String {
244 "penumbra.cnidarium.v1.WatchResponse.NvKeyValue".into()
245 }
246 fn type_url() -> ::prost::alloc::string::String {
247 "/penumbra.cnidarium.v1.WatchResponse.NvKeyValue".into()
248 }
249 }
250 #[derive(Clone, PartialEq, ::prost::Oneof)]
252 pub enum Entry {
253 #[prost(message, tag = "5")]
254 Kv(KeyValue),
255 #[prost(message, tag = "6")]
256 NvKv(NvKeyValue),
257 }
258}
259impl ::prost::Name for WatchResponse {
260 const NAME: &'static str = "WatchResponse";
261 const PACKAGE: &'static str = "penumbra.cnidarium.v1";
262 fn full_name() -> ::prost::alloc::string::String {
263 "penumbra.cnidarium.v1.WatchResponse".into()
264 }
265 fn type_url() -> ::prost::alloc::string::String {
266 "/penumbra.cnidarium.v1.WatchResponse".into()
267 }
268}
269#[cfg(feature = "rpc")]
271pub mod query_service_client {
272 #![allow(
273 unused_variables,
274 dead_code,
275 missing_docs,
276 clippy::wildcard_imports,
277 clippy::let_unit_value,
278 )]
279 use tonic::codegen::*;
280 use tonic::codegen::http::Uri;
281 #[derive(Debug, Clone)]
282 pub struct QueryServiceClient<T> {
283 inner: tonic::client::Grpc<T>,
284 }
285 impl QueryServiceClient<tonic::transport::Channel> {
286 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
288 where
289 D: TryInto<tonic::transport::Endpoint>,
290 D::Error: Into<StdError>,
291 {
292 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
293 Ok(Self::new(conn))
294 }
295 }
296 impl<T> QueryServiceClient<T>
297 where
298 T: tonic::client::GrpcService<tonic::body::BoxBody>,
299 T::Error: Into<StdError>,
300 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
301 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
302 {
303 pub fn new(inner: T) -> Self {
304 let inner = tonic::client::Grpc::new(inner);
305 Self { inner }
306 }
307 pub fn with_origin(inner: T, origin: Uri) -> Self {
308 let inner = tonic::client::Grpc::with_origin(inner, origin);
309 Self { inner }
310 }
311 pub fn with_interceptor<F>(
312 inner: T,
313 interceptor: F,
314 ) -> QueryServiceClient<InterceptedService<T, F>>
315 where
316 F: tonic::service::Interceptor,
317 T::ResponseBody: Default,
318 T: tonic::codegen::Service<
319 http::Request<tonic::body::BoxBody>,
320 Response = http::Response<
321 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
322 >,
323 >,
324 <T as tonic::codegen::Service<
325 http::Request<tonic::body::BoxBody>,
326 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
327 {
328 QueryServiceClient::new(InterceptedService::new(inner, interceptor))
329 }
330 #[must_use]
335 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
336 self.inner = self.inner.send_compressed(encoding);
337 self
338 }
339 #[must_use]
341 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
342 self.inner = self.inner.accept_compressed(encoding);
343 self
344 }
345 #[must_use]
349 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
350 self.inner = self.inner.max_decoding_message_size(limit);
351 self
352 }
353 #[must_use]
357 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
358 self.inner = self.inner.max_encoding_message_size(limit);
359 self
360 }
361 pub async fn key_value(
364 &mut self,
365 request: impl tonic::IntoRequest<super::KeyValueRequest>,
366 ) -> std::result::Result<
367 tonic::Response<super::KeyValueResponse>,
368 tonic::Status,
369 > {
370 self.inner
371 .ready()
372 .await
373 .map_err(|e| {
374 tonic::Status::unknown(
375 format!("Service was not ready: {}", e.into()),
376 )
377 })?;
378 let codec = tonic::codec::ProstCodec::default();
379 let path = http::uri::PathAndQuery::from_static(
380 "/penumbra.cnidarium.v1.QueryService/KeyValue",
381 );
382 let mut req = request.into_request();
383 req.extensions_mut()
384 .insert(
385 GrpcMethod::new("penumbra.cnidarium.v1.QueryService", "KeyValue"),
386 );
387 self.inner.unary(req, path, codec).await
388 }
389 pub async fn non_verifiable_key_value(
392 &mut self,
393 request: impl tonic::IntoRequest<super::NonVerifiableKeyValueRequest>,
394 ) -> std::result::Result<
395 tonic::Response<super::NonVerifiableKeyValueResponse>,
396 tonic::Status,
397 > {
398 self.inner
399 .ready()
400 .await
401 .map_err(|e| {
402 tonic::Status::unknown(
403 format!("Service was not ready: {}", e.into()),
404 )
405 })?;
406 let codec = tonic::codec::ProstCodec::default();
407 let path = http::uri::PathAndQuery::from_static(
408 "/penumbra.cnidarium.v1.QueryService/NonVerifiableKeyValue",
409 );
410 let mut req = request.into_request();
411 req.extensions_mut()
412 .insert(
413 GrpcMethod::new(
414 "penumbra.cnidarium.v1.QueryService",
415 "NonVerifiableKeyValue",
416 ),
417 );
418 self.inner.unary(req, path, codec).await
419 }
420 pub async fn prefix_value(
423 &mut self,
424 request: impl tonic::IntoRequest<super::PrefixValueRequest>,
425 ) -> std::result::Result<
426 tonic::Response<tonic::codec::Streaming<super::PrefixValueResponse>>,
427 tonic::Status,
428 > {
429 self.inner
430 .ready()
431 .await
432 .map_err(|e| {
433 tonic::Status::unknown(
434 format!("Service was not ready: {}", e.into()),
435 )
436 })?;
437 let codec = tonic::codec::ProstCodec::default();
438 let path = http::uri::PathAndQuery::from_static(
439 "/penumbra.cnidarium.v1.QueryService/PrefixValue",
440 );
441 let mut req = request.into_request();
442 req.extensions_mut()
443 .insert(
444 GrpcMethod::new("penumbra.cnidarium.v1.QueryService", "PrefixValue"),
445 );
446 self.inner.server_streaming(req, path, codec).await
447 }
448 pub async fn watch(
450 &mut self,
451 request: impl tonic::IntoRequest<super::WatchRequest>,
452 ) -> std::result::Result<
453 tonic::Response<tonic::codec::Streaming<super::WatchResponse>>,
454 tonic::Status,
455 > {
456 self.inner
457 .ready()
458 .await
459 .map_err(|e| {
460 tonic::Status::unknown(
461 format!("Service was not ready: {}", e.into()),
462 )
463 })?;
464 let codec = tonic::codec::ProstCodec::default();
465 let path = http::uri::PathAndQuery::from_static(
466 "/penumbra.cnidarium.v1.QueryService/Watch",
467 );
468 let mut req = request.into_request();
469 req.extensions_mut()
470 .insert(GrpcMethod::new("penumbra.cnidarium.v1.QueryService", "Watch"));
471 self.inner.server_streaming(req, path, codec).await
472 }
473 }
474}
475#[cfg(feature = "rpc")]
477pub mod query_service_server {
478 #![allow(
479 unused_variables,
480 dead_code,
481 missing_docs,
482 clippy::wildcard_imports,
483 clippy::let_unit_value,
484 )]
485 use tonic::codegen::*;
486 #[async_trait]
488 pub trait QueryService: std::marker::Send + std::marker::Sync + 'static {
489 async fn key_value(
492 &self,
493 request: tonic::Request<super::KeyValueRequest>,
494 ) -> std::result::Result<
495 tonic::Response<super::KeyValueResponse>,
496 tonic::Status,
497 >;
498 async fn non_verifiable_key_value(
501 &self,
502 request: tonic::Request<super::NonVerifiableKeyValueRequest>,
503 ) -> std::result::Result<
504 tonic::Response<super::NonVerifiableKeyValueResponse>,
505 tonic::Status,
506 >;
507 type PrefixValueStream: tonic::codegen::tokio_stream::Stream<
509 Item = std::result::Result<super::PrefixValueResponse, tonic::Status>,
510 >
511 + std::marker::Send
512 + 'static;
513 async fn prefix_value(
516 &self,
517 request: tonic::Request<super::PrefixValueRequest>,
518 ) -> std::result::Result<
519 tonic::Response<Self::PrefixValueStream>,
520 tonic::Status,
521 >;
522 type WatchStream: tonic::codegen::tokio_stream::Stream<
524 Item = std::result::Result<super::WatchResponse, tonic::Status>,
525 >
526 + std::marker::Send
527 + 'static;
528 async fn watch(
530 &self,
531 request: tonic::Request<super::WatchRequest>,
532 ) -> std::result::Result<tonic::Response<Self::WatchStream>, tonic::Status>;
533 }
534 #[derive(Debug)]
535 pub struct QueryServiceServer<T> {
536 inner: Arc<T>,
537 accept_compression_encodings: EnabledCompressionEncodings,
538 send_compression_encodings: EnabledCompressionEncodings,
539 max_decoding_message_size: Option<usize>,
540 max_encoding_message_size: Option<usize>,
541 }
542 impl<T> QueryServiceServer<T> {
543 pub fn new(inner: T) -> Self {
544 Self::from_arc(Arc::new(inner))
545 }
546 pub fn from_arc(inner: Arc<T>) -> Self {
547 Self {
548 inner,
549 accept_compression_encodings: Default::default(),
550 send_compression_encodings: Default::default(),
551 max_decoding_message_size: None,
552 max_encoding_message_size: None,
553 }
554 }
555 pub fn with_interceptor<F>(
556 inner: T,
557 interceptor: F,
558 ) -> InterceptedService<Self, F>
559 where
560 F: tonic::service::Interceptor,
561 {
562 InterceptedService::new(Self::new(inner), interceptor)
563 }
564 #[must_use]
566 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
567 self.accept_compression_encodings.enable(encoding);
568 self
569 }
570 #[must_use]
572 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
573 self.send_compression_encodings.enable(encoding);
574 self
575 }
576 #[must_use]
580 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
581 self.max_decoding_message_size = Some(limit);
582 self
583 }
584 #[must_use]
588 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
589 self.max_encoding_message_size = Some(limit);
590 self
591 }
592 }
593 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServiceServer<T>
594 where
595 T: QueryService,
596 B: Body + std::marker::Send + 'static,
597 B::Error: Into<StdError> + std::marker::Send + 'static,
598 {
599 type Response = http::Response<tonic::body::BoxBody>;
600 type Error = std::convert::Infallible;
601 type Future = BoxFuture<Self::Response, Self::Error>;
602 fn poll_ready(
603 &mut self,
604 _cx: &mut Context<'_>,
605 ) -> Poll<std::result::Result<(), Self::Error>> {
606 Poll::Ready(Ok(()))
607 }
608 fn call(&mut self, req: http::Request<B>) -> Self::Future {
609 match req.uri().path() {
610 "/penumbra.cnidarium.v1.QueryService/KeyValue" => {
611 #[allow(non_camel_case_types)]
612 struct KeyValueSvc<T: QueryService>(pub Arc<T>);
613 impl<
614 T: QueryService,
615 > tonic::server::UnaryService<super::KeyValueRequest>
616 for KeyValueSvc<T> {
617 type Response = super::KeyValueResponse;
618 type Future = BoxFuture<
619 tonic::Response<Self::Response>,
620 tonic::Status,
621 >;
622 fn call(
623 &mut self,
624 request: tonic::Request<super::KeyValueRequest>,
625 ) -> Self::Future {
626 let inner = Arc::clone(&self.0);
627 let fut = async move {
628 <T as QueryService>::key_value(&inner, request).await
629 };
630 Box::pin(fut)
631 }
632 }
633 let accept_compression_encodings = self.accept_compression_encodings;
634 let send_compression_encodings = self.send_compression_encodings;
635 let max_decoding_message_size = self.max_decoding_message_size;
636 let max_encoding_message_size = self.max_encoding_message_size;
637 let inner = self.inner.clone();
638 let fut = async move {
639 let method = KeyValueSvc(inner);
640 let codec = tonic::codec::ProstCodec::default();
641 let mut grpc = tonic::server::Grpc::new(codec)
642 .apply_compression_config(
643 accept_compression_encodings,
644 send_compression_encodings,
645 )
646 .apply_max_message_size_config(
647 max_decoding_message_size,
648 max_encoding_message_size,
649 );
650 let res = grpc.unary(method, req).await;
651 Ok(res)
652 };
653 Box::pin(fut)
654 }
655 "/penumbra.cnidarium.v1.QueryService/NonVerifiableKeyValue" => {
656 #[allow(non_camel_case_types)]
657 struct NonVerifiableKeyValueSvc<T: QueryService>(pub Arc<T>);
658 impl<
659 T: QueryService,
660 > tonic::server::UnaryService<super::NonVerifiableKeyValueRequest>
661 for NonVerifiableKeyValueSvc<T> {
662 type Response = super::NonVerifiableKeyValueResponse;
663 type Future = BoxFuture<
664 tonic::Response<Self::Response>,
665 tonic::Status,
666 >;
667 fn call(
668 &mut self,
669 request: tonic::Request<super::NonVerifiableKeyValueRequest>,
670 ) -> Self::Future {
671 let inner = Arc::clone(&self.0);
672 let fut = async move {
673 <T as QueryService>::non_verifiable_key_value(
674 &inner,
675 request,
676 )
677 .await
678 };
679 Box::pin(fut)
680 }
681 }
682 let accept_compression_encodings = self.accept_compression_encodings;
683 let send_compression_encodings = self.send_compression_encodings;
684 let max_decoding_message_size = self.max_decoding_message_size;
685 let max_encoding_message_size = self.max_encoding_message_size;
686 let inner = self.inner.clone();
687 let fut = async move {
688 let method = NonVerifiableKeyValueSvc(inner);
689 let codec = tonic::codec::ProstCodec::default();
690 let mut grpc = tonic::server::Grpc::new(codec)
691 .apply_compression_config(
692 accept_compression_encodings,
693 send_compression_encodings,
694 )
695 .apply_max_message_size_config(
696 max_decoding_message_size,
697 max_encoding_message_size,
698 );
699 let res = grpc.unary(method, req).await;
700 Ok(res)
701 };
702 Box::pin(fut)
703 }
704 "/penumbra.cnidarium.v1.QueryService/PrefixValue" => {
705 #[allow(non_camel_case_types)]
706 struct PrefixValueSvc<T: QueryService>(pub Arc<T>);
707 impl<
708 T: QueryService,
709 > tonic::server::ServerStreamingService<super::PrefixValueRequest>
710 for PrefixValueSvc<T> {
711 type Response = super::PrefixValueResponse;
712 type ResponseStream = T::PrefixValueStream;
713 type Future = BoxFuture<
714 tonic::Response<Self::ResponseStream>,
715 tonic::Status,
716 >;
717 fn call(
718 &mut self,
719 request: tonic::Request<super::PrefixValueRequest>,
720 ) -> Self::Future {
721 let inner = Arc::clone(&self.0);
722 let fut = async move {
723 <T as QueryService>::prefix_value(&inner, request).await
724 };
725 Box::pin(fut)
726 }
727 }
728 let accept_compression_encodings = self.accept_compression_encodings;
729 let send_compression_encodings = self.send_compression_encodings;
730 let max_decoding_message_size = self.max_decoding_message_size;
731 let max_encoding_message_size = self.max_encoding_message_size;
732 let inner = self.inner.clone();
733 let fut = async move {
734 let method = PrefixValueSvc(inner);
735 let codec = tonic::codec::ProstCodec::default();
736 let mut grpc = tonic::server::Grpc::new(codec)
737 .apply_compression_config(
738 accept_compression_encodings,
739 send_compression_encodings,
740 )
741 .apply_max_message_size_config(
742 max_decoding_message_size,
743 max_encoding_message_size,
744 );
745 let res = grpc.server_streaming(method, req).await;
746 Ok(res)
747 };
748 Box::pin(fut)
749 }
750 "/penumbra.cnidarium.v1.QueryService/Watch" => {
751 #[allow(non_camel_case_types)]
752 struct WatchSvc<T: QueryService>(pub Arc<T>);
753 impl<
754 T: QueryService,
755 > tonic::server::ServerStreamingService<super::WatchRequest>
756 for WatchSvc<T> {
757 type Response = super::WatchResponse;
758 type ResponseStream = T::WatchStream;
759 type Future = BoxFuture<
760 tonic::Response<Self::ResponseStream>,
761 tonic::Status,
762 >;
763 fn call(
764 &mut self,
765 request: tonic::Request<super::WatchRequest>,
766 ) -> Self::Future {
767 let inner = Arc::clone(&self.0);
768 let fut = async move {
769 <T as QueryService>::watch(&inner, request).await
770 };
771 Box::pin(fut)
772 }
773 }
774 let accept_compression_encodings = self.accept_compression_encodings;
775 let send_compression_encodings = self.send_compression_encodings;
776 let max_decoding_message_size = self.max_decoding_message_size;
777 let max_encoding_message_size = self.max_encoding_message_size;
778 let inner = self.inner.clone();
779 let fut = async move {
780 let method = WatchSvc(inner);
781 let codec = tonic::codec::ProstCodec::default();
782 let mut grpc = tonic::server::Grpc::new(codec)
783 .apply_compression_config(
784 accept_compression_encodings,
785 send_compression_encodings,
786 )
787 .apply_max_message_size_config(
788 max_decoding_message_size,
789 max_encoding_message_size,
790 );
791 let res = grpc.server_streaming(method, req).await;
792 Ok(res)
793 };
794 Box::pin(fut)
795 }
796 _ => {
797 Box::pin(async move {
798 let mut response = http::Response::new(empty_body());
799 let headers = response.headers_mut();
800 headers
801 .insert(
802 tonic::Status::GRPC_STATUS,
803 (tonic::Code::Unimplemented as i32).into(),
804 );
805 headers
806 .insert(
807 http::header::CONTENT_TYPE,
808 tonic::metadata::GRPC_CONTENT_TYPE,
809 );
810 Ok(response)
811 })
812 }
813 }
814 }
815 }
816 impl<T> Clone for QueryServiceServer<T> {
817 fn clone(&self) -> Self {
818 let inner = self.inner.clone();
819 Self {
820 inner,
821 accept_compression_encodings: self.accept_compression_encodings,
822 send_compression_encodings: self.send_compression_encodings,
823 max_decoding_message_size: self.max_decoding_message_size,
824 max_encoding_message_size: self.max_encoding_message_size,
825 }
826 }
827 }
828 pub const SERVICE_NAME: &str = "penumbra.cnidarium.v1.QueryService";
830 impl<T> tonic::server::NamedService for QueryServiceServer<T> {
831 const NAME: &'static str = SERVICE_NAME;
832 }
833}