Skip to main content

acyclic_objects/generated/
acyclic.objects.v1.tonic.rs

1// @generated
2/// Generated client implementations.
3pub mod buckets_service_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 BucketsServiceClient<T> {
15        inner: tonic::client::Grpc<T>,
16    }
17    impl BucketsServiceClient<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> BucketsServiceClient<T>
29    where
30        T: tonic::client::GrpcService<tonic::body::Body>,
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        ) -> BucketsServiceClient<InterceptedService<T, F>>
47        where
48            F: tonic::service::Interceptor,
49            T::ResponseBody: Default,
50            T: tonic::codegen::Service<
51                http::Request<tonic::body::Body>,
52                Response = http::Response<
53                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
54                >,
55            >,
56            <T as tonic::codegen::Service<
57                http::Request<tonic::body::Body>,
58            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
59        {
60            BucketsServiceClient::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        pub async fn create_bucket(
94            &mut self,
95            request: impl tonic::IntoRequest<super::CreateBucketRequest>,
96        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
97            self.inner
98                .ready()
99                .await
100                .map_err(|e| {
101                    tonic::Status::unknown(
102                        format!("Service was not ready: {}", e.into()),
103                    )
104                })?;
105            let codec = tonic_prost::ProstCodec::default();
106            let path = http::uri::PathAndQuery::from_static(
107                "/acyclic.objects.v1.BucketsService/CreateBucket",
108            );
109            let mut req = request.into_request();
110            req.extensions_mut()
111                .insert(
112                    GrpcMethod::new("acyclic.objects.v1.BucketsService", "CreateBucket"),
113                );
114            self.inner.unary(req, path, codec).await
115        }
116        pub async fn head_bucket(
117            &mut self,
118            request: impl tonic::IntoRequest<super::HeadBucketRequest>,
119        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
120            self.inner
121                .ready()
122                .await
123                .map_err(|e| {
124                    tonic::Status::unknown(
125                        format!("Service was not ready: {}", e.into()),
126                    )
127                })?;
128            let codec = tonic_prost::ProstCodec::default();
129            let path = http::uri::PathAndQuery::from_static(
130                "/acyclic.objects.v1.BucketsService/HeadBucket",
131            );
132            let mut req = request.into_request();
133            req.extensions_mut()
134                .insert(
135                    GrpcMethod::new("acyclic.objects.v1.BucketsService", "HeadBucket"),
136                );
137            self.inner.unary(req, path, codec).await
138        }
139        pub async fn delete_bucket(
140            &mut self,
141            request: impl tonic::IntoRequest<super::DeleteBucketRequest>,
142        ) -> std::result::Result<
143            tonic::Response<super::DeleteBucketResponse>,
144            tonic::Status,
145        > {
146            self.inner
147                .ready()
148                .await
149                .map_err(|e| {
150                    tonic::Status::unknown(
151                        format!("Service was not ready: {}", e.into()),
152                    )
153                })?;
154            let codec = tonic_prost::ProstCodec::default();
155            let path = http::uri::PathAndQuery::from_static(
156                "/acyclic.objects.v1.BucketsService/DeleteBucket",
157            );
158            let mut req = request.into_request();
159            req.extensions_mut()
160                .insert(
161                    GrpcMethod::new("acyclic.objects.v1.BucketsService", "DeleteBucket"),
162                );
163            self.inner.unary(req, path, codec).await
164        }
165    }
166}
167/// Generated server implementations.
168pub mod buckets_service_server {
169    #![allow(
170        unused_variables,
171        dead_code,
172        missing_docs,
173        clippy::wildcard_imports,
174        clippy::let_unit_value,
175    )]
176    use tonic::codegen::*;
177    /// Generated trait containing gRPC methods that should be implemented for use with BucketsServiceServer.
178    #[async_trait]
179    pub trait BucketsService: std::marker::Send + std::marker::Sync + 'static {
180        async fn create_bucket(
181            &self,
182            request: tonic::Request<super::CreateBucketRequest>,
183        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
184        async fn head_bucket(
185            &self,
186            request: tonic::Request<super::HeadBucketRequest>,
187        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
188        async fn delete_bucket(
189            &self,
190            request: tonic::Request<super::DeleteBucketRequest>,
191        ) -> std::result::Result<
192            tonic::Response<super::DeleteBucketResponse>,
193            tonic::Status,
194        >;
195    }
196    #[derive(Debug)]
197    pub struct BucketsServiceServer<T> {
198        inner: Arc<T>,
199        accept_compression_encodings: EnabledCompressionEncodings,
200        send_compression_encodings: EnabledCompressionEncodings,
201        max_decoding_message_size: Option<usize>,
202        max_encoding_message_size: Option<usize>,
203    }
204    impl<T> BucketsServiceServer<T> {
205        pub fn new(inner: T) -> Self {
206            Self::from_arc(Arc::new(inner))
207        }
208        pub fn from_arc(inner: Arc<T>) -> Self {
209            Self {
210                inner,
211                accept_compression_encodings: Default::default(),
212                send_compression_encodings: Default::default(),
213                max_decoding_message_size: None,
214                max_encoding_message_size: None,
215            }
216        }
217        pub fn with_interceptor<F>(
218            inner: T,
219            interceptor: F,
220        ) -> InterceptedService<Self, F>
221        where
222            F: tonic::service::Interceptor,
223        {
224            InterceptedService::new(Self::new(inner), interceptor)
225        }
226        /// Enable decompressing requests with the given encoding.
227        #[must_use]
228        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
229            self.accept_compression_encodings.enable(encoding);
230            self
231        }
232        /// Compress responses with the given encoding, if the client supports it.
233        #[must_use]
234        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
235            self.send_compression_encodings.enable(encoding);
236            self
237        }
238        /// Limits the maximum size of a decoded message.
239        ///
240        /// Default: `4MB`
241        #[must_use]
242        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
243            self.max_decoding_message_size = Some(limit);
244            self
245        }
246        /// Limits the maximum size of an encoded message.
247        ///
248        /// Default: `usize::MAX`
249        #[must_use]
250        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
251            self.max_encoding_message_size = Some(limit);
252            self
253        }
254    }
255    impl<T, B> tonic::codegen::Service<http::Request<B>> for BucketsServiceServer<T>
256    where
257        T: BucketsService,
258        B: Body + std::marker::Send + 'static,
259        B::Error: Into<StdError> + std::marker::Send + 'static,
260    {
261        type Response = http::Response<tonic::body::Body>;
262        type Error = std::convert::Infallible;
263        type Future = BoxFuture<Self::Response, Self::Error>;
264        fn poll_ready(
265            &mut self,
266            _cx: &mut Context<'_>,
267        ) -> Poll<std::result::Result<(), Self::Error>> {
268            Poll::Ready(Ok(()))
269        }
270        fn call(&mut self, req: http::Request<B>) -> Self::Future {
271            match req.uri().path() {
272                "/acyclic.objects.v1.BucketsService/CreateBucket" => {
273                    #[allow(non_camel_case_types)]
274                    struct CreateBucketSvc<T: BucketsService>(pub Arc<T>);
275                    impl<
276                        T: BucketsService,
277                    > tonic::server::UnaryService<super::CreateBucketRequest>
278                    for CreateBucketSvc<T> {
279                        type Response = super::Bucket;
280                        type Future = BoxFuture<
281                            tonic::Response<Self::Response>,
282                            tonic::Status,
283                        >;
284                        fn call(
285                            &mut self,
286                            request: tonic::Request<super::CreateBucketRequest>,
287                        ) -> Self::Future {
288                            let inner = Arc::clone(&self.0);
289                            let fut = async move {
290                                <T as BucketsService>::create_bucket(&inner, request).await
291                            };
292                            Box::pin(fut)
293                        }
294                    }
295                    let accept_compression_encodings = self.accept_compression_encodings;
296                    let send_compression_encodings = self.send_compression_encodings;
297                    let max_decoding_message_size = self.max_decoding_message_size;
298                    let max_encoding_message_size = self.max_encoding_message_size;
299                    let inner = self.inner.clone();
300                    let fut = async move {
301                        let method = CreateBucketSvc(inner);
302                        let codec = tonic_prost::ProstCodec::default();
303                        let mut grpc = tonic::server::Grpc::new(codec)
304                            .apply_compression_config(
305                                accept_compression_encodings,
306                                send_compression_encodings,
307                            )
308                            .apply_max_message_size_config(
309                                max_decoding_message_size,
310                                max_encoding_message_size,
311                            );
312                        let res = grpc.unary(method, req).await;
313                        Ok(res)
314                    };
315                    Box::pin(fut)
316                }
317                "/acyclic.objects.v1.BucketsService/HeadBucket" => {
318                    #[allow(non_camel_case_types)]
319                    struct HeadBucketSvc<T: BucketsService>(pub Arc<T>);
320                    impl<
321                        T: BucketsService,
322                    > tonic::server::UnaryService<super::HeadBucketRequest>
323                    for HeadBucketSvc<T> {
324                        type Response = super::Bucket;
325                        type Future = BoxFuture<
326                            tonic::Response<Self::Response>,
327                            tonic::Status,
328                        >;
329                        fn call(
330                            &mut self,
331                            request: tonic::Request<super::HeadBucketRequest>,
332                        ) -> Self::Future {
333                            let inner = Arc::clone(&self.0);
334                            let fut = async move {
335                                <T as BucketsService>::head_bucket(&inner, request).await
336                            };
337                            Box::pin(fut)
338                        }
339                    }
340                    let accept_compression_encodings = self.accept_compression_encodings;
341                    let send_compression_encodings = self.send_compression_encodings;
342                    let max_decoding_message_size = self.max_decoding_message_size;
343                    let max_encoding_message_size = self.max_encoding_message_size;
344                    let inner = self.inner.clone();
345                    let fut = async move {
346                        let method = HeadBucketSvc(inner);
347                        let codec = tonic_prost::ProstCodec::default();
348                        let mut grpc = tonic::server::Grpc::new(codec)
349                            .apply_compression_config(
350                                accept_compression_encodings,
351                                send_compression_encodings,
352                            )
353                            .apply_max_message_size_config(
354                                max_decoding_message_size,
355                                max_encoding_message_size,
356                            );
357                        let res = grpc.unary(method, req).await;
358                        Ok(res)
359                    };
360                    Box::pin(fut)
361                }
362                "/acyclic.objects.v1.BucketsService/DeleteBucket" => {
363                    #[allow(non_camel_case_types)]
364                    struct DeleteBucketSvc<T: BucketsService>(pub Arc<T>);
365                    impl<
366                        T: BucketsService,
367                    > tonic::server::UnaryService<super::DeleteBucketRequest>
368                    for DeleteBucketSvc<T> {
369                        type Response = super::DeleteBucketResponse;
370                        type Future = BoxFuture<
371                            tonic::Response<Self::Response>,
372                            tonic::Status,
373                        >;
374                        fn call(
375                            &mut self,
376                            request: tonic::Request<super::DeleteBucketRequest>,
377                        ) -> Self::Future {
378                            let inner = Arc::clone(&self.0);
379                            let fut = async move {
380                                <T as BucketsService>::delete_bucket(&inner, request).await
381                            };
382                            Box::pin(fut)
383                        }
384                    }
385                    let accept_compression_encodings = self.accept_compression_encodings;
386                    let send_compression_encodings = self.send_compression_encodings;
387                    let max_decoding_message_size = self.max_decoding_message_size;
388                    let max_encoding_message_size = self.max_encoding_message_size;
389                    let inner = self.inner.clone();
390                    let fut = async move {
391                        let method = DeleteBucketSvc(inner);
392                        let codec = tonic_prost::ProstCodec::default();
393                        let mut grpc = tonic::server::Grpc::new(codec)
394                            .apply_compression_config(
395                                accept_compression_encodings,
396                                send_compression_encodings,
397                            )
398                            .apply_max_message_size_config(
399                                max_decoding_message_size,
400                                max_encoding_message_size,
401                            );
402                        let res = grpc.unary(method, req).await;
403                        Ok(res)
404                    };
405                    Box::pin(fut)
406                }
407                _ => {
408                    Box::pin(async move {
409                        let mut response = http::Response::new(
410                            tonic::body::Body::default(),
411                        );
412                        let headers = response.headers_mut();
413                        headers
414                            .insert(
415                                tonic::Status::GRPC_STATUS,
416                                (tonic::Code::Unimplemented as i32).into(),
417                            );
418                        headers
419                            .insert(
420                                http::header::CONTENT_TYPE,
421                                tonic::metadata::GRPC_CONTENT_TYPE,
422                            );
423                        Ok(response)
424                    })
425                }
426            }
427        }
428    }
429    impl<T> Clone for BucketsServiceServer<T> {
430        fn clone(&self) -> Self {
431            let inner = self.inner.clone();
432            Self {
433                inner,
434                accept_compression_encodings: self.accept_compression_encodings,
435                send_compression_encodings: self.send_compression_encodings,
436                max_decoding_message_size: self.max_decoding_message_size,
437                max_encoding_message_size: self.max_encoding_message_size,
438            }
439        }
440    }
441    /// Generated gRPC service name
442    pub const SERVICE_NAME: &str = "acyclic.objects.v1.BucketsService";
443    impl<T> tonic::server::NamedService for BucketsServiceServer<T> {
444        const NAME: &'static str = SERVICE_NAME;
445    }
446}
447/// Generated client implementations.
448pub mod objects_service_client {
449    #![allow(
450        unused_variables,
451        dead_code,
452        missing_docs,
453        clippy::wildcard_imports,
454        clippy::let_unit_value,
455    )]
456    use tonic::codegen::*;
457    use tonic::codegen::http::Uri;
458    #[derive(Debug, Clone)]
459    pub struct ObjectsServiceClient<T> {
460        inner: tonic::client::Grpc<T>,
461    }
462    impl ObjectsServiceClient<tonic::transport::Channel> {
463        /// Attempt to create a new client by connecting to a given endpoint.
464        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
465        where
466            D: TryInto<tonic::transport::Endpoint>,
467            D::Error: Into<StdError>,
468        {
469            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
470            Ok(Self::new(conn))
471        }
472    }
473    impl<T> ObjectsServiceClient<T>
474    where
475        T: tonic::client::GrpcService<tonic::body::Body>,
476        T::Error: Into<StdError>,
477        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
478        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
479    {
480        pub fn new(inner: T) -> Self {
481            let inner = tonic::client::Grpc::new(inner);
482            Self { inner }
483        }
484        pub fn with_origin(inner: T, origin: Uri) -> Self {
485            let inner = tonic::client::Grpc::with_origin(inner, origin);
486            Self { inner }
487        }
488        pub fn with_interceptor<F>(
489            inner: T,
490            interceptor: F,
491        ) -> ObjectsServiceClient<InterceptedService<T, F>>
492        where
493            F: tonic::service::Interceptor,
494            T::ResponseBody: Default,
495            T: tonic::codegen::Service<
496                http::Request<tonic::body::Body>,
497                Response = http::Response<
498                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
499                >,
500            >,
501            <T as tonic::codegen::Service<
502                http::Request<tonic::body::Body>,
503            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
504        {
505            ObjectsServiceClient::new(InterceptedService::new(inner, interceptor))
506        }
507        /// Compress requests with the given encoding.
508        ///
509        /// This requires the server to support it otherwise it might respond with an
510        /// error.
511        #[must_use]
512        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
513            self.inner = self.inner.send_compressed(encoding);
514            self
515        }
516        /// Enable decompressing responses.
517        #[must_use]
518        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
519            self.inner = self.inner.accept_compressed(encoding);
520            self
521        }
522        /// Limits the maximum size of a decoded message.
523        ///
524        /// Default: `4MB`
525        #[must_use]
526        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
527            self.inner = self.inner.max_decoding_message_size(limit);
528            self
529        }
530        /// Limits the maximum size of an encoded message.
531        ///
532        /// Default: `usize::MAX`
533        #[must_use]
534        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
535            self.inner = self.inner.max_encoding_message_size(limit);
536            self
537        }
538        pub async fn put_object(
539            &mut self,
540            request: impl tonic::IntoStreamingRequest<Message = super::PutObjectRequest>,
541        ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status> {
542            self.inner
543                .ready()
544                .await
545                .map_err(|e| {
546                    tonic::Status::unknown(
547                        format!("Service was not ready: {}", e.into()),
548                    )
549                })?;
550            let codec = tonic_prost::ProstCodec::default();
551            let path = http::uri::PathAndQuery::from_static(
552                "/acyclic.objects.v1.ObjectsService/PutObject",
553            );
554            let mut req = request.into_streaming_request();
555            req.extensions_mut()
556                .insert(
557                    GrpcMethod::new("acyclic.objects.v1.ObjectsService", "PutObject"),
558                );
559            self.inner.client_streaming(req, path, codec).await
560        }
561        pub async fn get_object(
562            &mut self,
563            request: impl tonic::IntoRequest<super::GetObjectRequest>,
564        ) -> std::result::Result<
565            tonic::Response<tonic::codec::Streaming<super::GetObjectResponse>>,
566            tonic::Status,
567        > {
568            self.inner
569                .ready()
570                .await
571                .map_err(|e| {
572                    tonic::Status::unknown(
573                        format!("Service was not ready: {}", e.into()),
574                    )
575                })?;
576            let codec = tonic_prost::ProstCodec::default();
577            let path = http::uri::PathAndQuery::from_static(
578                "/acyclic.objects.v1.ObjectsService/GetObject",
579            );
580            let mut req = request.into_request();
581            req.extensions_mut()
582                .insert(
583                    GrpcMethod::new("acyclic.objects.v1.ObjectsService", "GetObject"),
584                );
585            self.inner.server_streaming(req, path, codec).await
586        }
587        pub async fn head_object(
588            &mut self,
589            request: impl tonic::IntoRequest<super::HeadObjectRequest>,
590        ) -> std::result::Result<
591            tonic::Response<super::HeadObjectResponse>,
592            tonic::Status,
593        > {
594            self.inner
595                .ready()
596                .await
597                .map_err(|e| {
598                    tonic::Status::unknown(
599                        format!("Service was not ready: {}", e.into()),
600                    )
601                })?;
602            let codec = tonic_prost::ProstCodec::default();
603            let path = http::uri::PathAndQuery::from_static(
604                "/acyclic.objects.v1.ObjectsService/HeadObject",
605            );
606            let mut req = request.into_request();
607            req.extensions_mut()
608                .insert(
609                    GrpcMethod::new("acyclic.objects.v1.ObjectsService", "HeadObject"),
610                );
611            self.inner.unary(req, path, codec).await
612        }
613        pub async fn delete_object(
614            &mut self,
615            request: impl tonic::IntoRequest<super::DeleteObjectRequest>,
616        ) -> std::result::Result<
617            tonic::Response<super::DeleteObjectResponse>,
618            tonic::Status,
619        > {
620            self.inner
621                .ready()
622                .await
623                .map_err(|e| {
624                    tonic::Status::unknown(
625                        format!("Service was not ready: {}", e.into()),
626                    )
627                })?;
628            let codec = tonic_prost::ProstCodec::default();
629            let path = http::uri::PathAndQuery::from_static(
630                "/acyclic.objects.v1.ObjectsService/DeleteObject",
631            );
632            let mut req = request.into_request();
633            req.extensions_mut()
634                .insert(
635                    GrpcMethod::new("acyclic.objects.v1.ObjectsService", "DeleteObject"),
636                );
637            self.inner.unary(req, path, codec).await
638        }
639        pub async fn list_objects(
640            &mut self,
641            request: impl tonic::IntoRequest<super::ListObjectsRequest>,
642        ) -> std::result::Result<
643            tonic::Response<super::ListObjectsResponse>,
644            tonic::Status,
645        > {
646            self.inner
647                .ready()
648                .await
649                .map_err(|e| {
650                    tonic::Status::unknown(
651                        format!("Service was not ready: {}", e.into()),
652                    )
653                })?;
654            let codec = tonic_prost::ProstCodec::default();
655            let path = http::uri::PathAndQuery::from_static(
656                "/acyclic.objects.v1.ObjectsService/ListObjects",
657            );
658            let mut req = request.into_request();
659            req.extensions_mut()
660                .insert(
661                    GrpcMethod::new("acyclic.objects.v1.ObjectsService", "ListObjects"),
662                );
663            self.inner.unary(req, path, codec).await
664        }
665    }
666}
667/// Generated server implementations.
668pub mod objects_service_server {
669    #![allow(
670        unused_variables,
671        dead_code,
672        missing_docs,
673        clippy::wildcard_imports,
674        clippy::let_unit_value,
675    )]
676    use tonic::codegen::*;
677    /// Generated trait containing gRPC methods that should be implemented for use with ObjectsServiceServer.
678    #[async_trait]
679    pub trait ObjectsService: std::marker::Send + std::marker::Sync + 'static {
680        async fn put_object(
681            &self,
682            request: tonic::Request<tonic::Streaming<super::PutObjectRequest>>,
683        ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status>;
684        /// Server streaming response type for the GetObject method.
685        type GetObjectStream: tonic::codegen::tokio_stream::Stream<
686                Item = std::result::Result<super::GetObjectResponse, tonic::Status>,
687            >
688            + std::marker::Send
689            + 'static;
690        async fn get_object(
691            &self,
692            request: tonic::Request<super::GetObjectRequest>,
693        ) -> std::result::Result<tonic::Response<Self::GetObjectStream>, tonic::Status>;
694        async fn head_object(
695            &self,
696            request: tonic::Request<super::HeadObjectRequest>,
697        ) -> std::result::Result<
698            tonic::Response<super::HeadObjectResponse>,
699            tonic::Status,
700        >;
701        async fn delete_object(
702            &self,
703            request: tonic::Request<super::DeleteObjectRequest>,
704        ) -> std::result::Result<
705            tonic::Response<super::DeleteObjectResponse>,
706            tonic::Status,
707        >;
708        async fn list_objects(
709            &self,
710            request: tonic::Request<super::ListObjectsRequest>,
711        ) -> std::result::Result<
712            tonic::Response<super::ListObjectsResponse>,
713            tonic::Status,
714        >;
715    }
716    #[derive(Debug)]
717    pub struct ObjectsServiceServer<T> {
718        inner: Arc<T>,
719        accept_compression_encodings: EnabledCompressionEncodings,
720        send_compression_encodings: EnabledCompressionEncodings,
721        max_decoding_message_size: Option<usize>,
722        max_encoding_message_size: Option<usize>,
723    }
724    impl<T> ObjectsServiceServer<T> {
725        pub fn new(inner: T) -> Self {
726            Self::from_arc(Arc::new(inner))
727        }
728        pub fn from_arc(inner: Arc<T>) -> Self {
729            Self {
730                inner,
731                accept_compression_encodings: Default::default(),
732                send_compression_encodings: Default::default(),
733                max_decoding_message_size: None,
734                max_encoding_message_size: None,
735            }
736        }
737        pub fn with_interceptor<F>(
738            inner: T,
739            interceptor: F,
740        ) -> InterceptedService<Self, F>
741        where
742            F: tonic::service::Interceptor,
743        {
744            InterceptedService::new(Self::new(inner), interceptor)
745        }
746        /// Enable decompressing requests with the given encoding.
747        #[must_use]
748        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
749            self.accept_compression_encodings.enable(encoding);
750            self
751        }
752        /// Compress responses with the given encoding, if the client supports it.
753        #[must_use]
754        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
755            self.send_compression_encodings.enable(encoding);
756            self
757        }
758        /// Limits the maximum size of a decoded message.
759        ///
760        /// Default: `4MB`
761        #[must_use]
762        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
763            self.max_decoding_message_size = Some(limit);
764            self
765        }
766        /// Limits the maximum size of an encoded message.
767        ///
768        /// Default: `usize::MAX`
769        #[must_use]
770        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
771            self.max_encoding_message_size = Some(limit);
772            self
773        }
774    }
775    impl<T, B> tonic::codegen::Service<http::Request<B>> for ObjectsServiceServer<T>
776    where
777        T: ObjectsService,
778        B: Body + std::marker::Send + 'static,
779        B::Error: Into<StdError> + std::marker::Send + 'static,
780    {
781        type Response = http::Response<tonic::body::Body>;
782        type Error = std::convert::Infallible;
783        type Future = BoxFuture<Self::Response, Self::Error>;
784        fn poll_ready(
785            &mut self,
786            _cx: &mut Context<'_>,
787        ) -> Poll<std::result::Result<(), Self::Error>> {
788            Poll::Ready(Ok(()))
789        }
790        fn call(&mut self, req: http::Request<B>) -> Self::Future {
791            match req.uri().path() {
792                "/acyclic.objects.v1.ObjectsService/PutObject" => {
793                    #[allow(non_camel_case_types)]
794                    struct PutObjectSvc<T: ObjectsService>(pub Arc<T>);
795                    impl<
796                        T: ObjectsService,
797                    > tonic::server::ClientStreamingService<super::PutObjectRequest>
798                    for PutObjectSvc<T> {
799                        type Response = super::ObjectVersion;
800                        type Future = BoxFuture<
801                            tonic::Response<Self::Response>,
802                            tonic::Status,
803                        >;
804                        fn call(
805                            &mut self,
806                            request: tonic::Request<
807                                tonic::Streaming<super::PutObjectRequest>,
808                            >,
809                        ) -> Self::Future {
810                            let inner = Arc::clone(&self.0);
811                            let fut = async move {
812                                <T as ObjectsService>::put_object(&inner, request).await
813                            };
814                            Box::pin(fut)
815                        }
816                    }
817                    let accept_compression_encodings = self.accept_compression_encodings;
818                    let send_compression_encodings = self.send_compression_encodings;
819                    let max_decoding_message_size = self.max_decoding_message_size;
820                    let max_encoding_message_size = self.max_encoding_message_size;
821                    let inner = self.inner.clone();
822                    let fut = async move {
823                        let method = PutObjectSvc(inner);
824                        let codec = tonic_prost::ProstCodec::default();
825                        let mut grpc = tonic::server::Grpc::new(codec)
826                            .apply_compression_config(
827                                accept_compression_encodings,
828                                send_compression_encodings,
829                            )
830                            .apply_max_message_size_config(
831                                max_decoding_message_size,
832                                max_encoding_message_size,
833                            );
834                        let res = grpc.client_streaming(method, req).await;
835                        Ok(res)
836                    };
837                    Box::pin(fut)
838                }
839                "/acyclic.objects.v1.ObjectsService/GetObject" => {
840                    #[allow(non_camel_case_types)]
841                    struct GetObjectSvc<T: ObjectsService>(pub Arc<T>);
842                    impl<
843                        T: ObjectsService,
844                    > tonic::server::ServerStreamingService<super::GetObjectRequest>
845                    for GetObjectSvc<T> {
846                        type Response = super::GetObjectResponse;
847                        type ResponseStream = T::GetObjectStream;
848                        type Future = BoxFuture<
849                            tonic::Response<Self::ResponseStream>,
850                            tonic::Status,
851                        >;
852                        fn call(
853                            &mut self,
854                            request: tonic::Request<super::GetObjectRequest>,
855                        ) -> Self::Future {
856                            let inner = Arc::clone(&self.0);
857                            let fut = async move {
858                                <T as ObjectsService>::get_object(&inner, request).await
859                            };
860                            Box::pin(fut)
861                        }
862                    }
863                    let accept_compression_encodings = self.accept_compression_encodings;
864                    let send_compression_encodings = self.send_compression_encodings;
865                    let max_decoding_message_size = self.max_decoding_message_size;
866                    let max_encoding_message_size = self.max_encoding_message_size;
867                    let inner = self.inner.clone();
868                    let fut = async move {
869                        let method = GetObjectSvc(inner);
870                        let codec = tonic_prost::ProstCodec::default();
871                        let mut grpc = tonic::server::Grpc::new(codec)
872                            .apply_compression_config(
873                                accept_compression_encodings,
874                                send_compression_encodings,
875                            )
876                            .apply_max_message_size_config(
877                                max_decoding_message_size,
878                                max_encoding_message_size,
879                            );
880                        let res = grpc.server_streaming(method, req).await;
881                        Ok(res)
882                    };
883                    Box::pin(fut)
884                }
885                "/acyclic.objects.v1.ObjectsService/HeadObject" => {
886                    #[allow(non_camel_case_types)]
887                    struct HeadObjectSvc<T: ObjectsService>(pub Arc<T>);
888                    impl<
889                        T: ObjectsService,
890                    > tonic::server::UnaryService<super::HeadObjectRequest>
891                    for HeadObjectSvc<T> {
892                        type Response = super::HeadObjectResponse;
893                        type Future = BoxFuture<
894                            tonic::Response<Self::Response>,
895                            tonic::Status,
896                        >;
897                        fn call(
898                            &mut self,
899                            request: tonic::Request<super::HeadObjectRequest>,
900                        ) -> Self::Future {
901                            let inner = Arc::clone(&self.0);
902                            let fut = async move {
903                                <T as ObjectsService>::head_object(&inner, request).await
904                            };
905                            Box::pin(fut)
906                        }
907                    }
908                    let accept_compression_encodings = self.accept_compression_encodings;
909                    let send_compression_encodings = self.send_compression_encodings;
910                    let max_decoding_message_size = self.max_decoding_message_size;
911                    let max_encoding_message_size = self.max_encoding_message_size;
912                    let inner = self.inner.clone();
913                    let fut = async move {
914                        let method = HeadObjectSvc(inner);
915                        let codec = tonic_prost::ProstCodec::default();
916                        let mut grpc = tonic::server::Grpc::new(codec)
917                            .apply_compression_config(
918                                accept_compression_encodings,
919                                send_compression_encodings,
920                            )
921                            .apply_max_message_size_config(
922                                max_decoding_message_size,
923                                max_encoding_message_size,
924                            );
925                        let res = grpc.unary(method, req).await;
926                        Ok(res)
927                    };
928                    Box::pin(fut)
929                }
930                "/acyclic.objects.v1.ObjectsService/DeleteObject" => {
931                    #[allow(non_camel_case_types)]
932                    struct DeleteObjectSvc<T: ObjectsService>(pub Arc<T>);
933                    impl<
934                        T: ObjectsService,
935                    > tonic::server::UnaryService<super::DeleteObjectRequest>
936                    for DeleteObjectSvc<T> {
937                        type Response = super::DeleteObjectResponse;
938                        type Future = BoxFuture<
939                            tonic::Response<Self::Response>,
940                            tonic::Status,
941                        >;
942                        fn call(
943                            &mut self,
944                            request: tonic::Request<super::DeleteObjectRequest>,
945                        ) -> Self::Future {
946                            let inner = Arc::clone(&self.0);
947                            let fut = async move {
948                                <T as ObjectsService>::delete_object(&inner, request).await
949                            };
950                            Box::pin(fut)
951                        }
952                    }
953                    let accept_compression_encodings = self.accept_compression_encodings;
954                    let send_compression_encodings = self.send_compression_encodings;
955                    let max_decoding_message_size = self.max_decoding_message_size;
956                    let max_encoding_message_size = self.max_encoding_message_size;
957                    let inner = self.inner.clone();
958                    let fut = async move {
959                        let method = DeleteObjectSvc(inner);
960                        let codec = tonic_prost::ProstCodec::default();
961                        let mut grpc = tonic::server::Grpc::new(codec)
962                            .apply_compression_config(
963                                accept_compression_encodings,
964                                send_compression_encodings,
965                            )
966                            .apply_max_message_size_config(
967                                max_decoding_message_size,
968                                max_encoding_message_size,
969                            );
970                        let res = grpc.unary(method, req).await;
971                        Ok(res)
972                    };
973                    Box::pin(fut)
974                }
975                "/acyclic.objects.v1.ObjectsService/ListObjects" => {
976                    #[allow(non_camel_case_types)]
977                    struct ListObjectsSvc<T: ObjectsService>(pub Arc<T>);
978                    impl<
979                        T: ObjectsService,
980                    > tonic::server::UnaryService<super::ListObjectsRequest>
981                    for ListObjectsSvc<T> {
982                        type Response = super::ListObjectsResponse;
983                        type Future = BoxFuture<
984                            tonic::Response<Self::Response>,
985                            tonic::Status,
986                        >;
987                        fn call(
988                            &mut self,
989                            request: tonic::Request<super::ListObjectsRequest>,
990                        ) -> Self::Future {
991                            let inner = Arc::clone(&self.0);
992                            let fut = async move {
993                                <T as ObjectsService>::list_objects(&inner, request).await
994                            };
995                            Box::pin(fut)
996                        }
997                    }
998                    let accept_compression_encodings = self.accept_compression_encodings;
999                    let send_compression_encodings = self.send_compression_encodings;
1000                    let max_decoding_message_size = self.max_decoding_message_size;
1001                    let max_encoding_message_size = self.max_encoding_message_size;
1002                    let inner = self.inner.clone();
1003                    let fut = async move {
1004                        let method = ListObjectsSvc(inner);
1005                        let codec = tonic_prost::ProstCodec::default();
1006                        let mut grpc = tonic::server::Grpc::new(codec)
1007                            .apply_compression_config(
1008                                accept_compression_encodings,
1009                                send_compression_encodings,
1010                            )
1011                            .apply_max_message_size_config(
1012                                max_decoding_message_size,
1013                                max_encoding_message_size,
1014                            );
1015                        let res = grpc.unary(method, req).await;
1016                        Ok(res)
1017                    };
1018                    Box::pin(fut)
1019                }
1020                _ => {
1021                    Box::pin(async move {
1022                        let mut response = http::Response::new(
1023                            tonic::body::Body::default(),
1024                        );
1025                        let headers = response.headers_mut();
1026                        headers
1027                            .insert(
1028                                tonic::Status::GRPC_STATUS,
1029                                (tonic::Code::Unimplemented as i32).into(),
1030                            );
1031                        headers
1032                            .insert(
1033                                http::header::CONTENT_TYPE,
1034                                tonic::metadata::GRPC_CONTENT_TYPE,
1035                            );
1036                        Ok(response)
1037                    })
1038                }
1039            }
1040        }
1041    }
1042    impl<T> Clone for ObjectsServiceServer<T> {
1043        fn clone(&self) -> Self {
1044            let inner = self.inner.clone();
1045            Self {
1046                inner,
1047                accept_compression_encodings: self.accept_compression_encodings,
1048                send_compression_encodings: self.send_compression_encodings,
1049                max_decoding_message_size: self.max_decoding_message_size,
1050                max_encoding_message_size: self.max_encoding_message_size,
1051            }
1052        }
1053    }
1054    /// Generated gRPC service name
1055    pub const SERVICE_NAME: &str = "acyclic.objects.v1.ObjectsService";
1056    impl<T> tonic::server::NamedService for ObjectsServiceServer<T> {
1057        const NAME: &'static str = SERVICE_NAME;
1058    }
1059}
1060/// Generated client implementations.
1061pub mod multipart_service_client {
1062    #![allow(
1063        unused_variables,
1064        dead_code,
1065        missing_docs,
1066        clippy::wildcard_imports,
1067        clippy::let_unit_value,
1068    )]
1069    use tonic::codegen::*;
1070    use tonic::codegen::http::Uri;
1071    #[derive(Debug, Clone)]
1072    pub struct MultipartServiceClient<T> {
1073        inner: tonic::client::Grpc<T>,
1074    }
1075    impl MultipartServiceClient<tonic::transport::Channel> {
1076        /// Attempt to create a new client by connecting to a given endpoint.
1077        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1078        where
1079            D: TryInto<tonic::transport::Endpoint>,
1080            D::Error: Into<StdError>,
1081        {
1082            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1083            Ok(Self::new(conn))
1084        }
1085    }
1086    impl<T> MultipartServiceClient<T>
1087    where
1088        T: tonic::client::GrpcService<tonic::body::Body>,
1089        T::Error: Into<StdError>,
1090        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1091        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1092    {
1093        pub fn new(inner: T) -> Self {
1094            let inner = tonic::client::Grpc::new(inner);
1095            Self { inner }
1096        }
1097        pub fn with_origin(inner: T, origin: Uri) -> Self {
1098            let inner = tonic::client::Grpc::with_origin(inner, origin);
1099            Self { inner }
1100        }
1101        pub fn with_interceptor<F>(
1102            inner: T,
1103            interceptor: F,
1104        ) -> MultipartServiceClient<InterceptedService<T, F>>
1105        where
1106            F: tonic::service::Interceptor,
1107            T::ResponseBody: Default,
1108            T: tonic::codegen::Service<
1109                http::Request<tonic::body::Body>,
1110                Response = http::Response<
1111                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1112                >,
1113            >,
1114            <T as tonic::codegen::Service<
1115                http::Request<tonic::body::Body>,
1116            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1117        {
1118            MultipartServiceClient::new(InterceptedService::new(inner, interceptor))
1119        }
1120        /// Compress requests with the given encoding.
1121        ///
1122        /// This requires the server to support it otherwise it might respond with an
1123        /// error.
1124        #[must_use]
1125        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1126            self.inner = self.inner.send_compressed(encoding);
1127            self
1128        }
1129        /// Enable decompressing responses.
1130        #[must_use]
1131        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1132            self.inner = self.inner.accept_compressed(encoding);
1133            self
1134        }
1135        /// Limits the maximum size of a decoded message.
1136        ///
1137        /// Default: `4MB`
1138        #[must_use]
1139        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1140            self.inner = self.inner.max_decoding_message_size(limit);
1141            self
1142        }
1143        /// Limits the maximum size of an encoded message.
1144        ///
1145        /// Default: `usize::MAX`
1146        #[must_use]
1147        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1148            self.inner = self.inner.max_encoding_message_size(limit);
1149            self
1150        }
1151        pub async fn create_multipart(
1152            &mut self,
1153            request: impl tonic::IntoRequest<super::CreateMultipartRequest>,
1154        ) -> std::result::Result<
1155            tonic::Response<super::MultipartUpload>,
1156            tonic::Status,
1157        > {
1158            self.inner
1159                .ready()
1160                .await
1161                .map_err(|e| {
1162                    tonic::Status::unknown(
1163                        format!("Service was not ready: {}", e.into()),
1164                    )
1165                })?;
1166            let codec = tonic_prost::ProstCodec::default();
1167            let path = http::uri::PathAndQuery::from_static(
1168                "/acyclic.objects.v1.MultipartService/CreateMultipart",
1169            );
1170            let mut req = request.into_request();
1171            req.extensions_mut()
1172                .insert(
1173                    GrpcMethod::new(
1174                        "acyclic.objects.v1.MultipartService",
1175                        "CreateMultipart",
1176                    ),
1177                );
1178            self.inner.unary(req, path, codec).await
1179        }
1180        pub async fn upload_part(
1181            &mut self,
1182            request: impl tonic::IntoStreamingRequest<Message = super::UploadPartRequest>,
1183        ) -> std::result::Result<tonic::Response<super::UploadedPart>, tonic::Status> {
1184            self.inner
1185                .ready()
1186                .await
1187                .map_err(|e| {
1188                    tonic::Status::unknown(
1189                        format!("Service was not ready: {}", e.into()),
1190                    )
1191                })?;
1192            let codec = tonic_prost::ProstCodec::default();
1193            let path = http::uri::PathAndQuery::from_static(
1194                "/acyclic.objects.v1.MultipartService/UploadPart",
1195            );
1196            let mut req = request.into_streaming_request();
1197            req.extensions_mut()
1198                .insert(
1199                    GrpcMethod::new("acyclic.objects.v1.MultipartService", "UploadPart"),
1200                );
1201            self.inner.client_streaming(req, path, codec).await
1202        }
1203        pub async fn list_parts(
1204            &mut self,
1205            request: impl tonic::IntoRequest<super::ListPartsRequest>,
1206        ) -> std::result::Result<
1207            tonic::Response<super::ListPartsResponse>,
1208            tonic::Status,
1209        > {
1210            self.inner
1211                .ready()
1212                .await
1213                .map_err(|e| {
1214                    tonic::Status::unknown(
1215                        format!("Service was not ready: {}", e.into()),
1216                    )
1217                })?;
1218            let codec = tonic_prost::ProstCodec::default();
1219            let path = http::uri::PathAndQuery::from_static(
1220                "/acyclic.objects.v1.MultipartService/ListParts",
1221            );
1222            let mut req = request.into_request();
1223            req.extensions_mut()
1224                .insert(
1225                    GrpcMethod::new("acyclic.objects.v1.MultipartService", "ListParts"),
1226                );
1227            self.inner.unary(req, path, codec).await
1228        }
1229        pub async fn complete_multipart(
1230            &mut self,
1231            request: impl tonic::IntoRequest<super::CompleteMultipartRequest>,
1232        ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status> {
1233            self.inner
1234                .ready()
1235                .await
1236                .map_err(|e| {
1237                    tonic::Status::unknown(
1238                        format!("Service was not ready: {}", e.into()),
1239                    )
1240                })?;
1241            let codec = tonic_prost::ProstCodec::default();
1242            let path = http::uri::PathAndQuery::from_static(
1243                "/acyclic.objects.v1.MultipartService/CompleteMultipart",
1244            );
1245            let mut req = request.into_request();
1246            req.extensions_mut()
1247                .insert(
1248                    GrpcMethod::new(
1249                        "acyclic.objects.v1.MultipartService",
1250                        "CompleteMultipart",
1251                    ),
1252                );
1253            self.inner.unary(req, path, codec).await
1254        }
1255        pub async fn abort_multipart(
1256            &mut self,
1257            request: impl tonic::IntoRequest<super::AbortMultipartRequest>,
1258        ) -> std::result::Result<
1259            tonic::Response<super::AbortMultipartResponse>,
1260            tonic::Status,
1261        > {
1262            self.inner
1263                .ready()
1264                .await
1265                .map_err(|e| {
1266                    tonic::Status::unknown(
1267                        format!("Service was not ready: {}", e.into()),
1268                    )
1269                })?;
1270            let codec = tonic_prost::ProstCodec::default();
1271            let path = http::uri::PathAndQuery::from_static(
1272                "/acyclic.objects.v1.MultipartService/AbortMultipart",
1273            );
1274            let mut req = request.into_request();
1275            req.extensions_mut()
1276                .insert(
1277                    GrpcMethod::new(
1278                        "acyclic.objects.v1.MultipartService",
1279                        "AbortMultipart",
1280                    ),
1281                );
1282            self.inner.unary(req, path, codec).await
1283        }
1284    }
1285}
1286/// Generated server implementations.
1287pub mod multipart_service_server {
1288    #![allow(
1289        unused_variables,
1290        dead_code,
1291        missing_docs,
1292        clippy::wildcard_imports,
1293        clippy::let_unit_value,
1294    )]
1295    use tonic::codegen::*;
1296    /// Generated trait containing gRPC methods that should be implemented for use with MultipartServiceServer.
1297    #[async_trait]
1298    pub trait MultipartService: std::marker::Send + std::marker::Sync + 'static {
1299        async fn create_multipart(
1300            &self,
1301            request: tonic::Request<super::CreateMultipartRequest>,
1302        ) -> std::result::Result<tonic::Response<super::MultipartUpload>, tonic::Status>;
1303        async fn upload_part(
1304            &self,
1305            request: tonic::Request<tonic::Streaming<super::UploadPartRequest>>,
1306        ) -> std::result::Result<tonic::Response<super::UploadedPart>, tonic::Status>;
1307        async fn list_parts(
1308            &self,
1309            request: tonic::Request<super::ListPartsRequest>,
1310        ) -> std::result::Result<
1311            tonic::Response<super::ListPartsResponse>,
1312            tonic::Status,
1313        >;
1314        async fn complete_multipart(
1315            &self,
1316            request: tonic::Request<super::CompleteMultipartRequest>,
1317        ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status>;
1318        async fn abort_multipart(
1319            &self,
1320            request: tonic::Request<super::AbortMultipartRequest>,
1321        ) -> std::result::Result<
1322            tonic::Response<super::AbortMultipartResponse>,
1323            tonic::Status,
1324        >;
1325    }
1326    #[derive(Debug)]
1327    pub struct MultipartServiceServer<T> {
1328        inner: Arc<T>,
1329        accept_compression_encodings: EnabledCompressionEncodings,
1330        send_compression_encodings: EnabledCompressionEncodings,
1331        max_decoding_message_size: Option<usize>,
1332        max_encoding_message_size: Option<usize>,
1333    }
1334    impl<T> MultipartServiceServer<T> {
1335        pub fn new(inner: T) -> Self {
1336            Self::from_arc(Arc::new(inner))
1337        }
1338        pub fn from_arc(inner: Arc<T>) -> Self {
1339            Self {
1340                inner,
1341                accept_compression_encodings: Default::default(),
1342                send_compression_encodings: Default::default(),
1343                max_decoding_message_size: None,
1344                max_encoding_message_size: None,
1345            }
1346        }
1347        pub fn with_interceptor<F>(
1348            inner: T,
1349            interceptor: F,
1350        ) -> InterceptedService<Self, F>
1351        where
1352            F: tonic::service::Interceptor,
1353        {
1354            InterceptedService::new(Self::new(inner), interceptor)
1355        }
1356        /// Enable decompressing requests with the given encoding.
1357        #[must_use]
1358        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1359            self.accept_compression_encodings.enable(encoding);
1360            self
1361        }
1362        /// Compress responses with the given encoding, if the client supports it.
1363        #[must_use]
1364        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1365            self.send_compression_encodings.enable(encoding);
1366            self
1367        }
1368        /// Limits the maximum size of a decoded message.
1369        ///
1370        /// Default: `4MB`
1371        #[must_use]
1372        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1373            self.max_decoding_message_size = Some(limit);
1374            self
1375        }
1376        /// Limits the maximum size of an encoded message.
1377        ///
1378        /// Default: `usize::MAX`
1379        #[must_use]
1380        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1381            self.max_encoding_message_size = Some(limit);
1382            self
1383        }
1384    }
1385    impl<T, B> tonic::codegen::Service<http::Request<B>> for MultipartServiceServer<T>
1386    where
1387        T: MultipartService,
1388        B: Body + std::marker::Send + 'static,
1389        B::Error: Into<StdError> + std::marker::Send + 'static,
1390    {
1391        type Response = http::Response<tonic::body::Body>;
1392        type Error = std::convert::Infallible;
1393        type Future = BoxFuture<Self::Response, Self::Error>;
1394        fn poll_ready(
1395            &mut self,
1396            _cx: &mut Context<'_>,
1397        ) -> Poll<std::result::Result<(), Self::Error>> {
1398            Poll::Ready(Ok(()))
1399        }
1400        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1401            match req.uri().path() {
1402                "/acyclic.objects.v1.MultipartService/CreateMultipart" => {
1403                    #[allow(non_camel_case_types)]
1404                    struct CreateMultipartSvc<T: MultipartService>(pub Arc<T>);
1405                    impl<
1406                        T: MultipartService,
1407                    > tonic::server::UnaryService<super::CreateMultipartRequest>
1408                    for CreateMultipartSvc<T> {
1409                        type Response = super::MultipartUpload;
1410                        type Future = BoxFuture<
1411                            tonic::Response<Self::Response>,
1412                            tonic::Status,
1413                        >;
1414                        fn call(
1415                            &mut self,
1416                            request: tonic::Request<super::CreateMultipartRequest>,
1417                        ) -> Self::Future {
1418                            let inner = Arc::clone(&self.0);
1419                            let fut = async move {
1420                                <T as MultipartService>::create_multipart(&inner, request)
1421                                    .await
1422                            };
1423                            Box::pin(fut)
1424                        }
1425                    }
1426                    let accept_compression_encodings = self.accept_compression_encodings;
1427                    let send_compression_encodings = self.send_compression_encodings;
1428                    let max_decoding_message_size = self.max_decoding_message_size;
1429                    let max_encoding_message_size = self.max_encoding_message_size;
1430                    let inner = self.inner.clone();
1431                    let fut = async move {
1432                        let method = CreateMultipartSvc(inner);
1433                        let codec = tonic_prost::ProstCodec::default();
1434                        let mut grpc = tonic::server::Grpc::new(codec)
1435                            .apply_compression_config(
1436                                accept_compression_encodings,
1437                                send_compression_encodings,
1438                            )
1439                            .apply_max_message_size_config(
1440                                max_decoding_message_size,
1441                                max_encoding_message_size,
1442                            );
1443                        let res = grpc.unary(method, req).await;
1444                        Ok(res)
1445                    };
1446                    Box::pin(fut)
1447                }
1448                "/acyclic.objects.v1.MultipartService/UploadPart" => {
1449                    #[allow(non_camel_case_types)]
1450                    struct UploadPartSvc<T: MultipartService>(pub Arc<T>);
1451                    impl<
1452                        T: MultipartService,
1453                    > tonic::server::ClientStreamingService<super::UploadPartRequest>
1454                    for UploadPartSvc<T> {
1455                        type Response = super::UploadedPart;
1456                        type Future = BoxFuture<
1457                            tonic::Response<Self::Response>,
1458                            tonic::Status,
1459                        >;
1460                        fn call(
1461                            &mut self,
1462                            request: tonic::Request<
1463                                tonic::Streaming<super::UploadPartRequest>,
1464                            >,
1465                        ) -> Self::Future {
1466                            let inner = Arc::clone(&self.0);
1467                            let fut = async move {
1468                                <T as MultipartService>::upload_part(&inner, request).await
1469                            };
1470                            Box::pin(fut)
1471                        }
1472                    }
1473                    let accept_compression_encodings = self.accept_compression_encodings;
1474                    let send_compression_encodings = self.send_compression_encodings;
1475                    let max_decoding_message_size = self.max_decoding_message_size;
1476                    let max_encoding_message_size = self.max_encoding_message_size;
1477                    let inner = self.inner.clone();
1478                    let fut = async move {
1479                        let method = UploadPartSvc(inner);
1480                        let codec = tonic_prost::ProstCodec::default();
1481                        let mut grpc = tonic::server::Grpc::new(codec)
1482                            .apply_compression_config(
1483                                accept_compression_encodings,
1484                                send_compression_encodings,
1485                            )
1486                            .apply_max_message_size_config(
1487                                max_decoding_message_size,
1488                                max_encoding_message_size,
1489                            );
1490                        let res = grpc.client_streaming(method, req).await;
1491                        Ok(res)
1492                    };
1493                    Box::pin(fut)
1494                }
1495                "/acyclic.objects.v1.MultipartService/ListParts" => {
1496                    #[allow(non_camel_case_types)]
1497                    struct ListPartsSvc<T: MultipartService>(pub Arc<T>);
1498                    impl<
1499                        T: MultipartService,
1500                    > tonic::server::UnaryService<super::ListPartsRequest>
1501                    for ListPartsSvc<T> {
1502                        type Response = super::ListPartsResponse;
1503                        type Future = BoxFuture<
1504                            tonic::Response<Self::Response>,
1505                            tonic::Status,
1506                        >;
1507                        fn call(
1508                            &mut self,
1509                            request: tonic::Request<super::ListPartsRequest>,
1510                        ) -> Self::Future {
1511                            let inner = Arc::clone(&self.0);
1512                            let fut = async move {
1513                                <T as MultipartService>::list_parts(&inner, request).await
1514                            };
1515                            Box::pin(fut)
1516                        }
1517                    }
1518                    let accept_compression_encodings = self.accept_compression_encodings;
1519                    let send_compression_encodings = self.send_compression_encodings;
1520                    let max_decoding_message_size = self.max_decoding_message_size;
1521                    let max_encoding_message_size = self.max_encoding_message_size;
1522                    let inner = self.inner.clone();
1523                    let fut = async move {
1524                        let method = ListPartsSvc(inner);
1525                        let codec = tonic_prost::ProstCodec::default();
1526                        let mut grpc = tonic::server::Grpc::new(codec)
1527                            .apply_compression_config(
1528                                accept_compression_encodings,
1529                                send_compression_encodings,
1530                            )
1531                            .apply_max_message_size_config(
1532                                max_decoding_message_size,
1533                                max_encoding_message_size,
1534                            );
1535                        let res = grpc.unary(method, req).await;
1536                        Ok(res)
1537                    };
1538                    Box::pin(fut)
1539                }
1540                "/acyclic.objects.v1.MultipartService/CompleteMultipart" => {
1541                    #[allow(non_camel_case_types)]
1542                    struct CompleteMultipartSvc<T: MultipartService>(pub Arc<T>);
1543                    impl<
1544                        T: MultipartService,
1545                    > tonic::server::UnaryService<super::CompleteMultipartRequest>
1546                    for CompleteMultipartSvc<T> {
1547                        type Response = super::ObjectVersion;
1548                        type Future = BoxFuture<
1549                            tonic::Response<Self::Response>,
1550                            tonic::Status,
1551                        >;
1552                        fn call(
1553                            &mut self,
1554                            request: tonic::Request<super::CompleteMultipartRequest>,
1555                        ) -> Self::Future {
1556                            let inner = Arc::clone(&self.0);
1557                            let fut = async move {
1558                                <T as MultipartService>::complete_multipart(&inner, request)
1559                                    .await
1560                            };
1561                            Box::pin(fut)
1562                        }
1563                    }
1564                    let accept_compression_encodings = self.accept_compression_encodings;
1565                    let send_compression_encodings = self.send_compression_encodings;
1566                    let max_decoding_message_size = self.max_decoding_message_size;
1567                    let max_encoding_message_size = self.max_encoding_message_size;
1568                    let inner = self.inner.clone();
1569                    let fut = async move {
1570                        let method = CompleteMultipartSvc(inner);
1571                        let codec = tonic_prost::ProstCodec::default();
1572                        let mut grpc = tonic::server::Grpc::new(codec)
1573                            .apply_compression_config(
1574                                accept_compression_encodings,
1575                                send_compression_encodings,
1576                            )
1577                            .apply_max_message_size_config(
1578                                max_decoding_message_size,
1579                                max_encoding_message_size,
1580                            );
1581                        let res = grpc.unary(method, req).await;
1582                        Ok(res)
1583                    };
1584                    Box::pin(fut)
1585                }
1586                "/acyclic.objects.v1.MultipartService/AbortMultipart" => {
1587                    #[allow(non_camel_case_types)]
1588                    struct AbortMultipartSvc<T: MultipartService>(pub Arc<T>);
1589                    impl<
1590                        T: MultipartService,
1591                    > tonic::server::UnaryService<super::AbortMultipartRequest>
1592                    for AbortMultipartSvc<T> {
1593                        type Response = super::AbortMultipartResponse;
1594                        type Future = BoxFuture<
1595                            tonic::Response<Self::Response>,
1596                            tonic::Status,
1597                        >;
1598                        fn call(
1599                            &mut self,
1600                            request: tonic::Request<super::AbortMultipartRequest>,
1601                        ) -> Self::Future {
1602                            let inner = Arc::clone(&self.0);
1603                            let fut = async move {
1604                                <T as MultipartService>::abort_multipart(&inner, request)
1605                                    .await
1606                            };
1607                            Box::pin(fut)
1608                        }
1609                    }
1610                    let accept_compression_encodings = self.accept_compression_encodings;
1611                    let send_compression_encodings = self.send_compression_encodings;
1612                    let max_decoding_message_size = self.max_decoding_message_size;
1613                    let max_encoding_message_size = self.max_encoding_message_size;
1614                    let inner = self.inner.clone();
1615                    let fut = async move {
1616                        let method = AbortMultipartSvc(inner);
1617                        let codec = tonic_prost::ProstCodec::default();
1618                        let mut grpc = tonic::server::Grpc::new(codec)
1619                            .apply_compression_config(
1620                                accept_compression_encodings,
1621                                send_compression_encodings,
1622                            )
1623                            .apply_max_message_size_config(
1624                                max_decoding_message_size,
1625                                max_encoding_message_size,
1626                            );
1627                        let res = grpc.unary(method, req).await;
1628                        Ok(res)
1629                    };
1630                    Box::pin(fut)
1631                }
1632                _ => {
1633                    Box::pin(async move {
1634                        let mut response = http::Response::new(
1635                            tonic::body::Body::default(),
1636                        );
1637                        let headers = response.headers_mut();
1638                        headers
1639                            .insert(
1640                                tonic::Status::GRPC_STATUS,
1641                                (tonic::Code::Unimplemented as i32).into(),
1642                            );
1643                        headers
1644                            .insert(
1645                                http::header::CONTENT_TYPE,
1646                                tonic::metadata::GRPC_CONTENT_TYPE,
1647                            );
1648                        Ok(response)
1649                    })
1650                }
1651            }
1652        }
1653    }
1654    impl<T> Clone for MultipartServiceServer<T> {
1655        fn clone(&self) -> Self {
1656            let inner = self.inner.clone();
1657            Self {
1658                inner,
1659                accept_compression_encodings: self.accept_compression_encodings,
1660                send_compression_encodings: self.send_compression_encodings,
1661                max_decoding_message_size: self.max_decoding_message_size,
1662                max_encoding_message_size: self.max_encoding_message_size,
1663            }
1664        }
1665    }
1666    /// Generated gRPC service name
1667    pub const SERVICE_NAME: &str = "acyclic.objects.v1.MultipartService";
1668    impl<T> tonic::server::NamedService for MultipartServiceServer<T> {
1669        const NAME: &'static str = SERVICE_NAME;
1670    }
1671}
1672/// Generated client implementations.
1673pub mod snapshots_service_client {
1674    #![allow(
1675        unused_variables,
1676        dead_code,
1677        missing_docs,
1678        clippy::wildcard_imports,
1679        clippy::let_unit_value,
1680    )]
1681    use tonic::codegen::*;
1682    use tonic::codegen::http::Uri;
1683    ///
1684    #[derive(Debug, Clone)]
1685    pub struct SnapshotsServiceClient<T> {
1686        inner: tonic::client::Grpc<T>,
1687    }
1688    impl SnapshotsServiceClient<tonic::transport::Channel> {
1689        /// Attempt to create a new client by connecting to a given endpoint.
1690        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1691        where
1692            D: TryInto<tonic::transport::Endpoint>,
1693            D::Error: Into<StdError>,
1694        {
1695            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1696            Ok(Self::new(conn))
1697        }
1698    }
1699    impl<T> SnapshotsServiceClient<T>
1700    where
1701        T: tonic::client::GrpcService<tonic::body::Body>,
1702        T::Error: Into<StdError>,
1703        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1704        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1705    {
1706        pub fn new(inner: T) -> Self {
1707            let inner = tonic::client::Grpc::new(inner);
1708            Self { inner }
1709        }
1710        pub fn with_origin(inner: T, origin: Uri) -> Self {
1711            let inner = tonic::client::Grpc::with_origin(inner, origin);
1712            Self { inner }
1713        }
1714        pub fn with_interceptor<F>(
1715            inner: T,
1716            interceptor: F,
1717        ) -> SnapshotsServiceClient<InterceptedService<T, F>>
1718        where
1719            F: tonic::service::Interceptor,
1720            T::ResponseBody: Default,
1721            T: tonic::codegen::Service<
1722                http::Request<tonic::body::Body>,
1723                Response = http::Response<
1724                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1725                >,
1726            >,
1727            <T as tonic::codegen::Service<
1728                http::Request<tonic::body::Body>,
1729            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1730        {
1731            SnapshotsServiceClient::new(InterceptedService::new(inner, interceptor))
1732        }
1733        /// Compress requests with the given encoding.
1734        ///
1735        /// This requires the server to support it otherwise it might respond with an
1736        /// error.
1737        #[must_use]
1738        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1739            self.inner = self.inner.send_compressed(encoding);
1740            self
1741        }
1742        /// Enable decompressing responses.
1743        #[must_use]
1744        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1745            self.inner = self.inner.accept_compressed(encoding);
1746            self
1747        }
1748        /// Limits the maximum size of a decoded message.
1749        ///
1750        /// Default: `4MB`
1751        #[must_use]
1752        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1753            self.inner = self.inner.max_decoding_message_size(limit);
1754            self
1755        }
1756        /// Limits the maximum size of an encoded message.
1757        ///
1758        /// Default: `usize::MAX`
1759        #[must_use]
1760        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1761            self.inner = self.inner.max_encoding_message_size(limit);
1762            self
1763        }
1764        ///
1765        pub async fn create_snapshot(
1766            &mut self,
1767            request: impl tonic::IntoRequest<super::CreateSnapshotRequest>,
1768        ) -> std::result::Result<tonic::Response<super::Snapshot>, tonic::Status> {
1769            self.inner
1770                .ready()
1771                .await
1772                .map_err(|e| {
1773                    tonic::Status::unknown(
1774                        format!("Service was not ready: {}", e.into()),
1775                    )
1776                })?;
1777            let codec = tonic_prost::ProstCodec::default();
1778            let path = http::uri::PathAndQuery::from_static(
1779                "/acyclic.objects.v1.SnapshotsService/CreateSnapshot",
1780            );
1781            let mut req = request.into_request();
1782            req.extensions_mut()
1783                .insert(
1784                    GrpcMethod::new(
1785                        "acyclic.objects.v1.SnapshotsService",
1786                        "CreateSnapshot",
1787                    ),
1788                );
1789            self.inner.unary(req, path, codec).await
1790        }
1791        ///
1792        pub async fn destroy_snapshot(
1793            &mut self,
1794            request: impl tonic::IntoRequest<super::DestroySnapshotRequest>,
1795        ) -> std::result::Result<
1796            tonic::Response<super::DestroySnapshotResponse>,
1797            tonic::Status,
1798        > {
1799            self.inner
1800                .ready()
1801                .await
1802                .map_err(|e| {
1803                    tonic::Status::unknown(
1804                        format!("Service was not ready: {}", e.into()),
1805                    )
1806                })?;
1807            let codec = tonic_prost::ProstCodec::default();
1808            let path = http::uri::PathAndQuery::from_static(
1809                "/acyclic.objects.v1.SnapshotsService/DestroySnapshot",
1810            );
1811            let mut req = request.into_request();
1812            req.extensions_mut()
1813                .insert(
1814                    GrpcMethod::new(
1815                        "acyclic.objects.v1.SnapshotsService",
1816                        "DestroySnapshot",
1817                    ),
1818                );
1819            self.inner.unary(req, path, codec).await
1820        }
1821        ///
1822        pub async fn fork_snapshot(
1823            &mut self,
1824            request: impl tonic::IntoRequest<super::ForkSnapshotRequest>,
1825        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
1826            self.inner
1827                .ready()
1828                .await
1829                .map_err(|e| {
1830                    tonic::Status::unknown(
1831                        format!("Service was not ready: {}", e.into()),
1832                    )
1833                })?;
1834            let codec = tonic_prost::ProstCodec::default();
1835            let path = http::uri::PathAndQuery::from_static(
1836                "/acyclic.objects.v1.SnapshotsService/ForkSnapshot",
1837            );
1838            let mut req = request.into_request();
1839            req.extensions_mut()
1840                .insert(
1841                    GrpcMethod::new(
1842                        "acyclic.objects.v1.SnapshotsService",
1843                        "ForkSnapshot",
1844                    ),
1845                );
1846            self.inner.unary(req, path, codec).await
1847        }
1848        ///
1849        pub async fn fork_bucket(
1850            &mut self,
1851            request: impl tonic::IntoRequest<super::ForkBucketRequest>,
1852        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
1853            self.inner
1854                .ready()
1855                .await
1856                .map_err(|e| {
1857                    tonic::Status::unknown(
1858                        format!("Service was not ready: {}", e.into()),
1859                    )
1860                })?;
1861            let codec = tonic_prost::ProstCodec::default();
1862            let path = http::uri::PathAndQuery::from_static(
1863                "/acyclic.objects.v1.SnapshotsService/ForkBucket",
1864            );
1865            let mut req = request.into_request();
1866            req.extensions_mut()
1867                .insert(
1868                    GrpcMethod::new("acyclic.objects.v1.SnapshotsService", "ForkBucket"),
1869                );
1870            self.inner.unary(req, path, codec).await
1871        }
1872    }
1873}
1874/// Generated server implementations.
1875pub mod snapshots_service_server {
1876    #![allow(
1877        unused_variables,
1878        dead_code,
1879        missing_docs,
1880        clippy::wildcard_imports,
1881        clippy::let_unit_value,
1882    )]
1883    use tonic::codegen::*;
1884    /// Generated trait containing gRPC methods that should be implemented for use with SnapshotsServiceServer.
1885    #[async_trait]
1886    pub trait SnapshotsService: std::marker::Send + std::marker::Sync + 'static {
1887        ///
1888        async fn create_snapshot(
1889            &self,
1890            request: tonic::Request<super::CreateSnapshotRequest>,
1891        ) -> std::result::Result<tonic::Response<super::Snapshot>, tonic::Status>;
1892        ///
1893        async fn destroy_snapshot(
1894            &self,
1895            request: tonic::Request<super::DestroySnapshotRequest>,
1896        ) -> std::result::Result<
1897            tonic::Response<super::DestroySnapshotResponse>,
1898            tonic::Status,
1899        >;
1900        ///
1901        async fn fork_snapshot(
1902            &self,
1903            request: tonic::Request<super::ForkSnapshotRequest>,
1904        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
1905        ///
1906        async fn fork_bucket(
1907            &self,
1908            request: tonic::Request<super::ForkBucketRequest>,
1909        ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
1910    }
1911    ///
1912    #[derive(Debug)]
1913    pub struct SnapshotsServiceServer<T> {
1914        inner: Arc<T>,
1915        accept_compression_encodings: EnabledCompressionEncodings,
1916        send_compression_encodings: EnabledCompressionEncodings,
1917        max_decoding_message_size: Option<usize>,
1918        max_encoding_message_size: Option<usize>,
1919    }
1920    impl<T> SnapshotsServiceServer<T> {
1921        pub fn new(inner: T) -> Self {
1922            Self::from_arc(Arc::new(inner))
1923        }
1924        pub fn from_arc(inner: Arc<T>) -> Self {
1925            Self {
1926                inner,
1927                accept_compression_encodings: Default::default(),
1928                send_compression_encodings: Default::default(),
1929                max_decoding_message_size: None,
1930                max_encoding_message_size: None,
1931            }
1932        }
1933        pub fn with_interceptor<F>(
1934            inner: T,
1935            interceptor: F,
1936        ) -> InterceptedService<Self, F>
1937        where
1938            F: tonic::service::Interceptor,
1939        {
1940            InterceptedService::new(Self::new(inner), interceptor)
1941        }
1942        /// Enable decompressing requests with the given encoding.
1943        #[must_use]
1944        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1945            self.accept_compression_encodings.enable(encoding);
1946            self
1947        }
1948        /// Compress responses with the given encoding, if the client supports it.
1949        #[must_use]
1950        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1951            self.send_compression_encodings.enable(encoding);
1952            self
1953        }
1954        /// Limits the maximum size of a decoded message.
1955        ///
1956        /// Default: `4MB`
1957        #[must_use]
1958        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1959            self.max_decoding_message_size = Some(limit);
1960            self
1961        }
1962        /// Limits the maximum size of an encoded message.
1963        ///
1964        /// Default: `usize::MAX`
1965        #[must_use]
1966        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1967            self.max_encoding_message_size = Some(limit);
1968            self
1969        }
1970    }
1971    impl<T, B> tonic::codegen::Service<http::Request<B>> for SnapshotsServiceServer<T>
1972    where
1973        T: SnapshotsService,
1974        B: Body + std::marker::Send + 'static,
1975        B::Error: Into<StdError> + std::marker::Send + 'static,
1976    {
1977        type Response = http::Response<tonic::body::Body>;
1978        type Error = std::convert::Infallible;
1979        type Future = BoxFuture<Self::Response, Self::Error>;
1980        fn poll_ready(
1981            &mut self,
1982            _cx: &mut Context<'_>,
1983        ) -> Poll<std::result::Result<(), Self::Error>> {
1984            Poll::Ready(Ok(()))
1985        }
1986        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1987            match req.uri().path() {
1988                "/acyclic.objects.v1.SnapshotsService/CreateSnapshot" => {
1989                    #[allow(non_camel_case_types)]
1990                    struct CreateSnapshotSvc<T: SnapshotsService>(pub Arc<T>);
1991                    impl<
1992                        T: SnapshotsService,
1993                    > tonic::server::UnaryService<super::CreateSnapshotRequest>
1994                    for CreateSnapshotSvc<T> {
1995                        type Response = super::Snapshot;
1996                        type Future = BoxFuture<
1997                            tonic::Response<Self::Response>,
1998                            tonic::Status,
1999                        >;
2000                        fn call(
2001                            &mut self,
2002                            request: tonic::Request<super::CreateSnapshotRequest>,
2003                        ) -> Self::Future {
2004                            let inner = Arc::clone(&self.0);
2005                            let fut = async move {
2006                                <T as SnapshotsService>::create_snapshot(&inner, request)
2007                                    .await
2008                            };
2009                            Box::pin(fut)
2010                        }
2011                    }
2012                    let accept_compression_encodings = self.accept_compression_encodings;
2013                    let send_compression_encodings = self.send_compression_encodings;
2014                    let max_decoding_message_size = self.max_decoding_message_size;
2015                    let max_encoding_message_size = self.max_encoding_message_size;
2016                    let inner = self.inner.clone();
2017                    let fut = async move {
2018                        let method = CreateSnapshotSvc(inner);
2019                        let codec = tonic_prost::ProstCodec::default();
2020                        let mut grpc = tonic::server::Grpc::new(codec)
2021                            .apply_compression_config(
2022                                accept_compression_encodings,
2023                                send_compression_encodings,
2024                            )
2025                            .apply_max_message_size_config(
2026                                max_decoding_message_size,
2027                                max_encoding_message_size,
2028                            );
2029                        let res = grpc.unary(method, req).await;
2030                        Ok(res)
2031                    };
2032                    Box::pin(fut)
2033                }
2034                "/acyclic.objects.v1.SnapshotsService/DestroySnapshot" => {
2035                    #[allow(non_camel_case_types)]
2036                    struct DestroySnapshotSvc<T: SnapshotsService>(pub Arc<T>);
2037                    impl<
2038                        T: SnapshotsService,
2039                    > tonic::server::UnaryService<super::DestroySnapshotRequest>
2040                    for DestroySnapshotSvc<T> {
2041                        type Response = super::DestroySnapshotResponse;
2042                        type Future = BoxFuture<
2043                            tonic::Response<Self::Response>,
2044                            tonic::Status,
2045                        >;
2046                        fn call(
2047                            &mut self,
2048                            request: tonic::Request<super::DestroySnapshotRequest>,
2049                        ) -> Self::Future {
2050                            let inner = Arc::clone(&self.0);
2051                            let fut = async move {
2052                                <T as SnapshotsService>::destroy_snapshot(&inner, request)
2053                                    .await
2054                            };
2055                            Box::pin(fut)
2056                        }
2057                    }
2058                    let accept_compression_encodings = self.accept_compression_encodings;
2059                    let send_compression_encodings = self.send_compression_encodings;
2060                    let max_decoding_message_size = self.max_decoding_message_size;
2061                    let max_encoding_message_size = self.max_encoding_message_size;
2062                    let inner = self.inner.clone();
2063                    let fut = async move {
2064                        let method = DestroySnapshotSvc(inner);
2065                        let codec = tonic_prost::ProstCodec::default();
2066                        let mut grpc = tonic::server::Grpc::new(codec)
2067                            .apply_compression_config(
2068                                accept_compression_encodings,
2069                                send_compression_encodings,
2070                            )
2071                            .apply_max_message_size_config(
2072                                max_decoding_message_size,
2073                                max_encoding_message_size,
2074                            );
2075                        let res = grpc.unary(method, req).await;
2076                        Ok(res)
2077                    };
2078                    Box::pin(fut)
2079                }
2080                "/acyclic.objects.v1.SnapshotsService/ForkSnapshot" => {
2081                    #[allow(non_camel_case_types)]
2082                    struct ForkSnapshotSvc<T: SnapshotsService>(pub Arc<T>);
2083                    impl<
2084                        T: SnapshotsService,
2085                    > tonic::server::UnaryService<super::ForkSnapshotRequest>
2086                    for ForkSnapshotSvc<T> {
2087                        type Response = super::Bucket;
2088                        type Future = BoxFuture<
2089                            tonic::Response<Self::Response>,
2090                            tonic::Status,
2091                        >;
2092                        fn call(
2093                            &mut self,
2094                            request: tonic::Request<super::ForkSnapshotRequest>,
2095                        ) -> Self::Future {
2096                            let inner = Arc::clone(&self.0);
2097                            let fut = async move {
2098                                <T as SnapshotsService>::fork_snapshot(&inner, request)
2099                                    .await
2100                            };
2101                            Box::pin(fut)
2102                        }
2103                    }
2104                    let accept_compression_encodings = self.accept_compression_encodings;
2105                    let send_compression_encodings = self.send_compression_encodings;
2106                    let max_decoding_message_size = self.max_decoding_message_size;
2107                    let max_encoding_message_size = self.max_encoding_message_size;
2108                    let inner = self.inner.clone();
2109                    let fut = async move {
2110                        let method = ForkSnapshotSvc(inner);
2111                        let codec = tonic_prost::ProstCodec::default();
2112                        let mut grpc = tonic::server::Grpc::new(codec)
2113                            .apply_compression_config(
2114                                accept_compression_encodings,
2115                                send_compression_encodings,
2116                            )
2117                            .apply_max_message_size_config(
2118                                max_decoding_message_size,
2119                                max_encoding_message_size,
2120                            );
2121                        let res = grpc.unary(method, req).await;
2122                        Ok(res)
2123                    };
2124                    Box::pin(fut)
2125                }
2126                "/acyclic.objects.v1.SnapshotsService/ForkBucket" => {
2127                    #[allow(non_camel_case_types)]
2128                    struct ForkBucketSvc<T: SnapshotsService>(pub Arc<T>);
2129                    impl<
2130                        T: SnapshotsService,
2131                    > tonic::server::UnaryService<super::ForkBucketRequest>
2132                    for ForkBucketSvc<T> {
2133                        type Response = super::Bucket;
2134                        type Future = BoxFuture<
2135                            tonic::Response<Self::Response>,
2136                            tonic::Status,
2137                        >;
2138                        fn call(
2139                            &mut self,
2140                            request: tonic::Request<super::ForkBucketRequest>,
2141                        ) -> Self::Future {
2142                            let inner = Arc::clone(&self.0);
2143                            let fut = async move {
2144                                <T as SnapshotsService>::fork_bucket(&inner, request).await
2145                            };
2146                            Box::pin(fut)
2147                        }
2148                    }
2149                    let accept_compression_encodings = self.accept_compression_encodings;
2150                    let send_compression_encodings = self.send_compression_encodings;
2151                    let max_decoding_message_size = self.max_decoding_message_size;
2152                    let max_encoding_message_size = self.max_encoding_message_size;
2153                    let inner = self.inner.clone();
2154                    let fut = async move {
2155                        let method = ForkBucketSvc(inner);
2156                        let codec = tonic_prost::ProstCodec::default();
2157                        let mut grpc = tonic::server::Grpc::new(codec)
2158                            .apply_compression_config(
2159                                accept_compression_encodings,
2160                                send_compression_encodings,
2161                            )
2162                            .apply_max_message_size_config(
2163                                max_decoding_message_size,
2164                                max_encoding_message_size,
2165                            );
2166                        let res = grpc.unary(method, req).await;
2167                        Ok(res)
2168                    };
2169                    Box::pin(fut)
2170                }
2171                _ => {
2172                    Box::pin(async move {
2173                        let mut response = http::Response::new(
2174                            tonic::body::Body::default(),
2175                        );
2176                        let headers = response.headers_mut();
2177                        headers
2178                            .insert(
2179                                tonic::Status::GRPC_STATUS,
2180                                (tonic::Code::Unimplemented as i32).into(),
2181                            );
2182                        headers
2183                            .insert(
2184                                http::header::CONTENT_TYPE,
2185                                tonic::metadata::GRPC_CONTENT_TYPE,
2186                            );
2187                        Ok(response)
2188                    })
2189                }
2190            }
2191        }
2192    }
2193    impl<T> Clone for SnapshotsServiceServer<T> {
2194        fn clone(&self) -> Self {
2195            let inner = self.inner.clone();
2196            Self {
2197                inner,
2198                accept_compression_encodings: self.accept_compression_encodings,
2199                send_compression_encodings: self.send_compression_encodings,
2200                max_decoding_message_size: self.max_decoding_message_size,
2201                max_encoding_message_size: self.max_encoding_message_size,
2202            }
2203        }
2204    }
2205    /// Generated gRPC service name
2206    pub const SERVICE_NAME: &str = "acyclic.objects.v1.SnapshotsService";
2207    impl<T> tonic::server::NamedService for SnapshotsServiceServer<T> {
2208        const NAME: &'static str = SERVICE_NAME;
2209    }
2210}