1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct BucketRef {
4 #[prost(string, tag = "1")]
5 pub bucket_id: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub name: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10pub struct SnapshotRef {
11 #[prost(string, tag = "1")]
12 pub snapshot_id: ::prost::alloc::string::String,
13 #[prost(string, tag = "2")]
14 pub source_bucket_id: ::prost::alloc::string::String,
15}
16#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
17pub struct ReadTarget {
18 #[prost(oneof = "read_target::Target", tags = "1, 2")]
19 pub target: ::core::option::Option<read_target::Target>,
20}
21pub mod read_target {
23 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
24 pub enum Target {
25 #[prost(message, tag = "1")]
26 Bucket(super::BucketRef),
27 #[prost(message, tag = "2")]
28 Snapshot(super::SnapshotRef),
29 }
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct ObjectMetadata {
33 #[prost(string, tag = "1")]
34 pub content_type: ::prost::alloc::string::String,
35 #[prost(map = "string, string", tag = "2")]
36 pub user: ::std::collections::HashMap<
37 ::prost::alloc::string::String,
38 ::prost::alloc::string::String,
39 >,
40 #[prost(string, tag = "3")]
41 pub content_encoding: ::prost::alloc::string::String,
42 #[prost(string, tag = "4")]
43 pub cache_control: ::prost::alloc::string::String,
44 #[prost(string, tag = "5")]
45 pub content_disposition: ::prost::alloc::string::String,
46 #[prost(string, tag = "6")]
47 pub content_language: ::prost::alloc::string::String,
48 #[prost(int64, optional, tag = "7")]
49 pub expires_unix_seconds: ::core::option::Option<i64>,
50}
51#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
52pub struct Preconditions {
53 #[prost(oneof = "preconditions::Condition", tags = "1, 2, 3")]
54 pub condition: ::core::option::Option<preconditions::Condition>,
55}
56pub mod preconditions {
58 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
59 pub enum Condition {
60 #[prost(bool, tag = "1")]
61 IfAbsent(bool),
62 #[prost(string, tag = "2")]
63 IfMatch(::prost::alloc::string::String),
64 #[prost(string, tag = "3")]
65 IfVersion(::prost::alloc::string::String),
66 }
67}
68#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
69pub struct MutationIdentity {
70 #[prost(string, tag = "1")]
71 pub idempotency_key: ::prost::alloc::string::String,
72}
73#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
74pub struct Bucket {
75 #[prost(message, optional, tag = "1")]
76 pub bucket: ::core::option::Option<BucketRef>,
77 #[prost(message, optional, tag = "2")]
78 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
79}
80#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
81pub struct CreateBucketRequest {
82 #[prost(string, tag = "1")]
83 pub name: ::prost::alloc::string::String,
84 #[prost(message, optional, tag = "2")]
85 pub mutation: ::core::option::Option<MutationIdentity>,
86}
87#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
88pub struct HeadBucketRequest {
89 #[prost(message, optional, tag = "1")]
90 pub bucket: ::core::option::Option<BucketRef>,
91}
92#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
93pub struct DeleteBucketRequest {
94 #[prost(message, optional, tag = "1")]
95 pub bucket: ::core::option::Option<BucketRef>,
96 #[prost(message, optional, tag = "2")]
97 pub mutation: ::core::option::Option<MutationIdentity>,
98}
99#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
100pub struct DeleteBucketResponse {
101 #[prost(bool, tag = "1")]
102 pub existed: bool,
103}
104#[derive(Clone, PartialEq, ::prost::Message)]
105pub struct PutObjectHeader {
106 #[prost(message, optional, tag = "1")]
107 pub bucket: ::core::option::Option<BucketRef>,
108 #[prost(string, tag = "2")]
109 pub object_key: ::prost::alloc::string::String,
110 #[prost(message, optional, tag = "3")]
111 pub metadata: ::core::option::Option<ObjectMetadata>,
112 #[prost(message, optional, tag = "4")]
113 pub preconditions: ::core::option::Option<Preconditions>,
114 #[prost(message, optional, tag = "5")]
115 pub mutation: ::core::option::Option<MutationIdentity>,
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct PutObjectRequest {
119 #[prost(oneof = "put_object_request::Frame", tags = "1, 2")]
120 pub frame: ::core::option::Option<put_object_request::Frame>,
121}
122pub mod put_object_request {
124 #[derive(Clone, PartialEq, ::prost::Oneof)]
125 pub enum Frame {
126 #[prost(message, tag = "1")]
127 Header(super::PutObjectHeader),
128 #[prost(bytes, tag = "2")]
129 Body(::prost::alloc::vec::Vec<u8>),
130 }
131}
132#[derive(Clone, PartialEq, ::prost::Message)]
133pub struct ObjectVersion {
134 #[prost(string, tag = "1")]
135 pub version_id: ::prost::alloc::string::String,
136 #[prost(string, tag = "2")]
137 pub etag: ::prost::alloc::string::String,
138 #[prost(uint64, tag = "3")]
139 pub size: u64,
140 #[prost(bool, tag = "4")]
141 pub delete_marker: bool,
142 #[prost(message, optional, tag = "5")]
143 pub metadata: ::core::option::Option<ObjectMetadata>,
144 #[prost(message, optional, tag = "6")]
145 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
146}
147#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
148pub struct GetObjectRequest {
149 #[prost(message, optional, tag = "1")]
150 pub target: ::core::option::Option<ReadTarget>,
151 #[prost(string, tag = "2")]
152 pub object_key: ::prost::alloc::string::String,
153 #[prost(string, tag = "3")]
154 pub version_id: ::prost::alloc::string::String,
155 #[prost(uint64, tag = "4")]
156 pub range_start: u64,
157 #[prost(uint64, optional, tag = "5")]
158 pub range_end_inclusive: ::core::option::Option<u64>,
159 #[prost(string, tag = "6")]
160 pub if_match: ::prost::alloc::string::String,
161 #[prost(string, tag = "7")]
162 pub if_none_match: ::prost::alloc::string::String,
163}
164#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct GetObjectResponse {
166 #[prost(oneof = "get_object_response::Frame", tags = "1, 2")]
167 pub frame: ::core::option::Option<get_object_response::Frame>,
168}
169pub mod get_object_response {
171 #[derive(Clone, PartialEq, ::prost::Oneof)]
172 pub enum Frame {
173 #[prost(message, tag = "1")]
174 Version(super::ObjectVersion),
175 #[prost(bytes, tag = "2")]
176 Body(::prost::alloc::vec::Vec<u8>),
177 }
178}
179#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
180pub struct HeadObjectRequest {
181 #[prost(message, optional, tag = "1")]
182 pub target: ::core::option::Option<ReadTarget>,
183 #[prost(string, tag = "2")]
184 pub object_key: ::prost::alloc::string::String,
185 #[prost(string, tag = "3")]
186 pub version_id: ::prost::alloc::string::String,
187 #[prost(string, tag = "4")]
188 pub if_match: ::prost::alloc::string::String,
189 #[prost(string, tag = "5")]
190 pub if_none_match: ::prost::alloc::string::String,
191}
192#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct HeadObjectResponse {
194 #[prost(message, optional, tag = "1")]
195 pub version: ::core::option::Option<ObjectVersion>,
196}
197#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
198pub struct DeleteObjectRequest {
199 #[prost(message, optional, tag = "1")]
200 pub bucket: ::core::option::Option<BucketRef>,
201 #[prost(string, tag = "2")]
202 pub object_key: ::prost::alloc::string::String,
203 #[prost(string, tag = "3")]
204 pub version_id: ::prost::alloc::string::String,
205 #[prost(message, optional, tag = "4")]
206 pub preconditions: ::core::option::Option<Preconditions>,
207 #[prost(message, optional, tag = "5")]
208 pub mutation: ::core::option::Option<MutationIdentity>,
209}
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct DeleteObjectResponse {
212 #[prost(bool, tag = "1")]
213 pub existed: bool,
214 #[prost(message, optional, tag = "2")]
215 pub version: ::core::option::Option<ObjectVersion>,
216}
217#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
218pub struct ListObjectsRequest {
219 #[prost(message, optional, tag = "1")]
220 pub target: ::core::option::Option<ReadTarget>,
221 #[prost(string, tag = "2")]
222 pub prefix: ::prost::alloc::string::String,
223 #[prost(string, tag = "3")]
224 pub delimiter: ::prost::alloc::string::String,
225 #[prost(enumeration = "ListingMode", tag = "4")]
226 pub mode: i32,
227 #[prost(uint32, tag = "5")]
228 pub page_size: u32,
229 #[prost(string, tag = "6")]
230 pub continuation_token: ::prost::alloc::string::String,
231}
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct ListEntry {
234 #[prost(string, tag = "1")]
235 pub object_key: ::prost::alloc::string::String,
236 #[prost(message, optional, tag = "2")]
237 pub version: ::core::option::Option<ObjectVersion>,
238}
239#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct ListObjectsResponse {
241 #[prost(message, repeated, tag = "1")]
242 pub entries: ::prost::alloc::vec::Vec<ListEntry>,
243 #[prost(string, repeated, tag = "2")]
244 pub common_prefixes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
245 #[prost(string, tag = "3")]
246 pub continuation_token: ::prost::alloc::string::String,
247}
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct CreateMultipartRequest {
250 #[prost(message, optional, tag = "1")]
251 pub bucket: ::core::option::Option<BucketRef>,
252 #[prost(string, tag = "2")]
253 pub object_key: ::prost::alloc::string::String,
254 #[prost(message, optional, tag = "3")]
255 pub metadata: ::core::option::Option<ObjectMetadata>,
256 #[prost(message, optional, tag = "4")]
257 pub preconditions: ::core::option::Option<Preconditions>,
258 #[prost(message, optional, tag = "5")]
259 pub mutation: ::core::option::Option<MutationIdentity>,
260}
261#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
262pub struct MultipartUpload {
263 #[prost(string, tag = "1")]
264 pub upload_id: ::prost::alloc::string::String,
265}
266#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
267pub struct UploadPartHeader {
268 #[prost(message, optional, tag = "1")]
269 pub bucket: ::core::option::Option<BucketRef>,
270 #[prost(string, tag = "2")]
271 pub object_key: ::prost::alloc::string::String,
272 #[prost(string, tag = "3")]
273 pub upload_id: ::prost::alloc::string::String,
274 #[prost(uint32, tag = "4")]
275 pub part_number: u32,
276 #[prost(message, optional, tag = "5")]
277 pub mutation: ::core::option::Option<MutationIdentity>,
278}
279#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
280pub struct UploadPartRequest {
281 #[prost(oneof = "upload_part_request::Frame", tags = "1, 2")]
282 pub frame: ::core::option::Option<upload_part_request::Frame>,
283}
284pub mod upload_part_request {
286 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
287 pub enum Frame {
288 #[prost(message, tag = "1")]
289 Header(super::UploadPartHeader),
290 #[prost(bytes, tag = "2")]
291 Body(::prost::alloc::vec::Vec<u8>),
292 }
293}
294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
295pub struct UploadedPart {
296 #[prost(uint32, tag = "1")]
297 pub part_number: u32,
298 #[prost(string, tag = "2")]
299 pub etag: ::prost::alloc::string::String,
300 #[prost(uint64, tag = "3")]
301 pub size: u64,
302}
303#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
304pub struct ListPartsRequest {
305 #[prost(message, optional, tag = "1")]
306 pub bucket: ::core::option::Option<BucketRef>,
307 #[prost(string, tag = "2")]
308 pub object_key: ::prost::alloc::string::String,
309 #[prost(string, tag = "3")]
310 pub upload_id: ::prost::alloc::string::String,
311}
312#[derive(Clone, PartialEq, ::prost::Message)]
313pub struct ListPartsResponse {
314 #[prost(message, repeated, tag = "1")]
315 pub parts: ::prost::alloc::vec::Vec<UploadedPart>,
316}
317#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct CompleteMultipartRequest {
319 #[prost(message, optional, tag = "1")]
320 pub bucket: ::core::option::Option<BucketRef>,
321 #[prost(string, tag = "2")]
322 pub object_key: ::prost::alloc::string::String,
323 #[prost(string, tag = "3")]
324 pub upload_id: ::prost::alloc::string::String,
325 #[prost(message, repeated, tag = "4")]
326 pub parts: ::prost::alloc::vec::Vec<UploadedPart>,
327 #[prost(message, optional, tag = "5")]
328 pub mutation: ::core::option::Option<MutationIdentity>,
329}
330#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
331pub struct AbortMultipartRequest {
332 #[prost(message, optional, tag = "1")]
333 pub bucket: ::core::option::Option<BucketRef>,
334 #[prost(string, tag = "2")]
335 pub object_key: ::prost::alloc::string::String,
336 #[prost(string, tag = "3")]
337 pub upload_id: ::prost::alloc::string::String,
338 #[prost(message, optional, tag = "4")]
339 pub mutation: ::core::option::Option<MutationIdentity>,
340}
341#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
342pub struct AbortMultipartResponse {
343 #[prost(bool, tag = "1")]
344 pub existed: bool,
345}
346#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
347pub struct Snapshot {
348 #[prost(message, optional, tag = "1")]
349 pub snapshot: ::core::option::Option<SnapshotRef>,
350 #[prost(message, optional, tag = "2")]
351 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
352}
353#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
354pub struct CreateSnapshotRequest {
355 #[prost(message, optional, tag = "1")]
356 pub bucket: ::core::option::Option<BucketRef>,
357 #[prost(message, optional, tag = "2")]
358 pub mutation: ::core::option::Option<MutationIdentity>,
359}
360#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
361pub struct DestroySnapshotRequest {
362 #[prost(message, optional, tag = "1")]
363 pub snapshot: ::core::option::Option<SnapshotRef>,
364 #[prost(message, optional, tag = "2")]
365 pub mutation: ::core::option::Option<MutationIdentity>,
366}
367#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
368pub struct DestroySnapshotResponse {
369 #[prost(bool, tag = "1")]
370 pub existed: bool,
371}
372#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
373pub struct ForkSnapshotRequest {
374 #[prost(message, optional, tag = "1")]
375 pub snapshot: ::core::option::Option<SnapshotRef>,
376 #[prost(string, tag = "2")]
377 pub destination_name: ::prost::alloc::string::String,
378 #[prost(message, optional, tag = "3")]
379 pub mutation: ::core::option::Option<MutationIdentity>,
380}
381#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
382pub struct ForkBucketRequest {
383 #[prost(message, optional, tag = "1")]
384 pub source: ::core::option::Option<BucketRef>,
385 #[prost(string, tag = "2")]
386 pub destination_name: ::prost::alloc::string::String,
387 #[prost(message, optional, tag = "3")]
388 pub mutation: ::core::option::Option<MutationIdentity>,
389}
390#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
391pub struct ErrorDetail {
392 #[prost(enumeration = "ErrorCode", tag = "1")]
393 pub code: i32,
394 #[prost(string, tag = "2")]
395 pub request_id: ::prost::alloc::string::String,
396}
397#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
398#[repr(i32)]
399pub enum ListingMode {
400 Unspecified = 0,
401 Current = 1,
402 Versions = 2,
403}
404impl ListingMode {
405 pub fn as_str_name(&self) -> &'static str {
410 match self {
411 Self::Unspecified => "LISTING_MODE_UNSPECIFIED",
412 Self::Current => "LISTING_MODE_CURRENT",
413 Self::Versions => "LISTING_MODE_VERSIONS",
414 }
415 }
416 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
418 match value {
419 "LISTING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
420 "LISTING_MODE_CURRENT" => Some(Self::Current),
421 "LISTING_MODE_VERSIONS" => Some(Self::Versions),
422 _ => None,
423 }
424 }
425}
426#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
427#[repr(i32)]
428pub enum ErrorCode {
429 Unspecified = 0,
430 InvalidArgument = 1,
431 NotFound = 2,
432 AlreadyExists = 3,
433 PreconditionFailed = 4,
434 IdempotencyMismatch = 5,
435 TokenExpired = 6,
436 QuotaExceeded = 7,
437 Unsupported = 8,
438 Unavailable = 9,
439}
440impl ErrorCode {
441 pub fn as_str_name(&self) -> &'static str {
446 match self {
447 Self::Unspecified => "ERROR_CODE_UNSPECIFIED",
448 Self::InvalidArgument => "ERROR_CODE_INVALID_ARGUMENT",
449 Self::NotFound => "ERROR_CODE_NOT_FOUND",
450 Self::AlreadyExists => "ERROR_CODE_ALREADY_EXISTS",
451 Self::PreconditionFailed => "ERROR_CODE_PRECONDITION_FAILED",
452 Self::IdempotencyMismatch => "ERROR_CODE_IDEMPOTENCY_MISMATCH",
453 Self::TokenExpired => "ERROR_CODE_TOKEN_EXPIRED",
454 Self::QuotaExceeded => "ERROR_CODE_QUOTA_EXCEEDED",
455 Self::Unsupported => "ERROR_CODE_UNSUPPORTED",
456 Self::Unavailable => "ERROR_CODE_UNAVAILABLE",
457 }
458 }
459 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
461 match value {
462 "ERROR_CODE_UNSPECIFIED" => Some(Self::Unspecified),
463 "ERROR_CODE_INVALID_ARGUMENT" => Some(Self::InvalidArgument),
464 "ERROR_CODE_NOT_FOUND" => Some(Self::NotFound),
465 "ERROR_CODE_ALREADY_EXISTS" => Some(Self::AlreadyExists),
466 "ERROR_CODE_PRECONDITION_FAILED" => Some(Self::PreconditionFailed),
467 "ERROR_CODE_IDEMPOTENCY_MISMATCH" => Some(Self::IdempotencyMismatch),
468 "ERROR_CODE_TOKEN_EXPIRED" => Some(Self::TokenExpired),
469 "ERROR_CODE_QUOTA_EXCEEDED" => Some(Self::QuotaExceeded),
470 "ERROR_CODE_UNSUPPORTED" => Some(Self::Unsupported),
471 "ERROR_CODE_UNAVAILABLE" => Some(Self::Unavailable),
472 _ => None,
473 }
474 }
475}
476#[cfg(feature = "grpc")]
478pub mod buckets_service_client {
479 #![allow(
480 unused_variables,
481 dead_code,
482 missing_docs,
483 clippy::wildcard_imports,
484 clippy::let_unit_value,
485 )]
486 use tonic::codegen::*;
487 use tonic::codegen::http::Uri;
488 #[derive(Debug, Clone)]
489 pub struct BucketsServiceClient<T> {
490 inner: tonic::client::Grpc<T>,
491 }
492 impl BucketsServiceClient<tonic::transport::Channel> {
493 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
495 where
496 D: TryInto<tonic::transport::Endpoint>,
497 D::Error: Into<StdError>,
498 {
499 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
500 Ok(Self::new(conn))
501 }
502 }
503 impl<T> BucketsServiceClient<T>
504 where
505 T: tonic::client::GrpcService<tonic::body::Body>,
506 T::Error: Into<StdError>,
507 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
508 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
509 {
510 pub fn new(inner: T) -> Self {
511 let inner = tonic::client::Grpc::new(inner);
512 Self { inner }
513 }
514 pub fn with_origin(inner: T, origin: Uri) -> Self {
515 let inner = tonic::client::Grpc::with_origin(inner, origin);
516 Self { inner }
517 }
518 pub fn with_interceptor<F>(
519 inner: T,
520 interceptor: F,
521 ) -> BucketsServiceClient<InterceptedService<T, F>>
522 where
523 F: tonic::service::Interceptor,
524 T::ResponseBody: Default,
525 T: tonic::codegen::Service<
526 http::Request<tonic::body::Body>,
527 Response = http::Response<
528 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
529 >,
530 >,
531 <T as tonic::codegen::Service<
532 http::Request<tonic::body::Body>,
533 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
534 {
535 BucketsServiceClient::new(InterceptedService::new(inner, interceptor))
536 }
537 #[must_use]
542 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
543 self.inner = self.inner.send_compressed(encoding);
544 self
545 }
546 #[must_use]
548 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
549 self.inner = self.inner.accept_compressed(encoding);
550 self
551 }
552 #[must_use]
556 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
557 self.inner = self.inner.max_decoding_message_size(limit);
558 self
559 }
560 #[must_use]
564 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
565 self.inner = self.inner.max_encoding_message_size(limit);
566 self
567 }
568 pub async fn create_bucket(
569 &mut self,
570 request: impl tonic::IntoRequest<super::CreateBucketRequest>,
571 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
572 self.inner
573 .ready()
574 .await
575 .map_err(|e| {
576 tonic::Status::unknown(
577 format!("Service was not ready: {}", e.into()),
578 )
579 })?;
580 let codec = tonic_prost::ProstCodec::default();
581 let path = http::uri::PathAndQuery::from_static(
582 "/acyclic.objects.v1.BucketsService/CreateBucket",
583 );
584 let mut req = request.into_request();
585 req.extensions_mut()
586 .insert(
587 GrpcMethod::new("acyclic.objects.v1.BucketsService", "CreateBucket"),
588 );
589 self.inner.unary(req, path, codec).await
590 }
591 pub async fn head_bucket(
592 &mut self,
593 request: impl tonic::IntoRequest<super::HeadBucketRequest>,
594 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
595 self.inner
596 .ready()
597 .await
598 .map_err(|e| {
599 tonic::Status::unknown(
600 format!("Service was not ready: {}", e.into()),
601 )
602 })?;
603 let codec = tonic_prost::ProstCodec::default();
604 let path = http::uri::PathAndQuery::from_static(
605 "/acyclic.objects.v1.BucketsService/HeadBucket",
606 );
607 let mut req = request.into_request();
608 req.extensions_mut()
609 .insert(
610 GrpcMethod::new("acyclic.objects.v1.BucketsService", "HeadBucket"),
611 );
612 self.inner.unary(req, path, codec).await
613 }
614 pub async fn delete_bucket(
615 &mut self,
616 request: impl tonic::IntoRequest<super::DeleteBucketRequest>,
617 ) -> std::result::Result<
618 tonic::Response<super::DeleteBucketResponse>,
619 tonic::Status,
620 > {
621 self.inner
622 .ready()
623 .await
624 .map_err(|e| {
625 tonic::Status::unknown(
626 format!("Service was not ready: {}", e.into()),
627 )
628 })?;
629 let codec = tonic_prost::ProstCodec::default();
630 let path = http::uri::PathAndQuery::from_static(
631 "/acyclic.objects.v1.BucketsService/DeleteBucket",
632 );
633 let mut req = request.into_request();
634 req.extensions_mut()
635 .insert(
636 GrpcMethod::new("acyclic.objects.v1.BucketsService", "DeleteBucket"),
637 );
638 self.inner.unary(req, path, codec).await
639 }
640 }
641}
642#[cfg(feature = "grpc")]
644pub mod buckets_service_server {
645 #![allow(
646 unused_variables,
647 dead_code,
648 missing_docs,
649 clippy::wildcard_imports,
650 clippy::let_unit_value,
651 )]
652 use tonic::codegen::*;
653 #[async_trait]
655 pub trait BucketsService: std::marker::Send + std::marker::Sync + 'static {
656 async fn create_bucket(
657 &self,
658 request: tonic::Request<super::CreateBucketRequest>,
659 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
660 async fn head_bucket(
661 &self,
662 request: tonic::Request<super::HeadBucketRequest>,
663 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
664 async fn delete_bucket(
665 &self,
666 request: tonic::Request<super::DeleteBucketRequest>,
667 ) -> std::result::Result<
668 tonic::Response<super::DeleteBucketResponse>,
669 tonic::Status,
670 >;
671 }
672 #[derive(Debug)]
673 pub struct BucketsServiceServer<T> {
674 inner: Arc<T>,
675 accept_compression_encodings: EnabledCompressionEncodings,
676 send_compression_encodings: EnabledCompressionEncodings,
677 max_decoding_message_size: Option<usize>,
678 max_encoding_message_size: Option<usize>,
679 }
680 impl<T> BucketsServiceServer<T> {
681 pub fn new(inner: T) -> Self {
682 Self::from_arc(Arc::new(inner))
683 }
684 pub fn from_arc(inner: Arc<T>) -> Self {
685 Self {
686 inner,
687 accept_compression_encodings: Default::default(),
688 send_compression_encodings: Default::default(),
689 max_decoding_message_size: None,
690 max_encoding_message_size: None,
691 }
692 }
693 pub fn with_interceptor<F>(
694 inner: T,
695 interceptor: F,
696 ) -> InterceptedService<Self, F>
697 where
698 F: tonic::service::Interceptor,
699 {
700 InterceptedService::new(Self::new(inner), interceptor)
701 }
702 #[must_use]
704 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
705 self.accept_compression_encodings.enable(encoding);
706 self
707 }
708 #[must_use]
710 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
711 self.send_compression_encodings.enable(encoding);
712 self
713 }
714 #[must_use]
718 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
719 self.max_decoding_message_size = Some(limit);
720 self
721 }
722 #[must_use]
726 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
727 self.max_encoding_message_size = Some(limit);
728 self
729 }
730 }
731 impl<T, B> tonic::codegen::Service<http::Request<B>> for BucketsServiceServer<T>
732 where
733 T: BucketsService,
734 B: Body + std::marker::Send + 'static,
735 B::Error: Into<StdError> + std::marker::Send + 'static,
736 {
737 type Response = http::Response<tonic::body::Body>;
738 type Error = std::convert::Infallible;
739 type Future = BoxFuture<Self::Response, Self::Error>;
740 fn poll_ready(
741 &mut self,
742 _cx: &mut Context<'_>,
743 ) -> Poll<std::result::Result<(), Self::Error>> {
744 Poll::Ready(Ok(()))
745 }
746 fn call(&mut self, req: http::Request<B>) -> Self::Future {
747 match req.uri().path() {
748 "/acyclic.objects.v1.BucketsService/CreateBucket" => {
749 #[allow(non_camel_case_types)]
750 struct CreateBucketSvc<T: BucketsService>(pub Arc<T>);
751 impl<
752 T: BucketsService,
753 > tonic::server::UnaryService<super::CreateBucketRequest>
754 for CreateBucketSvc<T> {
755 type Response = super::Bucket;
756 type Future = BoxFuture<
757 tonic::Response<Self::Response>,
758 tonic::Status,
759 >;
760 fn call(
761 &mut self,
762 request: tonic::Request<super::CreateBucketRequest>,
763 ) -> Self::Future {
764 let inner = Arc::clone(&self.0);
765 let fut = async move {
766 <T as BucketsService>::create_bucket(&inner, request).await
767 };
768 Box::pin(fut)
769 }
770 }
771 let accept_compression_encodings = self.accept_compression_encodings;
772 let send_compression_encodings = self.send_compression_encodings;
773 let max_decoding_message_size = self.max_decoding_message_size;
774 let max_encoding_message_size = self.max_encoding_message_size;
775 let inner = self.inner.clone();
776 let fut = async move {
777 let method = CreateBucketSvc(inner);
778 let codec = tonic_prost::ProstCodec::default();
779 let mut grpc = tonic::server::Grpc::new(codec)
780 .apply_compression_config(
781 accept_compression_encodings,
782 send_compression_encodings,
783 )
784 .apply_max_message_size_config(
785 max_decoding_message_size,
786 max_encoding_message_size,
787 );
788 let res = grpc.unary(method, req).await;
789 Ok(res)
790 };
791 Box::pin(fut)
792 }
793 "/acyclic.objects.v1.BucketsService/HeadBucket" => {
794 #[allow(non_camel_case_types)]
795 struct HeadBucketSvc<T: BucketsService>(pub Arc<T>);
796 impl<
797 T: BucketsService,
798 > tonic::server::UnaryService<super::HeadBucketRequest>
799 for HeadBucketSvc<T> {
800 type Response = super::Bucket;
801 type Future = BoxFuture<
802 tonic::Response<Self::Response>,
803 tonic::Status,
804 >;
805 fn call(
806 &mut self,
807 request: tonic::Request<super::HeadBucketRequest>,
808 ) -> Self::Future {
809 let inner = Arc::clone(&self.0);
810 let fut = async move {
811 <T as BucketsService>::head_bucket(&inner, request).await
812 };
813 Box::pin(fut)
814 }
815 }
816 let accept_compression_encodings = self.accept_compression_encodings;
817 let send_compression_encodings = self.send_compression_encodings;
818 let max_decoding_message_size = self.max_decoding_message_size;
819 let max_encoding_message_size = self.max_encoding_message_size;
820 let inner = self.inner.clone();
821 let fut = async move {
822 let method = HeadBucketSvc(inner);
823 let codec = tonic_prost::ProstCodec::default();
824 let mut grpc = tonic::server::Grpc::new(codec)
825 .apply_compression_config(
826 accept_compression_encodings,
827 send_compression_encodings,
828 )
829 .apply_max_message_size_config(
830 max_decoding_message_size,
831 max_encoding_message_size,
832 );
833 let res = grpc.unary(method, req).await;
834 Ok(res)
835 };
836 Box::pin(fut)
837 }
838 "/acyclic.objects.v1.BucketsService/DeleteBucket" => {
839 #[allow(non_camel_case_types)]
840 struct DeleteBucketSvc<T: BucketsService>(pub Arc<T>);
841 impl<
842 T: BucketsService,
843 > tonic::server::UnaryService<super::DeleteBucketRequest>
844 for DeleteBucketSvc<T> {
845 type Response = super::DeleteBucketResponse;
846 type Future = BoxFuture<
847 tonic::Response<Self::Response>,
848 tonic::Status,
849 >;
850 fn call(
851 &mut self,
852 request: tonic::Request<super::DeleteBucketRequest>,
853 ) -> Self::Future {
854 let inner = Arc::clone(&self.0);
855 let fut = async move {
856 <T as BucketsService>::delete_bucket(&inner, request).await
857 };
858 Box::pin(fut)
859 }
860 }
861 let accept_compression_encodings = self.accept_compression_encodings;
862 let send_compression_encodings = self.send_compression_encodings;
863 let max_decoding_message_size = self.max_decoding_message_size;
864 let max_encoding_message_size = self.max_encoding_message_size;
865 let inner = self.inner.clone();
866 let fut = async move {
867 let method = DeleteBucketSvc(inner);
868 let codec = tonic_prost::ProstCodec::default();
869 let mut grpc = tonic::server::Grpc::new(codec)
870 .apply_compression_config(
871 accept_compression_encodings,
872 send_compression_encodings,
873 )
874 .apply_max_message_size_config(
875 max_decoding_message_size,
876 max_encoding_message_size,
877 );
878 let res = grpc.unary(method, req).await;
879 Ok(res)
880 };
881 Box::pin(fut)
882 }
883 _ => {
884 Box::pin(async move {
885 let mut response = http::Response::new(
886 tonic::body::Body::default(),
887 );
888 let headers = response.headers_mut();
889 headers
890 .insert(
891 tonic::Status::GRPC_STATUS,
892 (tonic::Code::Unimplemented as i32).into(),
893 );
894 headers
895 .insert(
896 http::header::CONTENT_TYPE,
897 tonic::metadata::GRPC_CONTENT_TYPE,
898 );
899 Ok(response)
900 })
901 }
902 }
903 }
904 }
905 impl<T> Clone for BucketsServiceServer<T> {
906 fn clone(&self) -> Self {
907 let inner = self.inner.clone();
908 Self {
909 inner,
910 accept_compression_encodings: self.accept_compression_encodings,
911 send_compression_encodings: self.send_compression_encodings,
912 max_decoding_message_size: self.max_decoding_message_size,
913 max_encoding_message_size: self.max_encoding_message_size,
914 }
915 }
916 }
917 pub const SERVICE_NAME: &str = "acyclic.objects.v1.BucketsService";
919 impl<T> tonic::server::NamedService for BucketsServiceServer<T> {
920 const NAME: &'static str = SERVICE_NAME;
921 }
922}
923#[cfg(feature = "grpc")]
925pub mod objects_service_client {
926 #![allow(
927 unused_variables,
928 dead_code,
929 missing_docs,
930 clippy::wildcard_imports,
931 clippy::let_unit_value,
932 )]
933 use tonic::codegen::*;
934 use tonic::codegen::http::Uri;
935 #[derive(Debug, Clone)]
936 pub struct ObjectsServiceClient<T> {
937 inner: tonic::client::Grpc<T>,
938 }
939 impl ObjectsServiceClient<tonic::transport::Channel> {
940 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
942 where
943 D: TryInto<tonic::transport::Endpoint>,
944 D::Error: Into<StdError>,
945 {
946 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
947 Ok(Self::new(conn))
948 }
949 }
950 impl<T> ObjectsServiceClient<T>
951 where
952 T: tonic::client::GrpcService<tonic::body::Body>,
953 T::Error: Into<StdError>,
954 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
955 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
956 {
957 pub fn new(inner: T) -> Self {
958 let inner = tonic::client::Grpc::new(inner);
959 Self { inner }
960 }
961 pub fn with_origin(inner: T, origin: Uri) -> Self {
962 let inner = tonic::client::Grpc::with_origin(inner, origin);
963 Self { inner }
964 }
965 pub fn with_interceptor<F>(
966 inner: T,
967 interceptor: F,
968 ) -> ObjectsServiceClient<InterceptedService<T, F>>
969 where
970 F: tonic::service::Interceptor,
971 T::ResponseBody: Default,
972 T: tonic::codegen::Service<
973 http::Request<tonic::body::Body>,
974 Response = http::Response<
975 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
976 >,
977 >,
978 <T as tonic::codegen::Service<
979 http::Request<tonic::body::Body>,
980 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
981 {
982 ObjectsServiceClient::new(InterceptedService::new(inner, interceptor))
983 }
984 #[must_use]
989 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
990 self.inner = self.inner.send_compressed(encoding);
991 self
992 }
993 #[must_use]
995 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
996 self.inner = self.inner.accept_compressed(encoding);
997 self
998 }
999 #[must_use]
1003 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1004 self.inner = self.inner.max_decoding_message_size(limit);
1005 self
1006 }
1007 #[must_use]
1011 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1012 self.inner = self.inner.max_encoding_message_size(limit);
1013 self
1014 }
1015 pub async fn put_object(
1016 &mut self,
1017 request: impl tonic::IntoStreamingRequest<Message = super::PutObjectRequest>,
1018 ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status> {
1019 self.inner
1020 .ready()
1021 .await
1022 .map_err(|e| {
1023 tonic::Status::unknown(
1024 format!("Service was not ready: {}", e.into()),
1025 )
1026 })?;
1027 let codec = tonic_prost::ProstCodec::default();
1028 let path = http::uri::PathAndQuery::from_static(
1029 "/acyclic.objects.v1.ObjectsService/PutObject",
1030 );
1031 let mut req = request.into_streaming_request();
1032 req.extensions_mut()
1033 .insert(
1034 GrpcMethod::new("acyclic.objects.v1.ObjectsService", "PutObject"),
1035 );
1036 self.inner.client_streaming(req, path, codec).await
1037 }
1038 pub async fn get_object(
1039 &mut self,
1040 request: impl tonic::IntoRequest<super::GetObjectRequest>,
1041 ) -> std::result::Result<
1042 tonic::Response<tonic::codec::Streaming<super::GetObjectResponse>>,
1043 tonic::Status,
1044 > {
1045 self.inner
1046 .ready()
1047 .await
1048 .map_err(|e| {
1049 tonic::Status::unknown(
1050 format!("Service was not ready: {}", e.into()),
1051 )
1052 })?;
1053 let codec = tonic_prost::ProstCodec::default();
1054 let path = http::uri::PathAndQuery::from_static(
1055 "/acyclic.objects.v1.ObjectsService/GetObject",
1056 );
1057 let mut req = request.into_request();
1058 req.extensions_mut()
1059 .insert(
1060 GrpcMethod::new("acyclic.objects.v1.ObjectsService", "GetObject"),
1061 );
1062 self.inner.server_streaming(req, path, codec).await
1063 }
1064 pub async fn head_object(
1065 &mut self,
1066 request: impl tonic::IntoRequest<super::HeadObjectRequest>,
1067 ) -> std::result::Result<
1068 tonic::Response<super::HeadObjectResponse>,
1069 tonic::Status,
1070 > {
1071 self.inner
1072 .ready()
1073 .await
1074 .map_err(|e| {
1075 tonic::Status::unknown(
1076 format!("Service was not ready: {}", e.into()),
1077 )
1078 })?;
1079 let codec = tonic_prost::ProstCodec::default();
1080 let path = http::uri::PathAndQuery::from_static(
1081 "/acyclic.objects.v1.ObjectsService/HeadObject",
1082 );
1083 let mut req = request.into_request();
1084 req.extensions_mut()
1085 .insert(
1086 GrpcMethod::new("acyclic.objects.v1.ObjectsService", "HeadObject"),
1087 );
1088 self.inner.unary(req, path, codec).await
1089 }
1090 pub async fn delete_object(
1091 &mut self,
1092 request: impl tonic::IntoRequest<super::DeleteObjectRequest>,
1093 ) -> std::result::Result<
1094 tonic::Response<super::DeleteObjectResponse>,
1095 tonic::Status,
1096 > {
1097 self.inner
1098 .ready()
1099 .await
1100 .map_err(|e| {
1101 tonic::Status::unknown(
1102 format!("Service was not ready: {}", e.into()),
1103 )
1104 })?;
1105 let codec = tonic_prost::ProstCodec::default();
1106 let path = http::uri::PathAndQuery::from_static(
1107 "/acyclic.objects.v1.ObjectsService/DeleteObject",
1108 );
1109 let mut req = request.into_request();
1110 req.extensions_mut()
1111 .insert(
1112 GrpcMethod::new("acyclic.objects.v1.ObjectsService", "DeleteObject"),
1113 );
1114 self.inner.unary(req, path, codec).await
1115 }
1116 pub async fn list_objects(
1117 &mut self,
1118 request: impl tonic::IntoRequest<super::ListObjectsRequest>,
1119 ) -> std::result::Result<
1120 tonic::Response<super::ListObjectsResponse>,
1121 tonic::Status,
1122 > {
1123 self.inner
1124 .ready()
1125 .await
1126 .map_err(|e| {
1127 tonic::Status::unknown(
1128 format!("Service was not ready: {}", e.into()),
1129 )
1130 })?;
1131 let codec = tonic_prost::ProstCodec::default();
1132 let path = http::uri::PathAndQuery::from_static(
1133 "/acyclic.objects.v1.ObjectsService/ListObjects",
1134 );
1135 let mut req = request.into_request();
1136 req.extensions_mut()
1137 .insert(
1138 GrpcMethod::new("acyclic.objects.v1.ObjectsService", "ListObjects"),
1139 );
1140 self.inner.unary(req, path, codec).await
1141 }
1142 }
1143}
1144#[cfg(feature = "grpc")]
1146pub mod objects_service_server {
1147 #![allow(
1148 unused_variables,
1149 dead_code,
1150 missing_docs,
1151 clippy::wildcard_imports,
1152 clippy::let_unit_value,
1153 )]
1154 use tonic::codegen::*;
1155 #[async_trait]
1157 pub trait ObjectsService: std::marker::Send + std::marker::Sync + 'static {
1158 async fn put_object(
1159 &self,
1160 request: tonic::Request<tonic::Streaming<super::PutObjectRequest>>,
1161 ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status>;
1162 type GetObjectStream: tonic::codegen::tokio_stream::Stream<
1164 Item = std::result::Result<super::GetObjectResponse, tonic::Status>,
1165 >
1166 + std::marker::Send
1167 + 'static;
1168 async fn get_object(
1169 &self,
1170 request: tonic::Request<super::GetObjectRequest>,
1171 ) -> std::result::Result<tonic::Response<Self::GetObjectStream>, tonic::Status>;
1172 async fn head_object(
1173 &self,
1174 request: tonic::Request<super::HeadObjectRequest>,
1175 ) -> std::result::Result<
1176 tonic::Response<super::HeadObjectResponse>,
1177 tonic::Status,
1178 >;
1179 async fn delete_object(
1180 &self,
1181 request: tonic::Request<super::DeleteObjectRequest>,
1182 ) -> std::result::Result<
1183 tonic::Response<super::DeleteObjectResponse>,
1184 tonic::Status,
1185 >;
1186 async fn list_objects(
1187 &self,
1188 request: tonic::Request<super::ListObjectsRequest>,
1189 ) -> std::result::Result<
1190 tonic::Response<super::ListObjectsResponse>,
1191 tonic::Status,
1192 >;
1193 }
1194 #[derive(Debug)]
1195 pub struct ObjectsServiceServer<T> {
1196 inner: Arc<T>,
1197 accept_compression_encodings: EnabledCompressionEncodings,
1198 send_compression_encodings: EnabledCompressionEncodings,
1199 max_decoding_message_size: Option<usize>,
1200 max_encoding_message_size: Option<usize>,
1201 }
1202 impl<T> ObjectsServiceServer<T> {
1203 pub fn new(inner: T) -> Self {
1204 Self::from_arc(Arc::new(inner))
1205 }
1206 pub fn from_arc(inner: Arc<T>) -> Self {
1207 Self {
1208 inner,
1209 accept_compression_encodings: Default::default(),
1210 send_compression_encodings: Default::default(),
1211 max_decoding_message_size: None,
1212 max_encoding_message_size: None,
1213 }
1214 }
1215 pub fn with_interceptor<F>(
1216 inner: T,
1217 interceptor: F,
1218 ) -> InterceptedService<Self, F>
1219 where
1220 F: tonic::service::Interceptor,
1221 {
1222 InterceptedService::new(Self::new(inner), interceptor)
1223 }
1224 #[must_use]
1226 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1227 self.accept_compression_encodings.enable(encoding);
1228 self
1229 }
1230 #[must_use]
1232 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1233 self.send_compression_encodings.enable(encoding);
1234 self
1235 }
1236 #[must_use]
1240 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1241 self.max_decoding_message_size = Some(limit);
1242 self
1243 }
1244 #[must_use]
1248 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1249 self.max_encoding_message_size = Some(limit);
1250 self
1251 }
1252 }
1253 impl<T, B> tonic::codegen::Service<http::Request<B>> for ObjectsServiceServer<T>
1254 where
1255 T: ObjectsService,
1256 B: Body + std::marker::Send + 'static,
1257 B::Error: Into<StdError> + std::marker::Send + 'static,
1258 {
1259 type Response = http::Response<tonic::body::Body>;
1260 type Error = std::convert::Infallible;
1261 type Future = BoxFuture<Self::Response, Self::Error>;
1262 fn poll_ready(
1263 &mut self,
1264 _cx: &mut Context<'_>,
1265 ) -> Poll<std::result::Result<(), Self::Error>> {
1266 Poll::Ready(Ok(()))
1267 }
1268 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1269 match req.uri().path() {
1270 "/acyclic.objects.v1.ObjectsService/PutObject" => {
1271 #[allow(non_camel_case_types)]
1272 struct PutObjectSvc<T: ObjectsService>(pub Arc<T>);
1273 impl<
1274 T: ObjectsService,
1275 > tonic::server::ClientStreamingService<super::PutObjectRequest>
1276 for PutObjectSvc<T> {
1277 type Response = super::ObjectVersion;
1278 type Future = BoxFuture<
1279 tonic::Response<Self::Response>,
1280 tonic::Status,
1281 >;
1282 fn call(
1283 &mut self,
1284 request: tonic::Request<
1285 tonic::Streaming<super::PutObjectRequest>,
1286 >,
1287 ) -> Self::Future {
1288 let inner = Arc::clone(&self.0);
1289 let fut = async move {
1290 <T as ObjectsService>::put_object(&inner, request).await
1291 };
1292 Box::pin(fut)
1293 }
1294 }
1295 let accept_compression_encodings = self.accept_compression_encodings;
1296 let send_compression_encodings = self.send_compression_encodings;
1297 let max_decoding_message_size = self.max_decoding_message_size;
1298 let max_encoding_message_size = self.max_encoding_message_size;
1299 let inner = self.inner.clone();
1300 let fut = async move {
1301 let method = PutObjectSvc(inner);
1302 let codec = tonic_prost::ProstCodec::default();
1303 let mut grpc = tonic::server::Grpc::new(codec)
1304 .apply_compression_config(
1305 accept_compression_encodings,
1306 send_compression_encodings,
1307 )
1308 .apply_max_message_size_config(
1309 max_decoding_message_size,
1310 max_encoding_message_size,
1311 );
1312 let res = grpc.client_streaming(method, req).await;
1313 Ok(res)
1314 };
1315 Box::pin(fut)
1316 }
1317 "/acyclic.objects.v1.ObjectsService/GetObject" => {
1318 #[allow(non_camel_case_types)]
1319 struct GetObjectSvc<T: ObjectsService>(pub Arc<T>);
1320 impl<
1321 T: ObjectsService,
1322 > tonic::server::ServerStreamingService<super::GetObjectRequest>
1323 for GetObjectSvc<T> {
1324 type Response = super::GetObjectResponse;
1325 type ResponseStream = T::GetObjectStream;
1326 type Future = BoxFuture<
1327 tonic::Response<Self::ResponseStream>,
1328 tonic::Status,
1329 >;
1330 fn call(
1331 &mut self,
1332 request: tonic::Request<super::GetObjectRequest>,
1333 ) -> Self::Future {
1334 let inner = Arc::clone(&self.0);
1335 let fut = async move {
1336 <T as ObjectsService>::get_object(&inner, request).await
1337 };
1338 Box::pin(fut)
1339 }
1340 }
1341 let accept_compression_encodings = self.accept_compression_encodings;
1342 let send_compression_encodings = self.send_compression_encodings;
1343 let max_decoding_message_size = self.max_decoding_message_size;
1344 let max_encoding_message_size = self.max_encoding_message_size;
1345 let inner = self.inner.clone();
1346 let fut = async move {
1347 let method = GetObjectSvc(inner);
1348 let codec = tonic_prost::ProstCodec::default();
1349 let mut grpc = tonic::server::Grpc::new(codec)
1350 .apply_compression_config(
1351 accept_compression_encodings,
1352 send_compression_encodings,
1353 )
1354 .apply_max_message_size_config(
1355 max_decoding_message_size,
1356 max_encoding_message_size,
1357 );
1358 let res = grpc.server_streaming(method, req).await;
1359 Ok(res)
1360 };
1361 Box::pin(fut)
1362 }
1363 "/acyclic.objects.v1.ObjectsService/HeadObject" => {
1364 #[allow(non_camel_case_types)]
1365 struct HeadObjectSvc<T: ObjectsService>(pub Arc<T>);
1366 impl<
1367 T: ObjectsService,
1368 > tonic::server::UnaryService<super::HeadObjectRequest>
1369 for HeadObjectSvc<T> {
1370 type Response = super::HeadObjectResponse;
1371 type Future = BoxFuture<
1372 tonic::Response<Self::Response>,
1373 tonic::Status,
1374 >;
1375 fn call(
1376 &mut self,
1377 request: tonic::Request<super::HeadObjectRequest>,
1378 ) -> Self::Future {
1379 let inner = Arc::clone(&self.0);
1380 let fut = async move {
1381 <T as ObjectsService>::head_object(&inner, request).await
1382 };
1383 Box::pin(fut)
1384 }
1385 }
1386 let accept_compression_encodings = self.accept_compression_encodings;
1387 let send_compression_encodings = self.send_compression_encodings;
1388 let max_decoding_message_size = self.max_decoding_message_size;
1389 let max_encoding_message_size = self.max_encoding_message_size;
1390 let inner = self.inner.clone();
1391 let fut = async move {
1392 let method = HeadObjectSvc(inner);
1393 let codec = tonic_prost::ProstCodec::default();
1394 let mut grpc = tonic::server::Grpc::new(codec)
1395 .apply_compression_config(
1396 accept_compression_encodings,
1397 send_compression_encodings,
1398 )
1399 .apply_max_message_size_config(
1400 max_decoding_message_size,
1401 max_encoding_message_size,
1402 );
1403 let res = grpc.unary(method, req).await;
1404 Ok(res)
1405 };
1406 Box::pin(fut)
1407 }
1408 "/acyclic.objects.v1.ObjectsService/DeleteObject" => {
1409 #[allow(non_camel_case_types)]
1410 struct DeleteObjectSvc<T: ObjectsService>(pub Arc<T>);
1411 impl<
1412 T: ObjectsService,
1413 > tonic::server::UnaryService<super::DeleteObjectRequest>
1414 for DeleteObjectSvc<T> {
1415 type Response = super::DeleteObjectResponse;
1416 type Future = BoxFuture<
1417 tonic::Response<Self::Response>,
1418 tonic::Status,
1419 >;
1420 fn call(
1421 &mut self,
1422 request: tonic::Request<super::DeleteObjectRequest>,
1423 ) -> Self::Future {
1424 let inner = Arc::clone(&self.0);
1425 let fut = async move {
1426 <T as ObjectsService>::delete_object(&inner, request).await
1427 };
1428 Box::pin(fut)
1429 }
1430 }
1431 let accept_compression_encodings = self.accept_compression_encodings;
1432 let send_compression_encodings = self.send_compression_encodings;
1433 let max_decoding_message_size = self.max_decoding_message_size;
1434 let max_encoding_message_size = self.max_encoding_message_size;
1435 let inner = self.inner.clone();
1436 let fut = async move {
1437 let method = DeleteObjectSvc(inner);
1438 let codec = tonic_prost::ProstCodec::default();
1439 let mut grpc = tonic::server::Grpc::new(codec)
1440 .apply_compression_config(
1441 accept_compression_encodings,
1442 send_compression_encodings,
1443 )
1444 .apply_max_message_size_config(
1445 max_decoding_message_size,
1446 max_encoding_message_size,
1447 );
1448 let res = grpc.unary(method, req).await;
1449 Ok(res)
1450 };
1451 Box::pin(fut)
1452 }
1453 "/acyclic.objects.v1.ObjectsService/ListObjects" => {
1454 #[allow(non_camel_case_types)]
1455 struct ListObjectsSvc<T: ObjectsService>(pub Arc<T>);
1456 impl<
1457 T: ObjectsService,
1458 > tonic::server::UnaryService<super::ListObjectsRequest>
1459 for ListObjectsSvc<T> {
1460 type Response = super::ListObjectsResponse;
1461 type Future = BoxFuture<
1462 tonic::Response<Self::Response>,
1463 tonic::Status,
1464 >;
1465 fn call(
1466 &mut self,
1467 request: tonic::Request<super::ListObjectsRequest>,
1468 ) -> Self::Future {
1469 let inner = Arc::clone(&self.0);
1470 let fut = async move {
1471 <T as ObjectsService>::list_objects(&inner, request).await
1472 };
1473 Box::pin(fut)
1474 }
1475 }
1476 let accept_compression_encodings = self.accept_compression_encodings;
1477 let send_compression_encodings = self.send_compression_encodings;
1478 let max_decoding_message_size = self.max_decoding_message_size;
1479 let max_encoding_message_size = self.max_encoding_message_size;
1480 let inner = self.inner.clone();
1481 let fut = async move {
1482 let method = ListObjectsSvc(inner);
1483 let codec = tonic_prost::ProstCodec::default();
1484 let mut grpc = tonic::server::Grpc::new(codec)
1485 .apply_compression_config(
1486 accept_compression_encodings,
1487 send_compression_encodings,
1488 )
1489 .apply_max_message_size_config(
1490 max_decoding_message_size,
1491 max_encoding_message_size,
1492 );
1493 let res = grpc.unary(method, req).await;
1494 Ok(res)
1495 };
1496 Box::pin(fut)
1497 }
1498 _ => {
1499 Box::pin(async move {
1500 let mut response = http::Response::new(
1501 tonic::body::Body::default(),
1502 );
1503 let headers = response.headers_mut();
1504 headers
1505 .insert(
1506 tonic::Status::GRPC_STATUS,
1507 (tonic::Code::Unimplemented as i32).into(),
1508 );
1509 headers
1510 .insert(
1511 http::header::CONTENT_TYPE,
1512 tonic::metadata::GRPC_CONTENT_TYPE,
1513 );
1514 Ok(response)
1515 })
1516 }
1517 }
1518 }
1519 }
1520 impl<T> Clone for ObjectsServiceServer<T> {
1521 fn clone(&self) -> Self {
1522 let inner = self.inner.clone();
1523 Self {
1524 inner,
1525 accept_compression_encodings: self.accept_compression_encodings,
1526 send_compression_encodings: self.send_compression_encodings,
1527 max_decoding_message_size: self.max_decoding_message_size,
1528 max_encoding_message_size: self.max_encoding_message_size,
1529 }
1530 }
1531 }
1532 pub const SERVICE_NAME: &str = "acyclic.objects.v1.ObjectsService";
1534 impl<T> tonic::server::NamedService for ObjectsServiceServer<T> {
1535 const NAME: &'static str = SERVICE_NAME;
1536 }
1537}
1538#[cfg(feature = "grpc")]
1540pub mod multipart_service_client {
1541 #![allow(
1542 unused_variables,
1543 dead_code,
1544 missing_docs,
1545 clippy::wildcard_imports,
1546 clippy::let_unit_value,
1547 )]
1548 use tonic::codegen::*;
1549 use tonic::codegen::http::Uri;
1550 #[derive(Debug, Clone)]
1551 pub struct MultipartServiceClient<T> {
1552 inner: tonic::client::Grpc<T>,
1553 }
1554 impl MultipartServiceClient<tonic::transport::Channel> {
1555 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1557 where
1558 D: TryInto<tonic::transport::Endpoint>,
1559 D::Error: Into<StdError>,
1560 {
1561 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1562 Ok(Self::new(conn))
1563 }
1564 }
1565 impl<T> MultipartServiceClient<T>
1566 where
1567 T: tonic::client::GrpcService<tonic::body::Body>,
1568 T::Error: Into<StdError>,
1569 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1570 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1571 {
1572 pub fn new(inner: T) -> Self {
1573 let inner = tonic::client::Grpc::new(inner);
1574 Self { inner }
1575 }
1576 pub fn with_origin(inner: T, origin: Uri) -> Self {
1577 let inner = tonic::client::Grpc::with_origin(inner, origin);
1578 Self { inner }
1579 }
1580 pub fn with_interceptor<F>(
1581 inner: T,
1582 interceptor: F,
1583 ) -> MultipartServiceClient<InterceptedService<T, F>>
1584 where
1585 F: tonic::service::Interceptor,
1586 T::ResponseBody: Default,
1587 T: tonic::codegen::Service<
1588 http::Request<tonic::body::Body>,
1589 Response = http::Response<
1590 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1591 >,
1592 >,
1593 <T as tonic::codegen::Service<
1594 http::Request<tonic::body::Body>,
1595 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1596 {
1597 MultipartServiceClient::new(InterceptedService::new(inner, interceptor))
1598 }
1599 #[must_use]
1604 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1605 self.inner = self.inner.send_compressed(encoding);
1606 self
1607 }
1608 #[must_use]
1610 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1611 self.inner = self.inner.accept_compressed(encoding);
1612 self
1613 }
1614 #[must_use]
1618 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1619 self.inner = self.inner.max_decoding_message_size(limit);
1620 self
1621 }
1622 #[must_use]
1626 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1627 self.inner = self.inner.max_encoding_message_size(limit);
1628 self
1629 }
1630 pub async fn create_multipart(
1631 &mut self,
1632 request: impl tonic::IntoRequest<super::CreateMultipartRequest>,
1633 ) -> std::result::Result<
1634 tonic::Response<super::MultipartUpload>,
1635 tonic::Status,
1636 > {
1637 self.inner
1638 .ready()
1639 .await
1640 .map_err(|e| {
1641 tonic::Status::unknown(
1642 format!("Service was not ready: {}", e.into()),
1643 )
1644 })?;
1645 let codec = tonic_prost::ProstCodec::default();
1646 let path = http::uri::PathAndQuery::from_static(
1647 "/acyclic.objects.v1.MultipartService/CreateMultipart",
1648 );
1649 let mut req = request.into_request();
1650 req.extensions_mut()
1651 .insert(
1652 GrpcMethod::new(
1653 "acyclic.objects.v1.MultipartService",
1654 "CreateMultipart",
1655 ),
1656 );
1657 self.inner.unary(req, path, codec).await
1658 }
1659 pub async fn upload_part(
1660 &mut self,
1661 request: impl tonic::IntoStreamingRequest<Message = super::UploadPartRequest>,
1662 ) -> std::result::Result<tonic::Response<super::UploadedPart>, tonic::Status> {
1663 self.inner
1664 .ready()
1665 .await
1666 .map_err(|e| {
1667 tonic::Status::unknown(
1668 format!("Service was not ready: {}", e.into()),
1669 )
1670 })?;
1671 let codec = tonic_prost::ProstCodec::default();
1672 let path = http::uri::PathAndQuery::from_static(
1673 "/acyclic.objects.v1.MultipartService/UploadPart",
1674 );
1675 let mut req = request.into_streaming_request();
1676 req.extensions_mut()
1677 .insert(
1678 GrpcMethod::new("acyclic.objects.v1.MultipartService", "UploadPart"),
1679 );
1680 self.inner.client_streaming(req, path, codec).await
1681 }
1682 pub async fn list_parts(
1683 &mut self,
1684 request: impl tonic::IntoRequest<super::ListPartsRequest>,
1685 ) -> std::result::Result<
1686 tonic::Response<super::ListPartsResponse>,
1687 tonic::Status,
1688 > {
1689 self.inner
1690 .ready()
1691 .await
1692 .map_err(|e| {
1693 tonic::Status::unknown(
1694 format!("Service was not ready: {}", e.into()),
1695 )
1696 })?;
1697 let codec = tonic_prost::ProstCodec::default();
1698 let path = http::uri::PathAndQuery::from_static(
1699 "/acyclic.objects.v1.MultipartService/ListParts",
1700 );
1701 let mut req = request.into_request();
1702 req.extensions_mut()
1703 .insert(
1704 GrpcMethod::new("acyclic.objects.v1.MultipartService", "ListParts"),
1705 );
1706 self.inner.unary(req, path, codec).await
1707 }
1708 pub async fn complete_multipart(
1709 &mut self,
1710 request: impl tonic::IntoRequest<super::CompleteMultipartRequest>,
1711 ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status> {
1712 self.inner
1713 .ready()
1714 .await
1715 .map_err(|e| {
1716 tonic::Status::unknown(
1717 format!("Service was not ready: {}", e.into()),
1718 )
1719 })?;
1720 let codec = tonic_prost::ProstCodec::default();
1721 let path = http::uri::PathAndQuery::from_static(
1722 "/acyclic.objects.v1.MultipartService/CompleteMultipart",
1723 );
1724 let mut req = request.into_request();
1725 req.extensions_mut()
1726 .insert(
1727 GrpcMethod::new(
1728 "acyclic.objects.v1.MultipartService",
1729 "CompleteMultipart",
1730 ),
1731 );
1732 self.inner.unary(req, path, codec).await
1733 }
1734 pub async fn abort_multipart(
1735 &mut self,
1736 request: impl tonic::IntoRequest<super::AbortMultipartRequest>,
1737 ) -> std::result::Result<
1738 tonic::Response<super::AbortMultipartResponse>,
1739 tonic::Status,
1740 > {
1741 self.inner
1742 .ready()
1743 .await
1744 .map_err(|e| {
1745 tonic::Status::unknown(
1746 format!("Service was not ready: {}", e.into()),
1747 )
1748 })?;
1749 let codec = tonic_prost::ProstCodec::default();
1750 let path = http::uri::PathAndQuery::from_static(
1751 "/acyclic.objects.v1.MultipartService/AbortMultipart",
1752 );
1753 let mut req = request.into_request();
1754 req.extensions_mut()
1755 .insert(
1756 GrpcMethod::new(
1757 "acyclic.objects.v1.MultipartService",
1758 "AbortMultipart",
1759 ),
1760 );
1761 self.inner.unary(req, path, codec).await
1762 }
1763 }
1764}
1765#[cfg(feature = "grpc")]
1767pub mod multipart_service_server {
1768 #![allow(
1769 unused_variables,
1770 dead_code,
1771 missing_docs,
1772 clippy::wildcard_imports,
1773 clippy::let_unit_value,
1774 )]
1775 use tonic::codegen::*;
1776 #[async_trait]
1778 pub trait MultipartService: std::marker::Send + std::marker::Sync + 'static {
1779 async fn create_multipart(
1780 &self,
1781 request: tonic::Request<super::CreateMultipartRequest>,
1782 ) -> std::result::Result<tonic::Response<super::MultipartUpload>, tonic::Status>;
1783 async fn upload_part(
1784 &self,
1785 request: tonic::Request<tonic::Streaming<super::UploadPartRequest>>,
1786 ) -> std::result::Result<tonic::Response<super::UploadedPart>, tonic::Status>;
1787 async fn list_parts(
1788 &self,
1789 request: tonic::Request<super::ListPartsRequest>,
1790 ) -> std::result::Result<
1791 tonic::Response<super::ListPartsResponse>,
1792 tonic::Status,
1793 >;
1794 async fn complete_multipart(
1795 &self,
1796 request: tonic::Request<super::CompleteMultipartRequest>,
1797 ) -> std::result::Result<tonic::Response<super::ObjectVersion>, tonic::Status>;
1798 async fn abort_multipart(
1799 &self,
1800 request: tonic::Request<super::AbortMultipartRequest>,
1801 ) -> std::result::Result<
1802 tonic::Response<super::AbortMultipartResponse>,
1803 tonic::Status,
1804 >;
1805 }
1806 #[derive(Debug)]
1807 pub struct MultipartServiceServer<T> {
1808 inner: Arc<T>,
1809 accept_compression_encodings: EnabledCompressionEncodings,
1810 send_compression_encodings: EnabledCompressionEncodings,
1811 max_decoding_message_size: Option<usize>,
1812 max_encoding_message_size: Option<usize>,
1813 }
1814 impl<T> MultipartServiceServer<T> {
1815 pub fn new(inner: T) -> Self {
1816 Self::from_arc(Arc::new(inner))
1817 }
1818 pub fn from_arc(inner: Arc<T>) -> Self {
1819 Self {
1820 inner,
1821 accept_compression_encodings: Default::default(),
1822 send_compression_encodings: Default::default(),
1823 max_decoding_message_size: None,
1824 max_encoding_message_size: None,
1825 }
1826 }
1827 pub fn with_interceptor<F>(
1828 inner: T,
1829 interceptor: F,
1830 ) -> InterceptedService<Self, F>
1831 where
1832 F: tonic::service::Interceptor,
1833 {
1834 InterceptedService::new(Self::new(inner), interceptor)
1835 }
1836 #[must_use]
1838 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1839 self.accept_compression_encodings.enable(encoding);
1840 self
1841 }
1842 #[must_use]
1844 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1845 self.send_compression_encodings.enable(encoding);
1846 self
1847 }
1848 #[must_use]
1852 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1853 self.max_decoding_message_size = Some(limit);
1854 self
1855 }
1856 #[must_use]
1860 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1861 self.max_encoding_message_size = Some(limit);
1862 self
1863 }
1864 }
1865 impl<T, B> tonic::codegen::Service<http::Request<B>> for MultipartServiceServer<T>
1866 where
1867 T: MultipartService,
1868 B: Body + std::marker::Send + 'static,
1869 B::Error: Into<StdError> + std::marker::Send + 'static,
1870 {
1871 type Response = http::Response<tonic::body::Body>;
1872 type Error = std::convert::Infallible;
1873 type Future = BoxFuture<Self::Response, Self::Error>;
1874 fn poll_ready(
1875 &mut self,
1876 _cx: &mut Context<'_>,
1877 ) -> Poll<std::result::Result<(), Self::Error>> {
1878 Poll::Ready(Ok(()))
1879 }
1880 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1881 match req.uri().path() {
1882 "/acyclic.objects.v1.MultipartService/CreateMultipart" => {
1883 #[allow(non_camel_case_types)]
1884 struct CreateMultipartSvc<T: MultipartService>(pub Arc<T>);
1885 impl<
1886 T: MultipartService,
1887 > tonic::server::UnaryService<super::CreateMultipartRequest>
1888 for CreateMultipartSvc<T> {
1889 type Response = super::MultipartUpload;
1890 type Future = BoxFuture<
1891 tonic::Response<Self::Response>,
1892 tonic::Status,
1893 >;
1894 fn call(
1895 &mut self,
1896 request: tonic::Request<super::CreateMultipartRequest>,
1897 ) -> Self::Future {
1898 let inner = Arc::clone(&self.0);
1899 let fut = async move {
1900 <T as MultipartService>::create_multipart(&inner, request)
1901 .await
1902 };
1903 Box::pin(fut)
1904 }
1905 }
1906 let accept_compression_encodings = self.accept_compression_encodings;
1907 let send_compression_encodings = self.send_compression_encodings;
1908 let max_decoding_message_size = self.max_decoding_message_size;
1909 let max_encoding_message_size = self.max_encoding_message_size;
1910 let inner = self.inner.clone();
1911 let fut = async move {
1912 let method = CreateMultipartSvc(inner);
1913 let codec = tonic_prost::ProstCodec::default();
1914 let mut grpc = tonic::server::Grpc::new(codec)
1915 .apply_compression_config(
1916 accept_compression_encodings,
1917 send_compression_encodings,
1918 )
1919 .apply_max_message_size_config(
1920 max_decoding_message_size,
1921 max_encoding_message_size,
1922 );
1923 let res = grpc.unary(method, req).await;
1924 Ok(res)
1925 };
1926 Box::pin(fut)
1927 }
1928 "/acyclic.objects.v1.MultipartService/UploadPart" => {
1929 #[allow(non_camel_case_types)]
1930 struct UploadPartSvc<T: MultipartService>(pub Arc<T>);
1931 impl<
1932 T: MultipartService,
1933 > tonic::server::ClientStreamingService<super::UploadPartRequest>
1934 for UploadPartSvc<T> {
1935 type Response = super::UploadedPart;
1936 type Future = BoxFuture<
1937 tonic::Response<Self::Response>,
1938 tonic::Status,
1939 >;
1940 fn call(
1941 &mut self,
1942 request: tonic::Request<
1943 tonic::Streaming<super::UploadPartRequest>,
1944 >,
1945 ) -> Self::Future {
1946 let inner = Arc::clone(&self.0);
1947 let fut = async move {
1948 <T as MultipartService>::upload_part(&inner, request).await
1949 };
1950 Box::pin(fut)
1951 }
1952 }
1953 let accept_compression_encodings = self.accept_compression_encodings;
1954 let send_compression_encodings = self.send_compression_encodings;
1955 let max_decoding_message_size = self.max_decoding_message_size;
1956 let max_encoding_message_size = self.max_encoding_message_size;
1957 let inner = self.inner.clone();
1958 let fut = async move {
1959 let method = UploadPartSvc(inner);
1960 let codec = tonic_prost::ProstCodec::default();
1961 let mut grpc = tonic::server::Grpc::new(codec)
1962 .apply_compression_config(
1963 accept_compression_encodings,
1964 send_compression_encodings,
1965 )
1966 .apply_max_message_size_config(
1967 max_decoding_message_size,
1968 max_encoding_message_size,
1969 );
1970 let res = grpc.client_streaming(method, req).await;
1971 Ok(res)
1972 };
1973 Box::pin(fut)
1974 }
1975 "/acyclic.objects.v1.MultipartService/ListParts" => {
1976 #[allow(non_camel_case_types)]
1977 struct ListPartsSvc<T: MultipartService>(pub Arc<T>);
1978 impl<
1979 T: MultipartService,
1980 > tonic::server::UnaryService<super::ListPartsRequest>
1981 for ListPartsSvc<T> {
1982 type Response = super::ListPartsResponse;
1983 type Future = BoxFuture<
1984 tonic::Response<Self::Response>,
1985 tonic::Status,
1986 >;
1987 fn call(
1988 &mut self,
1989 request: tonic::Request<super::ListPartsRequest>,
1990 ) -> Self::Future {
1991 let inner = Arc::clone(&self.0);
1992 let fut = async move {
1993 <T as MultipartService>::list_parts(&inner, request).await
1994 };
1995 Box::pin(fut)
1996 }
1997 }
1998 let accept_compression_encodings = self.accept_compression_encodings;
1999 let send_compression_encodings = self.send_compression_encodings;
2000 let max_decoding_message_size = self.max_decoding_message_size;
2001 let max_encoding_message_size = self.max_encoding_message_size;
2002 let inner = self.inner.clone();
2003 let fut = async move {
2004 let method = ListPartsSvc(inner);
2005 let codec = tonic_prost::ProstCodec::default();
2006 let mut grpc = tonic::server::Grpc::new(codec)
2007 .apply_compression_config(
2008 accept_compression_encodings,
2009 send_compression_encodings,
2010 )
2011 .apply_max_message_size_config(
2012 max_decoding_message_size,
2013 max_encoding_message_size,
2014 );
2015 let res = grpc.unary(method, req).await;
2016 Ok(res)
2017 };
2018 Box::pin(fut)
2019 }
2020 "/acyclic.objects.v1.MultipartService/CompleteMultipart" => {
2021 #[allow(non_camel_case_types)]
2022 struct CompleteMultipartSvc<T: MultipartService>(pub Arc<T>);
2023 impl<
2024 T: MultipartService,
2025 > tonic::server::UnaryService<super::CompleteMultipartRequest>
2026 for CompleteMultipartSvc<T> {
2027 type Response = super::ObjectVersion;
2028 type Future = BoxFuture<
2029 tonic::Response<Self::Response>,
2030 tonic::Status,
2031 >;
2032 fn call(
2033 &mut self,
2034 request: tonic::Request<super::CompleteMultipartRequest>,
2035 ) -> Self::Future {
2036 let inner = Arc::clone(&self.0);
2037 let fut = async move {
2038 <T as MultipartService>::complete_multipart(&inner, request)
2039 .await
2040 };
2041 Box::pin(fut)
2042 }
2043 }
2044 let accept_compression_encodings = self.accept_compression_encodings;
2045 let send_compression_encodings = self.send_compression_encodings;
2046 let max_decoding_message_size = self.max_decoding_message_size;
2047 let max_encoding_message_size = self.max_encoding_message_size;
2048 let inner = self.inner.clone();
2049 let fut = async move {
2050 let method = CompleteMultipartSvc(inner);
2051 let codec = tonic_prost::ProstCodec::default();
2052 let mut grpc = tonic::server::Grpc::new(codec)
2053 .apply_compression_config(
2054 accept_compression_encodings,
2055 send_compression_encodings,
2056 )
2057 .apply_max_message_size_config(
2058 max_decoding_message_size,
2059 max_encoding_message_size,
2060 );
2061 let res = grpc.unary(method, req).await;
2062 Ok(res)
2063 };
2064 Box::pin(fut)
2065 }
2066 "/acyclic.objects.v1.MultipartService/AbortMultipart" => {
2067 #[allow(non_camel_case_types)]
2068 struct AbortMultipartSvc<T: MultipartService>(pub Arc<T>);
2069 impl<
2070 T: MultipartService,
2071 > tonic::server::UnaryService<super::AbortMultipartRequest>
2072 for AbortMultipartSvc<T> {
2073 type Response = super::AbortMultipartResponse;
2074 type Future = BoxFuture<
2075 tonic::Response<Self::Response>,
2076 tonic::Status,
2077 >;
2078 fn call(
2079 &mut self,
2080 request: tonic::Request<super::AbortMultipartRequest>,
2081 ) -> Self::Future {
2082 let inner = Arc::clone(&self.0);
2083 let fut = async move {
2084 <T as MultipartService>::abort_multipart(&inner, request)
2085 .await
2086 };
2087 Box::pin(fut)
2088 }
2089 }
2090 let accept_compression_encodings = self.accept_compression_encodings;
2091 let send_compression_encodings = self.send_compression_encodings;
2092 let max_decoding_message_size = self.max_decoding_message_size;
2093 let max_encoding_message_size = self.max_encoding_message_size;
2094 let inner = self.inner.clone();
2095 let fut = async move {
2096 let method = AbortMultipartSvc(inner);
2097 let codec = tonic_prost::ProstCodec::default();
2098 let mut grpc = tonic::server::Grpc::new(codec)
2099 .apply_compression_config(
2100 accept_compression_encodings,
2101 send_compression_encodings,
2102 )
2103 .apply_max_message_size_config(
2104 max_decoding_message_size,
2105 max_encoding_message_size,
2106 );
2107 let res = grpc.unary(method, req).await;
2108 Ok(res)
2109 };
2110 Box::pin(fut)
2111 }
2112 _ => {
2113 Box::pin(async move {
2114 let mut response = http::Response::new(
2115 tonic::body::Body::default(),
2116 );
2117 let headers = response.headers_mut();
2118 headers
2119 .insert(
2120 tonic::Status::GRPC_STATUS,
2121 (tonic::Code::Unimplemented as i32).into(),
2122 );
2123 headers
2124 .insert(
2125 http::header::CONTENT_TYPE,
2126 tonic::metadata::GRPC_CONTENT_TYPE,
2127 );
2128 Ok(response)
2129 })
2130 }
2131 }
2132 }
2133 }
2134 impl<T> Clone for MultipartServiceServer<T> {
2135 fn clone(&self) -> Self {
2136 let inner = self.inner.clone();
2137 Self {
2138 inner,
2139 accept_compression_encodings: self.accept_compression_encodings,
2140 send_compression_encodings: self.send_compression_encodings,
2141 max_decoding_message_size: self.max_decoding_message_size,
2142 max_encoding_message_size: self.max_encoding_message_size,
2143 }
2144 }
2145 }
2146 pub const SERVICE_NAME: &str = "acyclic.objects.v1.MultipartService";
2148 impl<T> tonic::server::NamedService for MultipartServiceServer<T> {
2149 const NAME: &'static str = SERVICE_NAME;
2150 }
2151}
2152#[cfg(feature = "grpc")]
2154pub mod snapshots_service_client {
2155 #![allow(
2156 unused_variables,
2157 dead_code,
2158 missing_docs,
2159 clippy::wildcard_imports,
2160 clippy::let_unit_value,
2161 )]
2162 use tonic::codegen::*;
2163 use tonic::codegen::http::Uri;
2164 #[derive(Debug, Clone)]
2165 pub struct SnapshotsServiceClient<T> {
2166 inner: tonic::client::Grpc<T>,
2167 }
2168 impl SnapshotsServiceClient<tonic::transport::Channel> {
2169 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2171 where
2172 D: TryInto<tonic::transport::Endpoint>,
2173 D::Error: Into<StdError>,
2174 {
2175 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2176 Ok(Self::new(conn))
2177 }
2178 }
2179 impl<T> SnapshotsServiceClient<T>
2180 where
2181 T: tonic::client::GrpcService<tonic::body::Body>,
2182 T::Error: Into<StdError>,
2183 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2184 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2185 {
2186 pub fn new(inner: T) -> Self {
2187 let inner = tonic::client::Grpc::new(inner);
2188 Self { inner }
2189 }
2190 pub fn with_origin(inner: T, origin: Uri) -> Self {
2191 let inner = tonic::client::Grpc::with_origin(inner, origin);
2192 Self { inner }
2193 }
2194 pub fn with_interceptor<F>(
2195 inner: T,
2196 interceptor: F,
2197 ) -> SnapshotsServiceClient<InterceptedService<T, F>>
2198 where
2199 F: tonic::service::Interceptor,
2200 T::ResponseBody: Default,
2201 T: tonic::codegen::Service<
2202 http::Request<tonic::body::Body>,
2203 Response = http::Response<
2204 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2205 >,
2206 >,
2207 <T as tonic::codegen::Service<
2208 http::Request<tonic::body::Body>,
2209 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2210 {
2211 SnapshotsServiceClient::new(InterceptedService::new(inner, interceptor))
2212 }
2213 #[must_use]
2218 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2219 self.inner = self.inner.send_compressed(encoding);
2220 self
2221 }
2222 #[must_use]
2224 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2225 self.inner = self.inner.accept_compressed(encoding);
2226 self
2227 }
2228 #[must_use]
2232 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2233 self.inner = self.inner.max_decoding_message_size(limit);
2234 self
2235 }
2236 #[must_use]
2240 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2241 self.inner = self.inner.max_encoding_message_size(limit);
2242 self
2243 }
2244 pub async fn create_snapshot(
2245 &mut self,
2246 request: impl tonic::IntoRequest<super::CreateSnapshotRequest>,
2247 ) -> std::result::Result<tonic::Response<super::Snapshot>, tonic::Status> {
2248 self.inner
2249 .ready()
2250 .await
2251 .map_err(|e| {
2252 tonic::Status::unknown(
2253 format!("Service was not ready: {}", e.into()),
2254 )
2255 })?;
2256 let codec = tonic_prost::ProstCodec::default();
2257 let path = http::uri::PathAndQuery::from_static(
2258 "/acyclic.objects.v1.SnapshotsService/CreateSnapshot",
2259 );
2260 let mut req = request.into_request();
2261 req.extensions_mut()
2262 .insert(
2263 GrpcMethod::new(
2264 "acyclic.objects.v1.SnapshotsService",
2265 "CreateSnapshot",
2266 ),
2267 );
2268 self.inner.unary(req, path, codec).await
2269 }
2270 pub async fn destroy_snapshot(
2271 &mut self,
2272 request: impl tonic::IntoRequest<super::DestroySnapshotRequest>,
2273 ) -> std::result::Result<
2274 tonic::Response<super::DestroySnapshotResponse>,
2275 tonic::Status,
2276 > {
2277 self.inner
2278 .ready()
2279 .await
2280 .map_err(|e| {
2281 tonic::Status::unknown(
2282 format!("Service was not ready: {}", e.into()),
2283 )
2284 })?;
2285 let codec = tonic_prost::ProstCodec::default();
2286 let path = http::uri::PathAndQuery::from_static(
2287 "/acyclic.objects.v1.SnapshotsService/DestroySnapshot",
2288 );
2289 let mut req = request.into_request();
2290 req.extensions_mut()
2291 .insert(
2292 GrpcMethod::new(
2293 "acyclic.objects.v1.SnapshotsService",
2294 "DestroySnapshot",
2295 ),
2296 );
2297 self.inner.unary(req, path, codec).await
2298 }
2299 pub async fn fork_snapshot(
2300 &mut self,
2301 request: impl tonic::IntoRequest<super::ForkSnapshotRequest>,
2302 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
2303 self.inner
2304 .ready()
2305 .await
2306 .map_err(|e| {
2307 tonic::Status::unknown(
2308 format!("Service was not ready: {}", e.into()),
2309 )
2310 })?;
2311 let codec = tonic_prost::ProstCodec::default();
2312 let path = http::uri::PathAndQuery::from_static(
2313 "/acyclic.objects.v1.SnapshotsService/ForkSnapshot",
2314 );
2315 let mut req = request.into_request();
2316 req.extensions_mut()
2317 .insert(
2318 GrpcMethod::new(
2319 "acyclic.objects.v1.SnapshotsService",
2320 "ForkSnapshot",
2321 ),
2322 );
2323 self.inner.unary(req, path, codec).await
2324 }
2325 pub async fn fork_bucket(
2326 &mut self,
2327 request: impl tonic::IntoRequest<super::ForkBucketRequest>,
2328 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status> {
2329 self.inner
2330 .ready()
2331 .await
2332 .map_err(|e| {
2333 tonic::Status::unknown(
2334 format!("Service was not ready: {}", e.into()),
2335 )
2336 })?;
2337 let codec = tonic_prost::ProstCodec::default();
2338 let path = http::uri::PathAndQuery::from_static(
2339 "/acyclic.objects.v1.SnapshotsService/ForkBucket",
2340 );
2341 let mut req = request.into_request();
2342 req.extensions_mut()
2343 .insert(
2344 GrpcMethod::new("acyclic.objects.v1.SnapshotsService", "ForkBucket"),
2345 );
2346 self.inner.unary(req, path, codec).await
2347 }
2348 }
2349}
2350#[cfg(feature = "grpc")]
2352pub mod snapshots_service_server {
2353 #![allow(
2354 unused_variables,
2355 dead_code,
2356 missing_docs,
2357 clippy::wildcard_imports,
2358 clippy::let_unit_value,
2359 )]
2360 use tonic::codegen::*;
2361 #[async_trait]
2363 pub trait SnapshotsService: std::marker::Send + std::marker::Sync + 'static {
2364 async fn create_snapshot(
2365 &self,
2366 request: tonic::Request<super::CreateSnapshotRequest>,
2367 ) -> std::result::Result<tonic::Response<super::Snapshot>, tonic::Status>;
2368 async fn destroy_snapshot(
2369 &self,
2370 request: tonic::Request<super::DestroySnapshotRequest>,
2371 ) -> std::result::Result<
2372 tonic::Response<super::DestroySnapshotResponse>,
2373 tonic::Status,
2374 >;
2375 async fn fork_snapshot(
2376 &self,
2377 request: tonic::Request<super::ForkSnapshotRequest>,
2378 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
2379 async fn fork_bucket(
2380 &self,
2381 request: tonic::Request<super::ForkBucketRequest>,
2382 ) -> std::result::Result<tonic::Response<super::Bucket>, tonic::Status>;
2383 }
2384 #[derive(Debug)]
2385 pub struct SnapshotsServiceServer<T> {
2386 inner: Arc<T>,
2387 accept_compression_encodings: EnabledCompressionEncodings,
2388 send_compression_encodings: EnabledCompressionEncodings,
2389 max_decoding_message_size: Option<usize>,
2390 max_encoding_message_size: Option<usize>,
2391 }
2392 impl<T> SnapshotsServiceServer<T> {
2393 pub fn new(inner: T) -> Self {
2394 Self::from_arc(Arc::new(inner))
2395 }
2396 pub fn from_arc(inner: Arc<T>) -> Self {
2397 Self {
2398 inner,
2399 accept_compression_encodings: Default::default(),
2400 send_compression_encodings: Default::default(),
2401 max_decoding_message_size: None,
2402 max_encoding_message_size: None,
2403 }
2404 }
2405 pub fn with_interceptor<F>(
2406 inner: T,
2407 interceptor: F,
2408 ) -> InterceptedService<Self, F>
2409 where
2410 F: tonic::service::Interceptor,
2411 {
2412 InterceptedService::new(Self::new(inner), interceptor)
2413 }
2414 #[must_use]
2416 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2417 self.accept_compression_encodings.enable(encoding);
2418 self
2419 }
2420 #[must_use]
2422 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2423 self.send_compression_encodings.enable(encoding);
2424 self
2425 }
2426 #[must_use]
2430 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2431 self.max_decoding_message_size = Some(limit);
2432 self
2433 }
2434 #[must_use]
2438 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2439 self.max_encoding_message_size = Some(limit);
2440 self
2441 }
2442 }
2443 impl<T, B> tonic::codegen::Service<http::Request<B>> for SnapshotsServiceServer<T>
2444 where
2445 T: SnapshotsService,
2446 B: Body + std::marker::Send + 'static,
2447 B::Error: Into<StdError> + std::marker::Send + 'static,
2448 {
2449 type Response = http::Response<tonic::body::Body>;
2450 type Error = std::convert::Infallible;
2451 type Future = BoxFuture<Self::Response, Self::Error>;
2452 fn poll_ready(
2453 &mut self,
2454 _cx: &mut Context<'_>,
2455 ) -> Poll<std::result::Result<(), Self::Error>> {
2456 Poll::Ready(Ok(()))
2457 }
2458 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2459 match req.uri().path() {
2460 "/acyclic.objects.v1.SnapshotsService/CreateSnapshot" => {
2461 #[allow(non_camel_case_types)]
2462 struct CreateSnapshotSvc<T: SnapshotsService>(pub Arc<T>);
2463 impl<
2464 T: SnapshotsService,
2465 > tonic::server::UnaryService<super::CreateSnapshotRequest>
2466 for CreateSnapshotSvc<T> {
2467 type Response = super::Snapshot;
2468 type Future = BoxFuture<
2469 tonic::Response<Self::Response>,
2470 tonic::Status,
2471 >;
2472 fn call(
2473 &mut self,
2474 request: tonic::Request<super::CreateSnapshotRequest>,
2475 ) -> Self::Future {
2476 let inner = Arc::clone(&self.0);
2477 let fut = async move {
2478 <T as SnapshotsService>::create_snapshot(&inner, request)
2479 .await
2480 };
2481 Box::pin(fut)
2482 }
2483 }
2484 let accept_compression_encodings = self.accept_compression_encodings;
2485 let send_compression_encodings = self.send_compression_encodings;
2486 let max_decoding_message_size = self.max_decoding_message_size;
2487 let max_encoding_message_size = self.max_encoding_message_size;
2488 let inner = self.inner.clone();
2489 let fut = async move {
2490 let method = CreateSnapshotSvc(inner);
2491 let codec = tonic_prost::ProstCodec::default();
2492 let mut grpc = tonic::server::Grpc::new(codec)
2493 .apply_compression_config(
2494 accept_compression_encodings,
2495 send_compression_encodings,
2496 )
2497 .apply_max_message_size_config(
2498 max_decoding_message_size,
2499 max_encoding_message_size,
2500 );
2501 let res = grpc.unary(method, req).await;
2502 Ok(res)
2503 };
2504 Box::pin(fut)
2505 }
2506 "/acyclic.objects.v1.SnapshotsService/DestroySnapshot" => {
2507 #[allow(non_camel_case_types)]
2508 struct DestroySnapshotSvc<T: SnapshotsService>(pub Arc<T>);
2509 impl<
2510 T: SnapshotsService,
2511 > tonic::server::UnaryService<super::DestroySnapshotRequest>
2512 for DestroySnapshotSvc<T> {
2513 type Response = super::DestroySnapshotResponse;
2514 type Future = BoxFuture<
2515 tonic::Response<Self::Response>,
2516 tonic::Status,
2517 >;
2518 fn call(
2519 &mut self,
2520 request: tonic::Request<super::DestroySnapshotRequest>,
2521 ) -> Self::Future {
2522 let inner = Arc::clone(&self.0);
2523 let fut = async move {
2524 <T as SnapshotsService>::destroy_snapshot(&inner, request)
2525 .await
2526 };
2527 Box::pin(fut)
2528 }
2529 }
2530 let accept_compression_encodings = self.accept_compression_encodings;
2531 let send_compression_encodings = self.send_compression_encodings;
2532 let max_decoding_message_size = self.max_decoding_message_size;
2533 let max_encoding_message_size = self.max_encoding_message_size;
2534 let inner = self.inner.clone();
2535 let fut = async move {
2536 let method = DestroySnapshotSvc(inner);
2537 let codec = tonic_prost::ProstCodec::default();
2538 let mut grpc = tonic::server::Grpc::new(codec)
2539 .apply_compression_config(
2540 accept_compression_encodings,
2541 send_compression_encodings,
2542 )
2543 .apply_max_message_size_config(
2544 max_decoding_message_size,
2545 max_encoding_message_size,
2546 );
2547 let res = grpc.unary(method, req).await;
2548 Ok(res)
2549 };
2550 Box::pin(fut)
2551 }
2552 "/acyclic.objects.v1.SnapshotsService/ForkSnapshot" => {
2553 #[allow(non_camel_case_types)]
2554 struct ForkSnapshotSvc<T: SnapshotsService>(pub Arc<T>);
2555 impl<
2556 T: SnapshotsService,
2557 > tonic::server::UnaryService<super::ForkSnapshotRequest>
2558 for ForkSnapshotSvc<T> {
2559 type Response = super::Bucket;
2560 type Future = BoxFuture<
2561 tonic::Response<Self::Response>,
2562 tonic::Status,
2563 >;
2564 fn call(
2565 &mut self,
2566 request: tonic::Request<super::ForkSnapshotRequest>,
2567 ) -> Self::Future {
2568 let inner = Arc::clone(&self.0);
2569 let fut = async move {
2570 <T as SnapshotsService>::fork_snapshot(&inner, request)
2571 .await
2572 };
2573 Box::pin(fut)
2574 }
2575 }
2576 let accept_compression_encodings = self.accept_compression_encodings;
2577 let send_compression_encodings = self.send_compression_encodings;
2578 let max_decoding_message_size = self.max_decoding_message_size;
2579 let max_encoding_message_size = self.max_encoding_message_size;
2580 let inner = self.inner.clone();
2581 let fut = async move {
2582 let method = ForkSnapshotSvc(inner);
2583 let codec = tonic_prost::ProstCodec::default();
2584 let mut grpc = tonic::server::Grpc::new(codec)
2585 .apply_compression_config(
2586 accept_compression_encodings,
2587 send_compression_encodings,
2588 )
2589 .apply_max_message_size_config(
2590 max_decoding_message_size,
2591 max_encoding_message_size,
2592 );
2593 let res = grpc.unary(method, req).await;
2594 Ok(res)
2595 };
2596 Box::pin(fut)
2597 }
2598 "/acyclic.objects.v1.SnapshotsService/ForkBucket" => {
2599 #[allow(non_camel_case_types)]
2600 struct ForkBucketSvc<T: SnapshotsService>(pub Arc<T>);
2601 impl<
2602 T: SnapshotsService,
2603 > tonic::server::UnaryService<super::ForkBucketRequest>
2604 for ForkBucketSvc<T> {
2605 type Response = super::Bucket;
2606 type Future = BoxFuture<
2607 tonic::Response<Self::Response>,
2608 tonic::Status,
2609 >;
2610 fn call(
2611 &mut self,
2612 request: tonic::Request<super::ForkBucketRequest>,
2613 ) -> Self::Future {
2614 let inner = Arc::clone(&self.0);
2615 let fut = async move {
2616 <T as SnapshotsService>::fork_bucket(&inner, request).await
2617 };
2618 Box::pin(fut)
2619 }
2620 }
2621 let accept_compression_encodings = self.accept_compression_encodings;
2622 let send_compression_encodings = self.send_compression_encodings;
2623 let max_decoding_message_size = self.max_decoding_message_size;
2624 let max_encoding_message_size = self.max_encoding_message_size;
2625 let inner = self.inner.clone();
2626 let fut = async move {
2627 let method = ForkBucketSvc(inner);
2628 let codec = tonic_prost::ProstCodec::default();
2629 let mut grpc = tonic::server::Grpc::new(codec)
2630 .apply_compression_config(
2631 accept_compression_encodings,
2632 send_compression_encodings,
2633 )
2634 .apply_max_message_size_config(
2635 max_decoding_message_size,
2636 max_encoding_message_size,
2637 );
2638 let res = grpc.unary(method, req).await;
2639 Ok(res)
2640 };
2641 Box::pin(fut)
2642 }
2643 _ => {
2644 Box::pin(async move {
2645 let mut response = http::Response::new(
2646 tonic::body::Body::default(),
2647 );
2648 let headers = response.headers_mut();
2649 headers
2650 .insert(
2651 tonic::Status::GRPC_STATUS,
2652 (tonic::Code::Unimplemented as i32).into(),
2653 );
2654 headers
2655 .insert(
2656 http::header::CONTENT_TYPE,
2657 tonic::metadata::GRPC_CONTENT_TYPE,
2658 );
2659 Ok(response)
2660 })
2661 }
2662 }
2663 }
2664 }
2665 impl<T> Clone for SnapshotsServiceServer<T> {
2666 fn clone(&self) -> Self {
2667 let inner = self.inner.clone();
2668 Self {
2669 inner,
2670 accept_compression_encodings: self.accept_compression_encodings,
2671 send_compression_encodings: self.send_compression_encodings,
2672 max_decoding_message_size: self.max_decoding_message_size,
2673 max_encoding_message_size: self.max_encoding_message_size,
2674 }
2675 }
2676 }
2677 pub const SERVICE_NAME: &str = "acyclic.objects.v1.SnapshotsService";
2679 impl<T> tonic::server::NamedService for SnapshotsServiceServer<T> {
2680 const NAME: &'static str = SERVICE_NAME;
2681 }
2682}