Skip to main content

snix_store/build/source/target/x86_64-unknown-linux-gnu/debug/build/snix-store-7f008d501055fd1b/out/
snix.store.v1.rs

1// This file is @generated by prost-build.
2/// PathInfo shows information about a Nix Store Path.
3/// That's a single element inside /nix/store.
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct PathInfo {
6    /// The entry both describes the store path and the contents, which can be a
7    /// directory, file or symlink.
8    #[prost(message, optional, tag = "1")]
9    pub entry: ::core::option::Option<::snix_castore::proto::Entry>,
10    /// List of references (output path hashes)
11    /// This really is the raw *bytes*, after decoding nixbase32, and not a
12    /// base32-encoded string.
13    #[prost(bytes = "bytes", repeated, tag = "2")]
14    pub references: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
15    /// see below.
16    #[prost(message, optional, tag = "3")]
17    pub narinfo: ::core::option::Option<NarInfo>,
18}
19/// Represents a path in the Nix store (a direct child of STORE_DIR).
20/// It is commonly formatted by a nixbase32-encoding the digest, and
21/// concatenating the name, separated by a `-`.
22#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
23pub struct StorePath {
24    /// The string after digest and `-`.
25    #[prost(string, tag = "1")]
26    pub name: ::prost::alloc::string::String,
27    /// The digest (20 bytes).
28    #[prost(bytes = "bytes", tag = "2")]
29    pub digest: ::prost::bytes::Bytes,
30}
31/// Nix C++ uses NAR (Nix Archive) as a format to transfer store paths,
32/// and stores metadata and signatures in NARInfo files.
33/// Store all these attributes in a separate message.
34///
35/// This is useful to render .narinfo files to clients, or to preserve/validate
36/// these signatures.
37/// As verifying these signatures requires the whole NAR file to be synthesized,
38/// moving to another signature scheme is desired.
39/// Even then, it still makes sense to hold this data, for old clients.
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct NarInfo {
42    /// This size of the NAR file, in bytes.
43    #[prost(uint64, tag = "1")]
44    pub nar_size: u64,
45    /// The sha256 of the NAR file representation.
46    #[prost(bytes = "bytes", tag = "2")]
47    pub nar_sha256: ::prost::bytes::Bytes,
48    /// The signatures in a .narinfo file.
49    #[prost(message, repeated, tag = "3")]
50    pub signatures: ::prost::alloc::vec::Vec<nar_info::Signature>,
51    /// A list of references. To validate .narinfo signatures, a fingerprint needs
52    /// to be constructed.
53    /// This fingerprint doesn't just contain the hashes of the output paths of all
54    /// references (like PathInfo.references), but their whole (base)names, so we
55    /// need to keep them somewhere.
56    #[prost(string, repeated, tag = "4")]
57    pub reference_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
58    /// The StorePath of the .drv file producing this output.
59    /// The .drv suffix is omitted in its `name` field.
60    #[prost(message, optional, tag = "5")]
61    pub deriver: ::core::option::Option<StorePath>,
62    /// The CA field in the .narinfo.
63    /// Its textual representations seen in the wild are one of the following:
64    ///
65    /// * `fixed:r:sha256:1gcky5hlf5vqfzpyhihydmm54grhc94mcs8w7xr8613qsqb1v2j6`
66    ///   fixed-output derivations using "recursive" `outputHashMode`.
67    /// * `fixed:sha256:19xqkh72crbcba7flwxyi3n293vav6d7qkzkh2v4zfyi4iia8vj8 fixed-output derivations using "flat" `outputHashMode\`
68    /// * `text:sha256:19xqkh72crbcba7flwxyi3n293vav6d7qkzkh2v4zfyi4iia8vj8`
69    ///   Text hashing, used for uploaded .drv files and outputs produced by
70    ///   builtins.toFile.
71    ///
72    /// Semantically, they can be split into the following components:
73    ///
74    /// * "content address prefix". Currently, "fixed" and "text" are supported.
75    /// * "hash mode". Currently, "flat" and "recursive" are supported.
76    /// * "hash type". The underlying hash function used.
77    ///   Currently, sha1, md5, sha256, sha512.
78    /// * "digest". The digest itself.
79    ///
80    /// There are some restrictions on the possible combinations.
81    /// For example, `text` and `fixed:recursive` always imply sha256.
82    ///
83    /// We use an enum to encode the possible combinations, and optimize for the
84    /// common case, `fixed:recursive`, identified as `NAR_SHA256`.
85    #[prost(message, optional, tag = "6")]
86    pub ca: ::core::option::Option<nar_info::Ca>,
87}
88/// Nested message and enum types in `NARInfo`.
89pub mod nar_info {
90    /// This represents a (parsed) signature line in a .narinfo file.
91    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
92    pub struct Signature {
93        #[prost(string, tag = "1")]
94        pub name: ::prost::alloc::string::String,
95        #[prost(bytes = "bytes", tag = "2")]
96        pub data: ::prost::bytes::Bytes,
97    }
98    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
99    pub struct Ca {
100        /// The hashing type used.
101        #[prost(enumeration = "ca::Hash", tag = "1")]
102        pub r#type: i32,
103        /// The digest, in raw bytes.
104        #[prost(bytes = "bytes", tag = "2")]
105        pub digest: ::prost::bytes::Bytes,
106    }
107    /// Nested message and enum types in `CA`.
108    pub mod ca {
109        #[derive(
110            Clone,
111            Copy,
112            Debug,
113            PartialEq,
114            Eq,
115            Hash,
116            PartialOrd,
117            Ord,
118            ::prost::Enumeration
119        )]
120        #[repr(i32)]
121        pub enum Hash {
122            /// produced when uploading fixed-output store paths using NAR-based
123            /// hashing (`outputHashMode = "recursive"`).
124            NarSha256 = 0,
125            NarSha1 = 1,
126            NarSha512 = 2,
127            NarMd5 = 3,
128            /// Produced when uploading .drv files or outputs produced by
129            /// builtins.toFile.
130            /// Produces equivalent digests as FLAT_SHA256, but is a separate
131            /// hashing type in Nix, affecting output path calculation.
132            TextSha256 = 4,
133            /// Produced when using fixed-output derivations with
134            /// `outputHashMode = "flat"`.
135            FlatSha1 = 5,
136            FlatMd5 = 6,
137            FlatSha256 = 7,
138            FlatSha512 = 8,
139        }
140        impl Hash {
141            /// String value of the enum field names used in the ProtoBuf definition.
142            ///
143            /// The values are not transformed in any way and thus are considered stable
144            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
145            pub fn as_str_name(&self) -> &'static str {
146                match self {
147                    Self::NarSha256 => "NAR_SHA256",
148                    Self::NarSha1 => "NAR_SHA1",
149                    Self::NarSha512 => "NAR_SHA512",
150                    Self::NarMd5 => "NAR_MD5",
151                    Self::TextSha256 => "TEXT_SHA256",
152                    Self::FlatSha1 => "FLAT_SHA1",
153                    Self::FlatMd5 => "FLAT_MD5",
154                    Self::FlatSha256 => "FLAT_SHA256",
155                    Self::FlatSha512 => "FLAT_SHA512",
156                }
157            }
158            /// Creates an enum from field names used in the ProtoBuf definition.
159            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
160                match value {
161                    "NAR_SHA256" => Some(Self::NarSha256),
162                    "NAR_SHA1" => Some(Self::NarSha1),
163                    "NAR_SHA512" => Some(Self::NarSha512),
164                    "NAR_MD5" => Some(Self::NarMd5),
165                    "TEXT_SHA256" => Some(Self::TextSha256),
166                    "FLAT_SHA1" => Some(Self::FlatSha1),
167                    "FLAT_MD5" => Some(Self::FlatMd5),
168                    "FLAT_SHA256" => Some(Self::FlatSha256),
169                    "FLAT_SHA512" => Some(Self::FlatSha512),
170                    _ => None,
171                }
172            }
173        }
174    }
175}
176/// The parameters that can be used to lookup a (single) PathInfo object.
177/// Currently, only a lookup by output hash is supported.
178#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
179pub struct GetPathInfoRequest {
180    #[prost(oneof = "get_path_info_request::ByWhat", tags = "1")]
181    pub by_what: ::core::option::Option<get_path_info_request::ByWhat>,
182}
183/// Nested message and enum types in `GetPathInfoRequest`.
184pub mod get_path_info_request {
185    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
186    pub enum ByWhat {
187        /// The output hash of a nix path (20 bytes).
188        /// This is the nixbase32-decoded portion of a Nix output path, so to substitute
189        /// /nix/store/xm35nga2g20mz5sm5l6n8v3bdm86yj83-cowsay-3.04
190        /// this field would contain nixbase32dec("xm35nga2g20mz5sm5l6n8v3bdm86yj83").
191        #[prost(bytes, tag = "1")]
192        ByOutputHash(::prost::bytes::Bytes),
193    }
194}
195/// The parameters that can be used to lookup (multiple) PathInfo objects.
196/// Currently no filtering is possible, all objects are returned.
197#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
198pub struct ListPathInfoRequest {}
199/// CalculateNARResponse is the response returned by the CalculateNAR request.
200///
201/// It contains the size of the NAR representation (in bytes), and the sha56
202/// digest.
203#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
204pub struct CalculateNarResponse {
205    /// This size of the NAR file, in bytes.
206    #[prost(uint64, tag = "1")]
207    pub nar_size: u64,
208    /// The sha256 of the NAR file representation.
209    #[prost(bytes = "bytes", tag = "2")]
210    pub nar_sha256: ::prost::bytes::Bytes,
211}
212/// Generated client implementations.
213pub mod path_info_service_client {
214    #![allow(
215        unused_variables,
216        dead_code,
217        missing_docs,
218        clippy::wildcard_imports,
219        clippy::let_unit_value,
220    )]
221    use tonic::codegen::*;
222    use tonic::codegen::http::Uri;
223    #[derive(Debug, Clone)]
224    pub struct PathInfoServiceClient<T> {
225        inner: tonic::client::Grpc<T>,
226    }
227    impl PathInfoServiceClient<tonic::transport::Channel> {
228        /// Attempt to create a new client by connecting to a given endpoint.
229        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
230        where
231            D: TryInto<tonic::transport::Endpoint>,
232            D::Error: Into<StdError>,
233        {
234            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
235            Ok(Self::new(conn))
236        }
237    }
238    impl<T> PathInfoServiceClient<T>
239    where
240        T: tonic::client::GrpcService<tonic::body::Body>,
241        T::Error: Into<StdError>,
242        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
243        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
244    {
245        pub fn new(inner: T) -> Self {
246            let inner = tonic::client::Grpc::new(inner);
247            Self { inner }
248        }
249        pub fn with_origin(inner: T, origin: Uri) -> Self {
250            let inner = tonic::client::Grpc::with_origin(inner, origin);
251            Self { inner }
252        }
253        pub fn with_interceptor<F>(
254            inner: T,
255            interceptor: F,
256        ) -> PathInfoServiceClient<InterceptedService<T, F>>
257        where
258            F: tonic::service::Interceptor,
259            T::ResponseBody: Default,
260            T: tonic::codegen::Service<
261                http::Request<tonic::body::Body>,
262                Response = http::Response<
263                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
264                >,
265            >,
266            <T as tonic::codegen::Service<
267                http::Request<tonic::body::Body>,
268            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
269        {
270            PathInfoServiceClient::new(InterceptedService::new(inner, interceptor))
271        }
272        /// Compress requests with the given encoding.
273        ///
274        /// This requires the server to support it otherwise it might respond with an
275        /// error.
276        #[must_use]
277        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
278            self.inner = self.inner.send_compressed(encoding);
279            self
280        }
281        /// Enable decompressing responses.
282        #[must_use]
283        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
284            self.inner = self.inner.accept_compressed(encoding);
285            self
286        }
287        /// Limits the maximum size of a decoded message.
288        ///
289        /// Default: `4MB`
290        #[must_use]
291        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
292            self.inner = self.inner.max_decoding_message_size(limit);
293            self
294        }
295        /// Limits the maximum size of an encoded message.
296        ///
297        /// Default: `usize::MAX`
298        #[must_use]
299        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
300            self.inner = self.inner.max_encoding_message_size(limit);
301            self
302        }
303        /// Return a PathInfo message matching the criteria specified in the
304        /// GetPathInfoRequest message.
305        pub async fn get(
306            &mut self,
307            request: impl tonic::IntoRequest<super::GetPathInfoRequest>,
308        ) -> std::result::Result<tonic::Response<super::PathInfo>, tonic::Status> {
309            self.inner
310                .ready()
311                .await
312                .map_err(|e| {
313                    tonic::Status::unknown(
314                        format!("Service was not ready: {}", e.into()),
315                    )
316                })?;
317            let codec = tonic_prost::ProstCodec::default();
318            let path = http::uri::PathAndQuery::from_static(
319                "/snix.store.v1.PathInfoService/Get",
320            );
321            let mut req = request.into_request();
322            req.extensions_mut()
323                .insert(GrpcMethod::new("snix.store.v1.PathInfoService", "Get"));
324            self.inner.unary(req, path, codec).await
325        }
326        /// Upload a PathInfo object to the remote end. It MUST not return until the
327        /// PathInfo object has been written on the remote end.
328        ///
329        /// The remote end MAY check if a potential DirectoryNode has already been
330        /// uploaded.
331        ///
332        /// Uploading clients SHOULD obviously not steer other machines to try to
333        /// substitute before from the remote end before having finished uploading
334        /// PathInfo, Directories and Blobs.
335        /// The returned PathInfo object MAY contain additional narinfo signatures, but
336        /// is otherwise left untouched.
337        pub async fn put(
338            &mut self,
339            request: impl tonic::IntoRequest<super::PathInfo>,
340        ) -> std::result::Result<tonic::Response<super::PathInfo>, tonic::Status> {
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_prost::ProstCodec::default();
350            let path = http::uri::PathAndQuery::from_static(
351                "/snix.store.v1.PathInfoService/Put",
352            );
353            let mut req = request.into_request();
354            req.extensions_mut()
355                .insert(GrpcMethod::new("snix.store.v1.PathInfoService", "Put"));
356            self.inner.unary(req, path, codec).await
357        }
358        /// Calculate the NAR representation of the contents specified by the
359        /// root_node. The calculation SHOULD be cached server-side for subsequent
360        /// requests.
361        ///
362        /// All references (to blobs or Directory messages) MUST already exist in the
363        /// store.
364        ///
365        /// The method can be used to produce a Nix fixed-output path, which contains
366        /// the (compressed) sha256 of the NAR content representation in the root_node
367        /// name (suffixed with the name).
368        ///
369        /// It can also be used to calculate arbitrary NAR hashes of output paths, in
370        /// case a legacy Nix Binary Cache frontend is provided.
371        pub async fn calculate_nar(
372            &mut self,
373            request: impl tonic::IntoRequest<::snix_castore::proto::Entry>,
374        ) -> std::result::Result<
375            tonic::Response<super::CalculateNarResponse>,
376            tonic::Status,
377        > {
378            self.inner
379                .ready()
380                .await
381                .map_err(|e| {
382                    tonic::Status::unknown(
383                        format!("Service was not ready: {}", e.into()),
384                    )
385                })?;
386            let codec = tonic_prost::ProstCodec::default();
387            let path = http::uri::PathAndQuery::from_static(
388                "/snix.store.v1.PathInfoService/CalculateNAR",
389            );
390            let mut req = request.into_request();
391            req.extensions_mut()
392                .insert(
393                    GrpcMethod::new("snix.store.v1.PathInfoService", "CalculateNAR"),
394                );
395            self.inner.unary(req, path, codec).await
396        }
397        /// Return a stream of PathInfo messages matching the criteria specified in
398        /// ListPathInfoRequest.
399        pub async fn list(
400            &mut self,
401            request: impl tonic::IntoRequest<super::ListPathInfoRequest>,
402        ) -> std::result::Result<
403            tonic::Response<tonic::codec::Streaming<super::PathInfo>>,
404            tonic::Status,
405        > {
406            self.inner
407                .ready()
408                .await
409                .map_err(|e| {
410                    tonic::Status::unknown(
411                        format!("Service was not ready: {}", e.into()),
412                    )
413                })?;
414            let codec = tonic_prost::ProstCodec::default();
415            let path = http::uri::PathAndQuery::from_static(
416                "/snix.store.v1.PathInfoService/List",
417            );
418            let mut req = request.into_request();
419            req.extensions_mut()
420                .insert(GrpcMethod::new("snix.store.v1.PathInfoService", "List"));
421            self.inner.server_streaming(req, path, codec).await
422        }
423    }
424}
425/// Generated server implementations.
426pub mod path_info_service_server {
427    #![allow(
428        unused_variables,
429        dead_code,
430        missing_docs,
431        clippy::wildcard_imports,
432        clippy::let_unit_value,
433    )]
434    use tonic::codegen::*;
435    /// Generated trait containing gRPC methods that should be implemented for use with PathInfoServiceServer.
436    #[async_trait]
437    pub trait PathInfoService: std::marker::Send + std::marker::Sync + 'static {
438        /// Return a PathInfo message matching the criteria specified in the
439        /// GetPathInfoRequest message.
440        async fn get(
441            &self,
442            request: tonic::Request<super::GetPathInfoRequest>,
443        ) -> std::result::Result<tonic::Response<super::PathInfo>, tonic::Status>;
444        /// Upload a PathInfo object to the remote end. It MUST not return until the
445        /// PathInfo object has been written on the remote end.
446        ///
447        /// The remote end MAY check if a potential DirectoryNode has already been
448        /// uploaded.
449        ///
450        /// Uploading clients SHOULD obviously not steer other machines to try to
451        /// substitute before from the remote end before having finished uploading
452        /// PathInfo, Directories and Blobs.
453        /// The returned PathInfo object MAY contain additional narinfo signatures, but
454        /// is otherwise left untouched.
455        async fn put(
456            &self,
457            request: tonic::Request<super::PathInfo>,
458        ) -> std::result::Result<tonic::Response<super::PathInfo>, tonic::Status>;
459        /// Calculate the NAR representation of the contents specified by the
460        /// root_node. The calculation SHOULD be cached server-side for subsequent
461        /// requests.
462        ///
463        /// All references (to blobs or Directory messages) MUST already exist in the
464        /// store.
465        ///
466        /// The method can be used to produce a Nix fixed-output path, which contains
467        /// the (compressed) sha256 of the NAR content representation in the root_node
468        /// name (suffixed with the name).
469        ///
470        /// It can also be used to calculate arbitrary NAR hashes of output paths, in
471        /// case a legacy Nix Binary Cache frontend is provided.
472        async fn calculate_nar(
473            &self,
474            request: tonic::Request<::snix_castore::proto::Entry>,
475        ) -> std::result::Result<
476            tonic::Response<super::CalculateNarResponse>,
477            tonic::Status,
478        >;
479        /// Server streaming response type for the List method.
480        type ListStream: tonic::codegen::tokio_stream::Stream<
481                Item = std::result::Result<super::PathInfo, tonic::Status>,
482            >
483            + std::marker::Send
484            + 'static;
485        /// Return a stream of PathInfo messages matching the criteria specified in
486        /// ListPathInfoRequest.
487        async fn list(
488            &self,
489            request: tonic::Request<super::ListPathInfoRequest>,
490        ) -> std::result::Result<tonic::Response<Self::ListStream>, tonic::Status>;
491    }
492    #[derive(Debug)]
493    pub struct PathInfoServiceServer<T> {
494        inner: Arc<T>,
495        accept_compression_encodings: EnabledCompressionEncodings,
496        send_compression_encodings: EnabledCompressionEncodings,
497        max_decoding_message_size: Option<usize>,
498        max_encoding_message_size: Option<usize>,
499    }
500    impl<T> PathInfoServiceServer<T> {
501        pub fn new(inner: T) -> Self {
502            Self::from_arc(Arc::new(inner))
503        }
504        pub fn from_arc(inner: Arc<T>) -> Self {
505            Self {
506                inner,
507                accept_compression_encodings: Default::default(),
508                send_compression_encodings: Default::default(),
509                max_decoding_message_size: None,
510                max_encoding_message_size: None,
511            }
512        }
513        pub fn with_interceptor<F>(
514            inner: T,
515            interceptor: F,
516        ) -> InterceptedService<Self, F>
517        where
518            F: tonic::service::Interceptor,
519        {
520            InterceptedService::new(Self::new(inner), interceptor)
521        }
522        /// Enable decompressing requests with the given encoding.
523        #[must_use]
524        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
525            self.accept_compression_encodings.enable(encoding);
526            self
527        }
528        /// Compress responses with the given encoding, if the client supports it.
529        #[must_use]
530        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
531            self.send_compression_encodings.enable(encoding);
532            self
533        }
534        /// Limits the maximum size of a decoded message.
535        ///
536        /// Default: `4MB`
537        #[must_use]
538        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
539            self.max_decoding_message_size = Some(limit);
540            self
541        }
542        /// Limits the maximum size of an encoded message.
543        ///
544        /// Default: `usize::MAX`
545        #[must_use]
546        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
547            self.max_encoding_message_size = Some(limit);
548            self
549        }
550    }
551    impl<T, B> tonic::codegen::Service<http::Request<B>> for PathInfoServiceServer<T>
552    where
553        T: PathInfoService,
554        B: Body + std::marker::Send + 'static,
555        B::Error: Into<StdError> + std::marker::Send + 'static,
556    {
557        type Response = http::Response<tonic::body::Body>;
558        type Error = std::convert::Infallible;
559        type Future = BoxFuture<Self::Response, Self::Error>;
560        fn poll_ready(
561            &mut self,
562            _cx: &mut Context<'_>,
563        ) -> Poll<std::result::Result<(), Self::Error>> {
564            Poll::Ready(Ok(()))
565        }
566        fn call(&mut self, req: http::Request<B>) -> Self::Future {
567            match req.uri().path() {
568                "/snix.store.v1.PathInfoService/Get" => {
569                    #[allow(non_camel_case_types)]
570                    struct GetSvc<T: PathInfoService>(pub Arc<T>);
571                    impl<
572                        T: PathInfoService,
573                    > tonic::server::UnaryService<super::GetPathInfoRequest>
574                    for GetSvc<T> {
575                        type Response = super::PathInfo;
576                        type Future = BoxFuture<
577                            tonic::Response<Self::Response>,
578                            tonic::Status,
579                        >;
580                        fn call(
581                            &mut self,
582                            request: tonic::Request<super::GetPathInfoRequest>,
583                        ) -> Self::Future {
584                            let inner = Arc::clone(&self.0);
585                            let fut = async move {
586                                <T as PathInfoService>::get(&inner, request).await
587                            };
588                            Box::pin(fut)
589                        }
590                    }
591                    let accept_compression_encodings = self.accept_compression_encodings;
592                    let send_compression_encodings = self.send_compression_encodings;
593                    let max_decoding_message_size = self.max_decoding_message_size;
594                    let max_encoding_message_size = self.max_encoding_message_size;
595                    let inner = self.inner.clone();
596                    let fut = async move {
597                        let method = GetSvc(inner);
598                        let codec = tonic_prost::ProstCodec::default();
599                        let mut grpc = tonic::server::Grpc::new(codec)
600                            .apply_compression_config(
601                                accept_compression_encodings,
602                                send_compression_encodings,
603                            )
604                            .apply_max_message_size_config(
605                                max_decoding_message_size,
606                                max_encoding_message_size,
607                            );
608                        let res = grpc.unary(method, req).await;
609                        Ok(res)
610                    };
611                    Box::pin(fut)
612                }
613                "/snix.store.v1.PathInfoService/Put" => {
614                    #[allow(non_camel_case_types)]
615                    struct PutSvc<T: PathInfoService>(pub Arc<T>);
616                    impl<T: PathInfoService> tonic::server::UnaryService<super::PathInfo>
617                    for PutSvc<T> {
618                        type Response = super::PathInfo;
619                        type Future = BoxFuture<
620                            tonic::Response<Self::Response>,
621                            tonic::Status,
622                        >;
623                        fn call(
624                            &mut self,
625                            request: tonic::Request<super::PathInfo>,
626                        ) -> Self::Future {
627                            let inner = Arc::clone(&self.0);
628                            let fut = async move {
629                                <T as PathInfoService>::put(&inner, request).await
630                            };
631                            Box::pin(fut)
632                        }
633                    }
634                    let accept_compression_encodings = self.accept_compression_encodings;
635                    let send_compression_encodings = self.send_compression_encodings;
636                    let max_decoding_message_size = self.max_decoding_message_size;
637                    let max_encoding_message_size = self.max_encoding_message_size;
638                    let inner = self.inner.clone();
639                    let fut = async move {
640                        let method = PutSvc(inner);
641                        let codec = tonic_prost::ProstCodec::default();
642                        let mut grpc = tonic::server::Grpc::new(codec)
643                            .apply_compression_config(
644                                accept_compression_encodings,
645                                send_compression_encodings,
646                            )
647                            .apply_max_message_size_config(
648                                max_decoding_message_size,
649                                max_encoding_message_size,
650                            );
651                        let res = grpc.unary(method, req).await;
652                        Ok(res)
653                    };
654                    Box::pin(fut)
655                }
656                "/snix.store.v1.PathInfoService/CalculateNAR" => {
657                    #[allow(non_camel_case_types)]
658                    struct CalculateNARSvc<T: PathInfoService>(pub Arc<T>);
659                    impl<
660                        T: PathInfoService,
661                    > tonic::server::UnaryService<::snix_castore::proto::Entry>
662                    for CalculateNARSvc<T> {
663                        type Response = super::CalculateNarResponse;
664                        type Future = BoxFuture<
665                            tonic::Response<Self::Response>,
666                            tonic::Status,
667                        >;
668                        fn call(
669                            &mut self,
670                            request: tonic::Request<::snix_castore::proto::Entry>,
671                        ) -> Self::Future {
672                            let inner = Arc::clone(&self.0);
673                            let fut = async move {
674                                <T as PathInfoService>::calculate_nar(&inner, request).await
675                            };
676                            Box::pin(fut)
677                        }
678                    }
679                    let accept_compression_encodings = self.accept_compression_encodings;
680                    let send_compression_encodings = self.send_compression_encodings;
681                    let max_decoding_message_size = self.max_decoding_message_size;
682                    let max_encoding_message_size = self.max_encoding_message_size;
683                    let inner = self.inner.clone();
684                    let fut = async move {
685                        let method = CalculateNARSvc(inner);
686                        let codec = tonic_prost::ProstCodec::default();
687                        let mut grpc = tonic::server::Grpc::new(codec)
688                            .apply_compression_config(
689                                accept_compression_encodings,
690                                send_compression_encodings,
691                            )
692                            .apply_max_message_size_config(
693                                max_decoding_message_size,
694                                max_encoding_message_size,
695                            );
696                        let res = grpc.unary(method, req).await;
697                        Ok(res)
698                    };
699                    Box::pin(fut)
700                }
701                "/snix.store.v1.PathInfoService/List" => {
702                    #[allow(non_camel_case_types)]
703                    struct ListSvc<T: PathInfoService>(pub Arc<T>);
704                    impl<
705                        T: PathInfoService,
706                    > tonic::server::ServerStreamingService<super::ListPathInfoRequest>
707                    for ListSvc<T> {
708                        type Response = super::PathInfo;
709                        type ResponseStream = T::ListStream;
710                        type Future = BoxFuture<
711                            tonic::Response<Self::ResponseStream>,
712                            tonic::Status,
713                        >;
714                        fn call(
715                            &mut self,
716                            request: tonic::Request<super::ListPathInfoRequest>,
717                        ) -> Self::Future {
718                            let inner = Arc::clone(&self.0);
719                            let fut = async move {
720                                <T as PathInfoService>::list(&inner, request).await
721                            };
722                            Box::pin(fut)
723                        }
724                    }
725                    let accept_compression_encodings = self.accept_compression_encodings;
726                    let send_compression_encodings = self.send_compression_encodings;
727                    let max_decoding_message_size = self.max_decoding_message_size;
728                    let max_encoding_message_size = self.max_encoding_message_size;
729                    let inner = self.inner.clone();
730                    let fut = async move {
731                        let method = ListSvc(inner);
732                        let codec = tonic_prost::ProstCodec::default();
733                        let mut grpc = tonic::server::Grpc::new(codec)
734                            .apply_compression_config(
735                                accept_compression_encodings,
736                                send_compression_encodings,
737                            )
738                            .apply_max_message_size_config(
739                                max_decoding_message_size,
740                                max_encoding_message_size,
741                            );
742                        let res = grpc.server_streaming(method, req).await;
743                        Ok(res)
744                    };
745                    Box::pin(fut)
746                }
747                _ => {
748                    Box::pin(async move {
749                        let mut response = http::Response::new(
750                            tonic::body::Body::default(),
751                        );
752                        let headers = response.headers_mut();
753                        headers
754                            .insert(
755                                tonic::Status::GRPC_STATUS,
756                                (tonic::Code::Unimplemented as i32).into(),
757                            );
758                        headers
759                            .insert(
760                                http::header::CONTENT_TYPE,
761                                tonic::metadata::GRPC_CONTENT_TYPE,
762                            );
763                        Ok(response)
764                    })
765                }
766            }
767        }
768    }
769    impl<T> Clone for PathInfoServiceServer<T> {
770        fn clone(&self) -> Self {
771            let inner = self.inner.clone();
772            Self {
773                inner,
774                accept_compression_encodings: self.accept_compression_encodings,
775                send_compression_encodings: self.send_compression_encodings,
776                max_decoding_message_size: self.max_decoding_message_size,
777                max_encoding_message_size: self.max_encoding_message_size,
778            }
779        }
780    }
781    /// Generated gRPC service name
782    pub const SERVICE_NAME: &str = "snix.store.v1.PathInfoService";
783    impl<T> tonic::server::NamedService for PathInfoServiceServer<T> {
784        const NAME: &'static str = SERVICE_NAME;
785    }
786}