miden_node_proto/generated/
store.rs

1// This file is @generated by prost-build.
2/// Generated client implementations.
3pub mod api_client {
4    #![allow(
5        unused_variables,
6        dead_code,
7        missing_docs,
8        clippy::wildcard_imports,
9        clippy::let_unit_value,
10    )]
11    use tonic::codegen::*;
12    use tonic::codegen::http::Uri;
13    #[derive(Debug, Clone)]
14    pub struct ApiClient<T> {
15        inner: tonic::client::Grpc<T>,
16    }
17    impl ApiClient<tonic::transport::Channel> {
18        /// Attempt to create a new client by connecting to a given endpoint.
19        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
20        where
21            D: TryInto<tonic::transport::Endpoint>,
22            D::Error: Into<StdError>,
23        {
24            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
25            Ok(Self::new(conn))
26        }
27    }
28    impl<T> ApiClient<T>
29    where
30        T: tonic::client::GrpcService<tonic::body::BoxBody>,
31        T::Error: Into<StdError>,
32        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
33        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
34    {
35        pub fn new(inner: T) -> Self {
36            let inner = tonic::client::Grpc::new(inner);
37            Self { inner }
38        }
39        pub fn with_origin(inner: T, origin: Uri) -> Self {
40            let inner = tonic::client::Grpc::with_origin(inner, origin);
41            Self { inner }
42        }
43        pub fn with_interceptor<F>(
44            inner: T,
45            interceptor: F,
46        ) -> ApiClient<InterceptedService<T, F>>
47        where
48            F: tonic::service::Interceptor,
49            T::ResponseBody: Default,
50            T: tonic::codegen::Service<
51                http::Request<tonic::body::BoxBody>,
52                Response = http::Response<
53                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
54                >,
55            >,
56            <T as tonic::codegen::Service<
57                http::Request<tonic::body::BoxBody>,
58            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
59        {
60            ApiClient::new(InterceptedService::new(inner, interceptor))
61        }
62        /// Compress requests with the given encoding.
63        ///
64        /// This requires the server to support it otherwise it might respond with an
65        /// error.
66        #[must_use]
67        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
68            self.inner = self.inner.send_compressed(encoding);
69            self
70        }
71        /// Enable decompressing responses.
72        #[must_use]
73        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
74            self.inner = self.inner.accept_compressed(encoding);
75            self
76        }
77        /// Limits the maximum size of a decoded message.
78        ///
79        /// Default: `4MB`
80        #[must_use]
81        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
82            self.inner = self.inner.max_decoding_message_size(limit);
83            self
84        }
85        /// Limits the maximum size of an encoded message.
86        ///
87        /// Default: `usize::MAX`
88        #[must_use]
89        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
90            self.inner = self.inner.max_encoding_message_size(limit);
91            self
92        }
93        /// Applies changes of a new block to the DB and in-memory data structures.
94        pub async fn apply_block(
95            &mut self,
96            request: impl tonic::IntoRequest<super::super::requests::ApplyBlockRequest>,
97        ) -> std::result::Result<
98            tonic::Response<super::super::responses::ApplyBlockResponse>,
99            tonic::Status,
100        > {
101            self.inner
102                .ready()
103                .await
104                .map_err(|e| {
105                    tonic::Status::unknown(
106                        format!("Service was not ready: {}", e.into()),
107                    )
108                })?;
109            let codec = tonic::codec::ProstCodec::default();
110            let path = http::uri::PathAndQuery::from_static("/store.Api/ApplyBlock");
111            let mut req = request.into_request();
112            req.extensions_mut().insert(GrpcMethod::new("store.Api", "ApplyBlock"));
113            self.inner.unary(req, path, codec).await
114        }
115        /// Returns a nullifier proof for each of the requested nullifiers.
116        pub async fn check_nullifiers(
117            &mut self,
118            request: impl tonic::IntoRequest<
119                super::super::requests::CheckNullifiersRequest,
120            >,
121        ) -> std::result::Result<
122            tonic::Response<super::super::responses::CheckNullifiersResponse>,
123            tonic::Status,
124        > {
125            self.inner
126                .ready()
127                .await
128                .map_err(|e| {
129                    tonic::Status::unknown(
130                        format!("Service was not ready: {}", e.into()),
131                    )
132                })?;
133            let codec = tonic::codec::ProstCodec::default();
134            let path = http::uri::PathAndQuery::from_static(
135                "/store.Api/CheckNullifiers",
136            );
137            let mut req = request.into_request();
138            req.extensions_mut().insert(GrpcMethod::new("store.Api", "CheckNullifiers"));
139            self.inner.unary(req, path, codec).await
140        }
141        /// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
142        ///
143        /// Note that only 16-bit prefixes are supported at this time.
144        pub async fn check_nullifiers_by_prefix(
145            &mut self,
146            request: impl tonic::IntoRequest<
147                super::super::requests::CheckNullifiersByPrefixRequest,
148            >,
149        ) -> std::result::Result<
150            tonic::Response<super::super::responses::CheckNullifiersByPrefixResponse>,
151            tonic::Status,
152        > {
153            self.inner
154                .ready()
155                .await
156                .map_err(|e| {
157                    tonic::Status::unknown(
158                        format!("Service was not ready: {}", e.into()),
159                    )
160                })?;
161            let codec = tonic::codec::ProstCodec::default();
162            let path = http::uri::PathAndQuery::from_static(
163                "/store.Api/CheckNullifiersByPrefix",
164            );
165            let mut req = request.into_request();
166            req.extensions_mut()
167                .insert(GrpcMethod::new("store.Api", "CheckNullifiersByPrefix"));
168            self.inner.unary(req, path, codec).await
169        }
170        /// Returns the latest state of an account with the specified ID.
171        pub async fn get_account_details(
172            &mut self,
173            request: impl tonic::IntoRequest<
174                super::super::requests::GetAccountDetailsRequest,
175            >,
176        ) -> std::result::Result<
177            tonic::Response<super::super::responses::GetAccountDetailsResponse>,
178            tonic::Status,
179        > {
180            self.inner
181                .ready()
182                .await
183                .map_err(|e| {
184                    tonic::Status::unknown(
185                        format!("Service was not ready: {}", e.into()),
186                    )
187                })?;
188            let codec = tonic::codec::ProstCodec::default();
189            let path = http::uri::PathAndQuery::from_static(
190                "/store.Api/GetAccountDetails",
191            );
192            let mut req = request.into_request();
193            req.extensions_mut()
194                .insert(GrpcMethod::new("store.Api", "GetAccountDetails"));
195            self.inner.unary(req, path, codec).await
196        }
197        /// Returns the latest state proofs of the specified accounts.
198        pub async fn get_account_proofs(
199            &mut self,
200            request: impl tonic::IntoRequest<
201                super::super::requests::GetAccountProofsRequest,
202            >,
203        ) -> std::result::Result<
204            tonic::Response<super::super::responses::GetAccountProofsResponse>,
205            tonic::Status,
206        > {
207            self.inner
208                .ready()
209                .await
210                .map_err(|e| {
211                    tonic::Status::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(
217                "/store.Api/GetAccountProofs",
218            );
219            let mut req = request.into_request();
220            req.extensions_mut()
221                .insert(GrpcMethod::new("store.Api", "GetAccountProofs"));
222            self.inner.unary(req, path, codec).await
223        }
224        /// Returns delta of the account states in the range from `from_block_num` (exclusive) to
225        /// `to_block_num` (inclusive).
226        pub async fn get_account_state_delta(
227            &mut self,
228            request: impl tonic::IntoRequest<
229                super::super::requests::GetAccountStateDeltaRequest,
230            >,
231        ) -> std::result::Result<
232            tonic::Response<super::super::responses::GetAccountStateDeltaResponse>,
233            tonic::Status,
234        > {
235            self.inner
236                .ready()
237                .await
238                .map_err(|e| {
239                    tonic::Status::unknown(
240                        format!("Service was not ready: {}", e.into()),
241                    )
242                })?;
243            let codec = tonic::codec::ProstCodec::default();
244            let path = http::uri::PathAndQuery::from_static(
245                "/store.Api/GetAccountStateDelta",
246            );
247            let mut req = request.into_request();
248            req.extensions_mut()
249                .insert(GrpcMethod::new("store.Api", "GetAccountStateDelta"));
250            self.inner.unary(req, path, codec).await
251        }
252        /// Returns raw block data for the specified block number.
253        pub async fn get_block_by_number(
254            &mut self,
255            request: impl tonic::IntoRequest<
256                super::super::requests::GetBlockByNumberRequest,
257            >,
258        ) -> std::result::Result<
259            tonic::Response<super::super::responses::GetBlockByNumberResponse>,
260            tonic::Status,
261        > {
262            self.inner
263                .ready()
264                .await
265                .map_err(|e| {
266                    tonic::Status::unknown(
267                        format!("Service was not ready: {}", e.into()),
268                    )
269                })?;
270            let codec = tonic::codec::ProstCodec::default();
271            let path = http::uri::PathAndQuery::from_static(
272                "/store.Api/GetBlockByNumber",
273            );
274            let mut req = request.into_request();
275            req.extensions_mut()
276                .insert(GrpcMethod::new("store.Api", "GetBlockByNumber"));
277            self.inner.unary(req, path, codec).await
278        }
279        /// Retrieves block header by given block number. Optionally, it also returns the MMR path
280        /// and current chain length to authenticate the block's inclusion.
281        pub async fn get_block_header_by_number(
282            &mut self,
283            request: impl tonic::IntoRequest<
284                super::super::requests::GetBlockHeaderByNumberRequest,
285            >,
286        ) -> std::result::Result<
287            tonic::Response<super::super::responses::GetBlockHeaderByNumberResponse>,
288            tonic::Status,
289        > {
290            self.inner
291                .ready()
292                .await
293                .map_err(|e| {
294                    tonic::Status::unknown(
295                        format!("Service was not ready: {}", e.into()),
296                    )
297                })?;
298            let codec = tonic::codec::ProstCodec::default();
299            let path = http::uri::PathAndQuery::from_static(
300                "/store.Api/GetBlockHeaderByNumber",
301            );
302            let mut req = request.into_request();
303            req.extensions_mut()
304                .insert(GrpcMethod::new("store.Api", "GetBlockHeaderByNumber"));
305            self.inner.unary(req, path, codec).await
306        }
307        /// Returns data required to prove the next block.
308        pub async fn get_block_inputs(
309            &mut self,
310            request: impl tonic::IntoRequest<
311                super::super::requests::GetBlockInputsRequest,
312            >,
313        ) -> std::result::Result<
314            tonic::Response<super::super::responses::GetBlockInputsResponse>,
315            tonic::Status,
316        > {
317            self.inner
318                .ready()
319                .await
320                .map_err(|e| {
321                    tonic::Status::unknown(
322                        format!("Service was not ready: {}", e.into()),
323                    )
324                })?;
325            let codec = tonic::codec::ProstCodec::default();
326            let path = http::uri::PathAndQuery::from_static("/store.Api/GetBlockInputs");
327            let mut req = request.into_request();
328            req.extensions_mut().insert(GrpcMethod::new("store.Api", "GetBlockInputs"));
329            self.inner.unary(req, path, codec).await
330        }
331        /// Returns a list of Note inclusion proofs for the specified Note IDs.
332        pub async fn get_note_authentication_info(
333            &mut self,
334            request: impl tonic::IntoRequest<
335                super::super::requests::GetNoteAuthenticationInfoRequest,
336            >,
337        ) -> std::result::Result<
338            tonic::Response<super::super::responses::GetNoteAuthenticationInfoResponse>,
339            tonic::Status,
340        > {
341            self.inner
342                .ready()
343                .await
344                .map_err(|e| {
345                    tonic::Status::unknown(
346                        format!("Service was not ready: {}", e.into()),
347                    )
348                })?;
349            let codec = tonic::codec::ProstCodec::default();
350            let path = http::uri::PathAndQuery::from_static(
351                "/store.Api/GetNoteAuthenticationInfo",
352            );
353            let mut req = request.into_request();
354            req.extensions_mut()
355                .insert(GrpcMethod::new("store.Api", "GetNoteAuthenticationInfo"));
356            self.inner.unary(req, path, codec).await
357        }
358        /// Returns a list of notes matching the provided note IDs.
359        pub async fn get_notes_by_id(
360            &mut self,
361            request: impl tonic::IntoRequest<super::super::requests::GetNotesByIdRequest>,
362        ) -> std::result::Result<
363            tonic::Response<super::super::responses::GetNotesByIdResponse>,
364            tonic::Status,
365        > {
366            self.inner
367                .ready()
368                .await
369                .map_err(|e| {
370                    tonic::Status::unknown(
371                        format!("Service was not ready: {}", e.into()),
372                    )
373                })?;
374            let codec = tonic::codec::ProstCodec::default();
375            let path = http::uri::PathAndQuery::from_static("/store.Api/GetNotesById");
376            let mut req = request.into_request();
377            req.extensions_mut().insert(GrpcMethod::new("store.Api", "GetNotesById"));
378            self.inner.unary(req, path, codec).await
379        }
380        /// Returns data required to validate a new transaction.
381        pub async fn get_transaction_inputs(
382            &mut self,
383            request: impl tonic::IntoRequest<
384                super::super::requests::GetTransactionInputsRequest,
385            >,
386        ) -> std::result::Result<
387            tonic::Response<super::super::responses::GetTransactionInputsResponse>,
388            tonic::Status,
389        > {
390            self.inner
391                .ready()
392                .await
393                .map_err(|e| {
394                    tonic::Status::unknown(
395                        format!("Service was not ready: {}", e.into()),
396                    )
397                })?;
398            let codec = tonic::codec::ProstCodec::default();
399            let path = http::uri::PathAndQuery::from_static(
400                "/store.Api/GetTransactionInputs",
401            );
402            let mut req = request.into_request();
403            req.extensions_mut()
404                .insert(GrpcMethod::new("store.Api", "GetTransactionInputs"));
405            self.inner.unary(req, path, codec).await
406        }
407        /// Returns info which can be used by the client to sync up to the tip of chain for the notes they are interested in.
408        ///
409        /// Client specifies the `note_tags` they are interested in, and the block height from which to search for new for
410        /// matching notes for. The request will then return the next block containing any note matching the provided tags.
411        ///
412        /// The response includes each note's metadata and inclusion proof.
413        ///
414        /// A basic note sync can be implemented by repeatedly requesting the previous response's block until reaching the
415        /// tip of the chain.
416        pub async fn sync_notes(
417            &mut self,
418            request: impl tonic::IntoRequest<super::super::requests::SyncNoteRequest>,
419        ) -> std::result::Result<
420            tonic::Response<super::super::responses::SyncNoteResponse>,
421            tonic::Status,
422        > {
423            self.inner
424                .ready()
425                .await
426                .map_err(|e| {
427                    tonic::Status::unknown(
428                        format!("Service was not ready: {}", e.into()),
429                    )
430                })?;
431            let codec = tonic::codec::ProstCodec::default();
432            let path = http::uri::PathAndQuery::from_static("/store.Api/SyncNotes");
433            let mut req = request.into_request();
434            req.extensions_mut().insert(GrpcMethod::new("store.Api", "SyncNotes"));
435            self.inner.unary(req, path, codec).await
436        }
437        /// Returns info which can be used by the client to sync up to the latest state of the chain
438        /// for the objects (accounts, notes, nullifiers) the client is interested in.
439        ///
440        /// This request returns the next block containing requested data. It also returns `chain_tip`
441        /// which is the latest block number in the chain. Client is expected to repeat these requests
442        /// in a loop until `response.block_header.block_num == response.chain_tip`, at which point
443        /// the client is fully synchronized with the chain.
444        ///
445        /// Each request also returns info about new notes, nullifiers etc. created. It also returns
446        /// Chain MMR delta that can be used to update the state of Chain MMR. This includes both chain
447        /// MMR peaks and chain MMR nodes.
448        ///
449        /// For preserving some degree of privacy, note tags and nullifiers filters contain only high
450        /// part of hashes. Thus, returned data contains excessive notes and nullifiers, client can make
451        /// additional filtering of that data on its side.
452        pub async fn sync_state(
453            &mut self,
454            request: impl tonic::IntoRequest<super::super::requests::SyncStateRequest>,
455        ) -> std::result::Result<
456            tonic::Response<super::super::responses::SyncStateResponse>,
457            tonic::Status,
458        > {
459            self.inner
460                .ready()
461                .await
462                .map_err(|e| {
463                    tonic::Status::unknown(
464                        format!("Service was not ready: {}", e.into()),
465                    )
466                })?;
467            let codec = tonic::codec::ProstCodec::default();
468            let path = http::uri::PathAndQuery::from_static("/store.Api/SyncState");
469            let mut req = request.into_request();
470            req.extensions_mut().insert(GrpcMethod::new("store.Api", "SyncState"));
471            self.inner.unary(req, path, codec).await
472        }
473    }
474}
475/// Generated server implementations.
476pub mod api_server {
477    #![allow(
478        unused_variables,
479        dead_code,
480        missing_docs,
481        clippy::wildcard_imports,
482        clippy::let_unit_value,
483    )]
484    use tonic::codegen::*;
485    /// Generated trait containing gRPC methods that should be implemented for use with ApiServer.
486    #[async_trait]
487    pub trait Api: std::marker::Send + std::marker::Sync + 'static {
488        /// Applies changes of a new block to the DB and in-memory data structures.
489        async fn apply_block(
490            &self,
491            request: tonic::Request<super::super::requests::ApplyBlockRequest>,
492        ) -> std::result::Result<
493            tonic::Response<super::super::responses::ApplyBlockResponse>,
494            tonic::Status,
495        >;
496        /// Returns a nullifier proof for each of the requested nullifiers.
497        async fn check_nullifiers(
498            &self,
499            request: tonic::Request<super::super::requests::CheckNullifiersRequest>,
500        ) -> std::result::Result<
501            tonic::Response<super::super::responses::CheckNullifiersResponse>,
502            tonic::Status,
503        >;
504        /// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
505        ///
506        /// Note that only 16-bit prefixes are supported at this time.
507        async fn check_nullifiers_by_prefix(
508            &self,
509            request: tonic::Request<
510                super::super::requests::CheckNullifiersByPrefixRequest,
511            >,
512        ) -> std::result::Result<
513            tonic::Response<super::super::responses::CheckNullifiersByPrefixResponse>,
514            tonic::Status,
515        >;
516        /// Returns the latest state of an account with the specified ID.
517        async fn get_account_details(
518            &self,
519            request: tonic::Request<super::super::requests::GetAccountDetailsRequest>,
520        ) -> std::result::Result<
521            tonic::Response<super::super::responses::GetAccountDetailsResponse>,
522            tonic::Status,
523        >;
524        /// Returns the latest state proofs of the specified accounts.
525        async fn get_account_proofs(
526            &self,
527            request: tonic::Request<super::super::requests::GetAccountProofsRequest>,
528        ) -> std::result::Result<
529            tonic::Response<super::super::responses::GetAccountProofsResponse>,
530            tonic::Status,
531        >;
532        /// Returns delta of the account states in the range from `from_block_num` (exclusive) to
533        /// `to_block_num` (inclusive).
534        async fn get_account_state_delta(
535            &self,
536            request: tonic::Request<super::super::requests::GetAccountStateDeltaRequest>,
537        ) -> std::result::Result<
538            tonic::Response<super::super::responses::GetAccountStateDeltaResponse>,
539            tonic::Status,
540        >;
541        /// Returns raw block data for the specified block number.
542        async fn get_block_by_number(
543            &self,
544            request: tonic::Request<super::super::requests::GetBlockByNumberRequest>,
545        ) -> std::result::Result<
546            tonic::Response<super::super::responses::GetBlockByNumberResponse>,
547            tonic::Status,
548        >;
549        /// Retrieves block header by given block number. Optionally, it also returns the MMR path
550        /// and current chain length to authenticate the block's inclusion.
551        async fn get_block_header_by_number(
552            &self,
553            request: tonic::Request<
554                super::super::requests::GetBlockHeaderByNumberRequest,
555            >,
556        ) -> std::result::Result<
557            tonic::Response<super::super::responses::GetBlockHeaderByNumberResponse>,
558            tonic::Status,
559        >;
560        /// Returns data required to prove the next block.
561        async fn get_block_inputs(
562            &self,
563            request: tonic::Request<super::super::requests::GetBlockInputsRequest>,
564        ) -> std::result::Result<
565            tonic::Response<super::super::responses::GetBlockInputsResponse>,
566            tonic::Status,
567        >;
568        /// Returns a list of Note inclusion proofs for the specified Note IDs.
569        async fn get_note_authentication_info(
570            &self,
571            request: tonic::Request<
572                super::super::requests::GetNoteAuthenticationInfoRequest,
573            >,
574        ) -> std::result::Result<
575            tonic::Response<super::super::responses::GetNoteAuthenticationInfoResponse>,
576            tonic::Status,
577        >;
578        /// Returns a list of notes matching the provided note IDs.
579        async fn get_notes_by_id(
580            &self,
581            request: tonic::Request<super::super::requests::GetNotesByIdRequest>,
582        ) -> std::result::Result<
583            tonic::Response<super::super::responses::GetNotesByIdResponse>,
584            tonic::Status,
585        >;
586        /// Returns data required to validate a new transaction.
587        async fn get_transaction_inputs(
588            &self,
589            request: tonic::Request<super::super::requests::GetTransactionInputsRequest>,
590        ) -> std::result::Result<
591            tonic::Response<super::super::responses::GetTransactionInputsResponse>,
592            tonic::Status,
593        >;
594        /// Returns info which can be used by the client to sync up to the tip of chain for the notes they are interested in.
595        ///
596        /// Client specifies the `note_tags` they are interested in, and the block height from which to search for new for
597        /// matching notes for. The request will then return the next block containing any note matching the provided tags.
598        ///
599        /// The response includes each note's metadata and inclusion proof.
600        ///
601        /// A basic note sync can be implemented by repeatedly requesting the previous response's block until reaching the
602        /// tip of the chain.
603        async fn sync_notes(
604            &self,
605            request: tonic::Request<super::super::requests::SyncNoteRequest>,
606        ) -> std::result::Result<
607            tonic::Response<super::super::responses::SyncNoteResponse>,
608            tonic::Status,
609        >;
610        /// Returns info which can be used by the client to sync up to the latest state of the chain
611        /// for the objects (accounts, notes, nullifiers) the client is interested in.
612        ///
613        /// This request returns the next block containing requested data. It also returns `chain_tip`
614        /// which is the latest block number in the chain. Client is expected to repeat these requests
615        /// in a loop until `response.block_header.block_num == response.chain_tip`, at which point
616        /// the client is fully synchronized with the chain.
617        ///
618        /// Each request also returns info about new notes, nullifiers etc. created. It also returns
619        /// Chain MMR delta that can be used to update the state of Chain MMR. This includes both chain
620        /// MMR peaks and chain MMR nodes.
621        ///
622        /// For preserving some degree of privacy, note tags and nullifiers filters contain only high
623        /// part of hashes. Thus, returned data contains excessive notes and nullifiers, client can make
624        /// additional filtering of that data on its side.
625        async fn sync_state(
626            &self,
627            request: tonic::Request<super::super::requests::SyncStateRequest>,
628        ) -> std::result::Result<
629            tonic::Response<super::super::responses::SyncStateResponse>,
630            tonic::Status,
631        >;
632    }
633    #[derive(Debug)]
634    pub struct ApiServer<T> {
635        inner: Arc<T>,
636        accept_compression_encodings: EnabledCompressionEncodings,
637        send_compression_encodings: EnabledCompressionEncodings,
638        max_decoding_message_size: Option<usize>,
639        max_encoding_message_size: Option<usize>,
640    }
641    impl<T> ApiServer<T> {
642        pub fn new(inner: T) -> Self {
643            Self::from_arc(Arc::new(inner))
644        }
645        pub fn from_arc(inner: Arc<T>) -> Self {
646            Self {
647                inner,
648                accept_compression_encodings: Default::default(),
649                send_compression_encodings: Default::default(),
650                max_decoding_message_size: None,
651                max_encoding_message_size: None,
652            }
653        }
654        pub fn with_interceptor<F>(
655            inner: T,
656            interceptor: F,
657        ) -> InterceptedService<Self, F>
658        where
659            F: tonic::service::Interceptor,
660        {
661            InterceptedService::new(Self::new(inner), interceptor)
662        }
663        /// Enable decompressing requests with the given encoding.
664        #[must_use]
665        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
666            self.accept_compression_encodings.enable(encoding);
667            self
668        }
669        /// Compress responses with the given encoding, if the client supports it.
670        #[must_use]
671        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
672            self.send_compression_encodings.enable(encoding);
673            self
674        }
675        /// Limits the maximum size of a decoded message.
676        ///
677        /// Default: `4MB`
678        #[must_use]
679        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
680            self.max_decoding_message_size = Some(limit);
681            self
682        }
683        /// Limits the maximum size of an encoded message.
684        ///
685        /// Default: `usize::MAX`
686        #[must_use]
687        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
688            self.max_encoding_message_size = Some(limit);
689            self
690        }
691    }
692    impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiServer<T>
693    where
694        T: Api,
695        B: Body + std::marker::Send + 'static,
696        B::Error: Into<StdError> + std::marker::Send + 'static,
697    {
698        type Response = http::Response<tonic::body::BoxBody>;
699        type Error = std::convert::Infallible;
700        type Future = BoxFuture<Self::Response, Self::Error>;
701        fn poll_ready(
702            &mut self,
703            _cx: &mut Context<'_>,
704        ) -> Poll<std::result::Result<(), Self::Error>> {
705            Poll::Ready(Ok(()))
706        }
707        fn call(&mut self, req: http::Request<B>) -> Self::Future {
708            match req.uri().path() {
709                "/store.Api/ApplyBlock" => {
710                    #[allow(non_camel_case_types)]
711                    struct ApplyBlockSvc<T: Api>(pub Arc<T>);
712                    impl<
713                        T: Api,
714                    > tonic::server::UnaryService<
715                        super::super::requests::ApplyBlockRequest,
716                    > for ApplyBlockSvc<T> {
717                        type Response = super::super::responses::ApplyBlockResponse;
718                        type Future = BoxFuture<
719                            tonic::Response<Self::Response>,
720                            tonic::Status,
721                        >;
722                        fn call(
723                            &mut self,
724                            request: tonic::Request<
725                                super::super::requests::ApplyBlockRequest,
726                            >,
727                        ) -> Self::Future {
728                            let inner = Arc::clone(&self.0);
729                            let fut = async move {
730                                <T as Api>::apply_block(&inner, request).await
731                            };
732                            Box::pin(fut)
733                        }
734                    }
735                    let accept_compression_encodings = self.accept_compression_encodings;
736                    let send_compression_encodings = self.send_compression_encodings;
737                    let max_decoding_message_size = self.max_decoding_message_size;
738                    let max_encoding_message_size = self.max_encoding_message_size;
739                    let inner = self.inner.clone();
740                    let fut = async move {
741                        let method = ApplyBlockSvc(inner);
742                        let codec = tonic::codec::ProstCodec::default();
743                        let mut grpc = tonic::server::Grpc::new(codec)
744                            .apply_compression_config(
745                                accept_compression_encodings,
746                                send_compression_encodings,
747                            )
748                            .apply_max_message_size_config(
749                                max_decoding_message_size,
750                                max_encoding_message_size,
751                            );
752                        let res = grpc.unary(method, req).await;
753                        Ok(res)
754                    };
755                    Box::pin(fut)
756                }
757                "/store.Api/CheckNullifiers" => {
758                    #[allow(non_camel_case_types)]
759                    struct CheckNullifiersSvc<T: Api>(pub Arc<T>);
760                    impl<
761                        T: Api,
762                    > tonic::server::UnaryService<
763                        super::super::requests::CheckNullifiersRequest,
764                    > for CheckNullifiersSvc<T> {
765                        type Response = super::super::responses::CheckNullifiersResponse;
766                        type Future = BoxFuture<
767                            tonic::Response<Self::Response>,
768                            tonic::Status,
769                        >;
770                        fn call(
771                            &mut self,
772                            request: tonic::Request<
773                                super::super::requests::CheckNullifiersRequest,
774                            >,
775                        ) -> Self::Future {
776                            let inner = Arc::clone(&self.0);
777                            let fut = async move {
778                                <T as Api>::check_nullifiers(&inner, request).await
779                            };
780                            Box::pin(fut)
781                        }
782                    }
783                    let accept_compression_encodings = self.accept_compression_encodings;
784                    let send_compression_encodings = self.send_compression_encodings;
785                    let max_decoding_message_size = self.max_decoding_message_size;
786                    let max_encoding_message_size = self.max_encoding_message_size;
787                    let inner = self.inner.clone();
788                    let fut = async move {
789                        let method = CheckNullifiersSvc(inner);
790                        let codec = tonic::codec::ProstCodec::default();
791                        let mut grpc = tonic::server::Grpc::new(codec)
792                            .apply_compression_config(
793                                accept_compression_encodings,
794                                send_compression_encodings,
795                            )
796                            .apply_max_message_size_config(
797                                max_decoding_message_size,
798                                max_encoding_message_size,
799                            );
800                        let res = grpc.unary(method, req).await;
801                        Ok(res)
802                    };
803                    Box::pin(fut)
804                }
805                "/store.Api/CheckNullifiersByPrefix" => {
806                    #[allow(non_camel_case_types)]
807                    struct CheckNullifiersByPrefixSvc<T: Api>(pub Arc<T>);
808                    impl<
809                        T: Api,
810                    > tonic::server::UnaryService<
811                        super::super::requests::CheckNullifiersByPrefixRequest,
812                    > for CheckNullifiersByPrefixSvc<T> {
813                        type Response = super::super::responses::CheckNullifiersByPrefixResponse;
814                        type Future = BoxFuture<
815                            tonic::Response<Self::Response>,
816                            tonic::Status,
817                        >;
818                        fn call(
819                            &mut self,
820                            request: tonic::Request<
821                                super::super::requests::CheckNullifiersByPrefixRequest,
822                            >,
823                        ) -> Self::Future {
824                            let inner = Arc::clone(&self.0);
825                            let fut = async move {
826                                <T as Api>::check_nullifiers_by_prefix(&inner, request)
827                                    .await
828                            };
829                            Box::pin(fut)
830                        }
831                    }
832                    let accept_compression_encodings = self.accept_compression_encodings;
833                    let send_compression_encodings = self.send_compression_encodings;
834                    let max_decoding_message_size = self.max_decoding_message_size;
835                    let max_encoding_message_size = self.max_encoding_message_size;
836                    let inner = self.inner.clone();
837                    let fut = async move {
838                        let method = CheckNullifiersByPrefixSvc(inner);
839                        let codec = tonic::codec::ProstCodec::default();
840                        let mut grpc = tonic::server::Grpc::new(codec)
841                            .apply_compression_config(
842                                accept_compression_encodings,
843                                send_compression_encodings,
844                            )
845                            .apply_max_message_size_config(
846                                max_decoding_message_size,
847                                max_encoding_message_size,
848                            );
849                        let res = grpc.unary(method, req).await;
850                        Ok(res)
851                    };
852                    Box::pin(fut)
853                }
854                "/store.Api/GetAccountDetails" => {
855                    #[allow(non_camel_case_types)]
856                    struct GetAccountDetailsSvc<T: Api>(pub Arc<T>);
857                    impl<
858                        T: Api,
859                    > tonic::server::UnaryService<
860                        super::super::requests::GetAccountDetailsRequest,
861                    > for GetAccountDetailsSvc<T> {
862                        type Response = super::super::responses::GetAccountDetailsResponse;
863                        type Future = BoxFuture<
864                            tonic::Response<Self::Response>,
865                            tonic::Status,
866                        >;
867                        fn call(
868                            &mut self,
869                            request: tonic::Request<
870                                super::super::requests::GetAccountDetailsRequest,
871                            >,
872                        ) -> Self::Future {
873                            let inner = Arc::clone(&self.0);
874                            let fut = async move {
875                                <T as Api>::get_account_details(&inner, request).await
876                            };
877                            Box::pin(fut)
878                        }
879                    }
880                    let accept_compression_encodings = self.accept_compression_encodings;
881                    let send_compression_encodings = self.send_compression_encodings;
882                    let max_decoding_message_size = self.max_decoding_message_size;
883                    let max_encoding_message_size = self.max_encoding_message_size;
884                    let inner = self.inner.clone();
885                    let fut = async move {
886                        let method = GetAccountDetailsSvc(inner);
887                        let codec = tonic::codec::ProstCodec::default();
888                        let mut grpc = tonic::server::Grpc::new(codec)
889                            .apply_compression_config(
890                                accept_compression_encodings,
891                                send_compression_encodings,
892                            )
893                            .apply_max_message_size_config(
894                                max_decoding_message_size,
895                                max_encoding_message_size,
896                            );
897                        let res = grpc.unary(method, req).await;
898                        Ok(res)
899                    };
900                    Box::pin(fut)
901                }
902                "/store.Api/GetAccountProofs" => {
903                    #[allow(non_camel_case_types)]
904                    struct GetAccountProofsSvc<T: Api>(pub Arc<T>);
905                    impl<
906                        T: Api,
907                    > tonic::server::UnaryService<
908                        super::super::requests::GetAccountProofsRequest,
909                    > for GetAccountProofsSvc<T> {
910                        type Response = super::super::responses::GetAccountProofsResponse;
911                        type Future = BoxFuture<
912                            tonic::Response<Self::Response>,
913                            tonic::Status,
914                        >;
915                        fn call(
916                            &mut self,
917                            request: tonic::Request<
918                                super::super::requests::GetAccountProofsRequest,
919                            >,
920                        ) -> Self::Future {
921                            let inner = Arc::clone(&self.0);
922                            let fut = async move {
923                                <T as Api>::get_account_proofs(&inner, request).await
924                            };
925                            Box::pin(fut)
926                        }
927                    }
928                    let accept_compression_encodings = self.accept_compression_encodings;
929                    let send_compression_encodings = self.send_compression_encodings;
930                    let max_decoding_message_size = self.max_decoding_message_size;
931                    let max_encoding_message_size = self.max_encoding_message_size;
932                    let inner = self.inner.clone();
933                    let fut = async move {
934                        let method = GetAccountProofsSvc(inner);
935                        let codec = tonic::codec::ProstCodec::default();
936                        let mut grpc = tonic::server::Grpc::new(codec)
937                            .apply_compression_config(
938                                accept_compression_encodings,
939                                send_compression_encodings,
940                            )
941                            .apply_max_message_size_config(
942                                max_decoding_message_size,
943                                max_encoding_message_size,
944                            );
945                        let res = grpc.unary(method, req).await;
946                        Ok(res)
947                    };
948                    Box::pin(fut)
949                }
950                "/store.Api/GetAccountStateDelta" => {
951                    #[allow(non_camel_case_types)]
952                    struct GetAccountStateDeltaSvc<T: Api>(pub Arc<T>);
953                    impl<
954                        T: Api,
955                    > tonic::server::UnaryService<
956                        super::super::requests::GetAccountStateDeltaRequest,
957                    > for GetAccountStateDeltaSvc<T> {
958                        type Response = super::super::responses::GetAccountStateDeltaResponse;
959                        type Future = BoxFuture<
960                            tonic::Response<Self::Response>,
961                            tonic::Status,
962                        >;
963                        fn call(
964                            &mut self,
965                            request: tonic::Request<
966                                super::super::requests::GetAccountStateDeltaRequest,
967                            >,
968                        ) -> Self::Future {
969                            let inner = Arc::clone(&self.0);
970                            let fut = async move {
971                                <T as Api>::get_account_state_delta(&inner, request).await
972                            };
973                            Box::pin(fut)
974                        }
975                    }
976                    let accept_compression_encodings = self.accept_compression_encodings;
977                    let send_compression_encodings = self.send_compression_encodings;
978                    let max_decoding_message_size = self.max_decoding_message_size;
979                    let max_encoding_message_size = self.max_encoding_message_size;
980                    let inner = self.inner.clone();
981                    let fut = async move {
982                        let method = GetAccountStateDeltaSvc(inner);
983                        let codec = tonic::codec::ProstCodec::default();
984                        let mut grpc = tonic::server::Grpc::new(codec)
985                            .apply_compression_config(
986                                accept_compression_encodings,
987                                send_compression_encodings,
988                            )
989                            .apply_max_message_size_config(
990                                max_decoding_message_size,
991                                max_encoding_message_size,
992                            );
993                        let res = grpc.unary(method, req).await;
994                        Ok(res)
995                    };
996                    Box::pin(fut)
997                }
998                "/store.Api/GetBlockByNumber" => {
999                    #[allow(non_camel_case_types)]
1000                    struct GetBlockByNumberSvc<T: Api>(pub Arc<T>);
1001                    impl<
1002                        T: Api,
1003                    > tonic::server::UnaryService<
1004                        super::super::requests::GetBlockByNumberRequest,
1005                    > for GetBlockByNumberSvc<T> {
1006                        type Response = super::super::responses::GetBlockByNumberResponse;
1007                        type Future = BoxFuture<
1008                            tonic::Response<Self::Response>,
1009                            tonic::Status,
1010                        >;
1011                        fn call(
1012                            &mut self,
1013                            request: tonic::Request<
1014                                super::super::requests::GetBlockByNumberRequest,
1015                            >,
1016                        ) -> Self::Future {
1017                            let inner = Arc::clone(&self.0);
1018                            let fut = async move {
1019                                <T as Api>::get_block_by_number(&inner, request).await
1020                            };
1021                            Box::pin(fut)
1022                        }
1023                    }
1024                    let accept_compression_encodings = self.accept_compression_encodings;
1025                    let send_compression_encodings = self.send_compression_encodings;
1026                    let max_decoding_message_size = self.max_decoding_message_size;
1027                    let max_encoding_message_size = self.max_encoding_message_size;
1028                    let inner = self.inner.clone();
1029                    let fut = async move {
1030                        let method = GetBlockByNumberSvc(inner);
1031                        let codec = tonic::codec::ProstCodec::default();
1032                        let mut grpc = tonic::server::Grpc::new(codec)
1033                            .apply_compression_config(
1034                                accept_compression_encodings,
1035                                send_compression_encodings,
1036                            )
1037                            .apply_max_message_size_config(
1038                                max_decoding_message_size,
1039                                max_encoding_message_size,
1040                            );
1041                        let res = grpc.unary(method, req).await;
1042                        Ok(res)
1043                    };
1044                    Box::pin(fut)
1045                }
1046                "/store.Api/GetBlockHeaderByNumber" => {
1047                    #[allow(non_camel_case_types)]
1048                    struct GetBlockHeaderByNumberSvc<T: Api>(pub Arc<T>);
1049                    impl<
1050                        T: Api,
1051                    > tonic::server::UnaryService<
1052                        super::super::requests::GetBlockHeaderByNumberRequest,
1053                    > for GetBlockHeaderByNumberSvc<T> {
1054                        type Response = super::super::responses::GetBlockHeaderByNumberResponse;
1055                        type Future = BoxFuture<
1056                            tonic::Response<Self::Response>,
1057                            tonic::Status,
1058                        >;
1059                        fn call(
1060                            &mut self,
1061                            request: tonic::Request<
1062                                super::super::requests::GetBlockHeaderByNumberRequest,
1063                            >,
1064                        ) -> Self::Future {
1065                            let inner = Arc::clone(&self.0);
1066                            let fut = async move {
1067                                <T as Api>::get_block_header_by_number(&inner, request)
1068                                    .await
1069                            };
1070                            Box::pin(fut)
1071                        }
1072                    }
1073                    let accept_compression_encodings = self.accept_compression_encodings;
1074                    let send_compression_encodings = self.send_compression_encodings;
1075                    let max_decoding_message_size = self.max_decoding_message_size;
1076                    let max_encoding_message_size = self.max_encoding_message_size;
1077                    let inner = self.inner.clone();
1078                    let fut = async move {
1079                        let method = GetBlockHeaderByNumberSvc(inner);
1080                        let codec = tonic::codec::ProstCodec::default();
1081                        let mut grpc = tonic::server::Grpc::new(codec)
1082                            .apply_compression_config(
1083                                accept_compression_encodings,
1084                                send_compression_encodings,
1085                            )
1086                            .apply_max_message_size_config(
1087                                max_decoding_message_size,
1088                                max_encoding_message_size,
1089                            );
1090                        let res = grpc.unary(method, req).await;
1091                        Ok(res)
1092                    };
1093                    Box::pin(fut)
1094                }
1095                "/store.Api/GetBlockInputs" => {
1096                    #[allow(non_camel_case_types)]
1097                    struct GetBlockInputsSvc<T: Api>(pub Arc<T>);
1098                    impl<
1099                        T: Api,
1100                    > tonic::server::UnaryService<
1101                        super::super::requests::GetBlockInputsRequest,
1102                    > for GetBlockInputsSvc<T> {
1103                        type Response = super::super::responses::GetBlockInputsResponse;
1104                        type Future = BoxFuture<
1105                            tonic::Response<Self::Response>,
1106                            tonic::Status,
1107                        >;
1108                        fn call(
1109                            &mut self,
1110                            request: tonic::Request<
1111                                super::super::requests::GetBlockInputsRequest,
1112                            >,
1113                        ) -> Self::Future {
1114                            let inner = Arc::clone(&self.0);
1115                            let fut = async move {
1116                                <T as Api>::get_block_inputs(&inner, request).await
1117                            };
1118                            Box::pin(fut)
1119                        }
1120                    }
1121                    let accept_compression_encodings = self.accept_compression_encodings;
1122                    let send_compression_encodings = self.send_compression_encodings;
1123                    let max_decoding_message_size = self.max_decoding_message_size;
1124                    let max_encoding_message_size = self.max_encoding_message_size;
1125                    let inner = self.inner.clone();
1126                    let fut = async move {
1127                        let method = GetBlockInputsSvc(inner);
1128                        let codec = tonic::codec::ProstCodec::default();
1129                        let mut grpc = tonic::server::Grpc::new(codec)
1130                            .apply_compression_config(
1131                                accept_compression_encodings,
1132                                send_compression_encodings,
1133                            )
1134                            .apply_max_message_size_config(
1135                                max_decoding_message_size,
1136                                max_encoding_message_size,
1137                            );
1138                        let res = grpc.unary(method, req).await;
1139                        Ok(res)
1140                    };
1141                    Box::pin(fut)
1142                }
1143                "/store.Api/GetNoteAuthenticationInfo" => {
1144                    #[allow(non_camel_case_types)]
1145                    struct GetNoteAuthenticationInfoSvc<T: Api>(pub Arc<T>);
1146                    impl<
1147                        T: Api,
1148                    > tonic::server::UnaryService<
1149                        super::super::requests::GetNoteAuthenticationInfoRequest,
1150                    > for GetNoteAuthenticationInfoSvc<T> {
1151                        type Response = super::super::responses::GetNoteAuthenticationInfoResponse;
1152                        type Future = BoxFuture<
1153                            tonic::Response<Self::Response>,
1154                            tonic::Status,
1155                        >;
1156                        fn call(
1157                            &mut self,
1158                            request: tonic::Request<
1159                                super::super::requests::GetNoteAuthenticationInfoRequest,
1160                            >,
1161                        ) -> Self::Future {
1162                            let inner = Arc::clone(&self.0);
1163                            let fut = async move {
1164                                <T as Api>::get_note_authentication_info(&inner, request)
1165                                    .await
1166                            };
1167                            Box::pin(fut)
1168                        }
1169                    }
1170                    let accept_compression_encodings = self.accept_compression_encodings;
1171                    let send_compression_encodings = self.send_compression_encodings;
1172                    let max_decoding_message_size = self.max_decoding_message_size;
1173                    let max_encoding_message_size = self.max_encoding_message_size;
1174                    let inner = self.inner.clone();
1175                    let fut = async move {
1176                        let method = GetNoteAuthenticationInfoSvc(inner);
1177                        let codec = tonic::codec::ProstCodec::default();
1178                        let mut grpc = tonic::server::Grpc::new(codec)
1179                            .apply_compression_config(
1180                                accept_compression_encodings,
1181                                send_compression_encodings,
1182                            )
1183                            .apply_max_message_size_config(
1184                                max_decoding_message_size,
1185                                max_encoding_message_size,
1186                            );
1187                        let res = grpc.unary(method, req).await;
1188                        Ok(res)
1189                    };
1190                    Box::pin(fut)
1191                }
1192                "/store.Api/GetNotesById" => {
1193                    #[allow(non_camel_case_types)]
1194                    struct GetNotesByIdSvc<T: Api>(pub Arc<T>);
1195                    impl<
1196                        T: Api,
1197                    > tonic::server::UnaryService<
1198                        super::super::requests::GetNotesByIdRequest,
1199                    > for GetNotesByIdSvc<T> {
1200                        type Response = super::super::responses::GetNotesByIdResponse;
1201                        type Future = BoxFuture<
1202                            tonic::Response<Self::Response>,
1203                            tonic::Status,
1204                        >;
1205                        fn call(
1206                            &mut self,
1207                            request: tonic::Request<
1208                                super::super::requests::GetNotesByIdRequest,
1209                            >,
1210                        ) -> Self::Future {
1211                            let inner = Arc::clone(&self.0);
1212                            let fut = async move {
1213                                <T as Api>::get_notes_by_id(&inner, request).await
1214                            };
1215                            Box::pin(fut)
1216                        }
1217                    }
1218                    let accept_compression_encodings = self.accept_compression_encodings;
1219                    let send_compression_encodings = self.send_compression_encodings;
1220                    let max_decoding_message_size = self.max_decoding_message_size;
1221                    let max_encoding_message_size = self.max_encoding_message_size;
1222                    let inner = self.inner.clone();
1223                    let fut = async move {
1224                        let method = GetNotesByIdSvc(inner);
1225                        let codec = tonic::codec::ProstCodec::default();
1226                        let mut grpc = tonic::server::Grpc::new(codec)
1227                            .apply_compression_config(
1228                                accept_compression_encodings,
1229                                send_compression_encodings,
1230                            )
1231                            .apply_max_message_size_config(
1232                                max_decoding_message_size,
1233                                max_encoding_message_size,
1234                            );
1235                        let res = grpc.unary(method, req).await;
1236                        Ok(res)
1237                    };
1238                    Box::pin(fut)
1239                }
1240                "/store.Api/GetTransactionInputs" => {
1241                    #[allow(non_camel_case_types)]
1242                    struct GetTransactionInputsSvc<T: Api>(pub Arc<T>);
1243                    impl<
1244                        T: Api,
1245                    > tonic::server::UnaryService<
1246                        super::super::requests::GetTransactionInputsRequest,
1247                    > for GetTransactionInputsSvc<T> {
1248                        type Response = super::super::responses::GetTransactionInputsResponse;
1249                        type Future = BoxFuture<
1250                            tonic::Response<Self::Response>,
1251                            tonic::Status,
1252                        >;
1253                        fn call(
1254                            &mut self,
1255                            request: tonic::Request<
1256                                super::super::requests::GetTransactionInputsRequest,
1257                            >,
1258                        ) -> Self::Future {
1259                            let inner = Arc::clone(&self.0);
1260                            let fut = async move {
1261                                <T as Api>::get_transaction_inputs(&inner, request).await
1262                            };
1263                            Box::pin(fut)
1264                        }
1265                    }
1266                    let accept_compression_encodings = self.accept_compression_encodings;
1267                    let send_compression_encodings = self.send_compression_encodings;
1268                    let max_decoding_message_size = self.max_decoding_message_size;
1269                    let max_encoding_message_size = self.max_encoding_message_size;
1270                    let inner = self.inner.clone();
1271                    let fut = async move {
1272                        let method = GetTransactionInputsSvc(inner);
1273                        let codec = tonic::codec::ProstCodec::default();
1274                        let mut grpc = tonic::server::Grpc::new(codec)
1275                            .apply_compression_config(
1276                                accept_compression_encodings,
1277                                send_compression_encodings,
1278                            )
1279                            .apply_max_message_size_config(
1280                                max_decoding_message_size,
1281                                max_encoding_message_size,
1282                            );
1283                        let res = grpc.unary(method, req).await;
1284                        Ok(res)
1285                    };
1286                    Box::pin(fut)
1287                }
1288                "/store.Api/SyncNotes" => {
1289                    #[allow(non_camel_case_types)]
1290                    struct SyncNotesSvc<T: Api>(pub Arc<T>);
1291                    impl<
1292                        T: Api,
1293                    > tonic::server::UnaryService<
1294                        super::super::requests::SyncNoteRequest,
1295                    > for SyncNotesSvc<T> {
1296                        type Response = super::super::responses::SyncNoteResponse;
1297                        type Future = BoxFuture<
1298                            tonic::Response<Self::Response>,
1299                            tonic::Status,
1300                        >;
1301                        fn call(
1302                            &mut self,
1303                            request: tonic::Request<
1304                                super::super::requests::SyncNoteRequest,
1305                            >,
1306                        ) -> Self::Future {
1307                            let inner = Arc::clone(&self.0);
1308                            let fut = async move {
1309                                <T as Api>::sync_notes(&inner, request).await
1310                            };
1311                            Box::pin(fut)
1312                        }
1313                    }
1314                    let accept_compression_encodings = self.accept_compression_encodings;
1315                    let send_compression_encodings = self.send_compression_encodings;
1316                    let max_decoding_message_size = self.max_decoding_message_size;
1317                    let max_encoding_message_size = self.max_encoding_message_size;
1318                    let inner = self.inner.clone();
1319                    let fut = async move {
1320                        let method = SyncNotesSvc(inner);
1321                        let codec = tonic::codec::ProstCodec::default();
1322                        let mut grpc = tonic::server::Grpc::new(codec)
1323                            .apply_compression_config(
1324                                accept_compression_encodings,
1325                                send_compression_encodings,
1326                            )
1327                            .apply_max_message_size_config(
1328                                max_decoding_message_size,
1329                                max_encoding_message_size,
1330                            );
1331                        let res = grpc.unary(method, req).await;
1332                        Ok(res)
1333                    };
1334                    Box::pin(fut)
1335                }
1336                "/store.Api/SyncState" => {
1337                    #[allow(non_camel_case_types)]
1338                    struct SyncStateSvc<T: Api>(pub Arc<T>);
1339                    impl<
1340                        T: Api,
1341                    > tonic::server::UnaryService<
1342                        super::super::requests::SyncStateRequest,
1343                    > for SyncStateSvc<T> {
1344                        type Response = super::super::responses::SyncStateResponse;
1345                        type Future = BoxFuture<
1346                            tonic::Response<Self::Response>,
1347                            tonic::Status,
1348                        >;
1349                        fn call(
1350                            &mut self,
1351                            request: tonic::Request<
1352                                super::super::requests::SyncStateRequest,
1353                            >,
1354                        ) -> Self::Future {
1355                            let inner = Arc::clone(&self.0);
1356                            let fut = async move {
1357                                <T as Api>::sync_state(&inner, request).await
1358                            };
1359                            Box::pin(fut)
1360                        }
1361                    }
1362                    let accept_compression_encodings = self.accept_compression_encodings;
1363                    let send_compression_encodings = self.send_compression_encodings;
1364                    let max_decoding_message_size = self.max_decoding_message_size;
1365                    let max_encoding_message_size = self.max_encoding_message_size;
1366                    let inner = self.inner.clone();
1367                    let fut = async move {
1368                        let method = SyncStateSvc(inner);
1369                        let codec = tonic::codec::ProstCodec::default();
1370                        let mut grpc = tonic::server::Grpc::new(codec)
1371                            .apply_compression_config(
1372                                accept_compression_encodings,
1373                                send_compression_encodings,
1374                            )
1375                            .apply_max_message_size_config(
1376                                max_decoding_message_size,
1377                                max_encoding_message_size,
1378                            );
1379                        let res = grpc.unary(method, req).await;
1380                        Ok(res)
1381                    };
1382                    Box::pin(fut)
1383                }
1384                _ => {
1385                    Box::pin(async move {
1386                        let mut response = http::Response::new(empty_body());
1387                        let headers = response.headers_mut();
1388                        headers
1389                            .insert(
1390                                tonic::Status::GRPC_STATUS,
1391                                (tonic::Code::Unimplemented as i32).into(),
1392                            );
1393                        headers
1394                            .insert(
1395                                http::header::CONTENT_TYPE,
1396                                tonic::metadata::GRPC_CONTENT_TYPE,
1397                            );
1398                        Ok(response)
1399                    })
1400                }
1401            }
1402        }
1403    }
1404    impl<T> Clone for ApiServer<T> {
1405        fn clone(&self) -> Self {
1406            let inner = self.inner.clone();
1407            Self {
1408                inner,
1409                accept_compression_encodings: self.accept_compression_encodings,
1410                send_compression_encodings: self.send_compression_encodings,
1411                max_decoding_message_size: self.max_decoding_message_size,
1412                max_encoding_message_size: self.max_encoding_message_size,
1413            }
1414        }
1415    }
1416    /// Generated gRPC service name
1417    pub const SERVICE_NAME: &str = "store.Api";
1418    impl<T> tonic::server::NamedService for ApiServer<T> {
1419        const NAME: &'static str = SERVICE_NAME;
1420    }
1421}