1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct BlobMeta {
5 #[prost(message, repeated, tag = "2")]
8 pub chunks: ::prost::alloc::vec::Vec<blob_meta::ChunkMeta>,
9}
10pub mod blob_meta {
12 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
13 pub struct ChunkMeta {
14 #[prost(bytes = "bytes", tag = "1")]
16 pub digest: ::prost::bytes::Bytes,
17 #[prost(uint64, tag = "2")]
19 pub size: u64,
20 }
21}
22#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct Directory {
34 #[prost(message, repeated, tag = "1")]
35 pub directories: ::prost::alloc::vec::Vec<DirectoryEntry>,
36 #[prost(message, repeated, tag = "2")]
37 pub files: ::prost::alloc::vec::Vec<FileEntry>,
38 #[prost(message, repeated, tag = "3")]
39 pub symlinks: ::prost::alloc::vec::Vec<SymlinkEntry>,
40}
41#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
43pub struct DirectoryEntry {
44 #[prost(bytes = "bytes", tag = "1")]
46 pub name: ::prost::bytes::Bytes,
47 #[prost(bytes = "bytes", tag = "2")]
49 pub digest: ::prost::bytes::Bytes,
50 #[prost(uint64, tag = "3")]
65 pub size: u64,
66}
67#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
69pub struct FileEntry {
70 #[prost(bytes = "bytes", tag = "1")]
72 pub name: ::prost::bytes::Bytes,
73 #[prost(bytes = "bytes", tag = "2")]
75 pub digest: ::prost::bytes::Bytes,
76 #[prost(uint64, tag = "3")]
78 pub size: u64,
79 #[prost(bool, tag = "4")]
81 pub executable: bool,
82}
83#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
85pub struct SymlinkEntry {
86 #[prost(bytes = "bytes", tag = "1")]
88 pub name: ::prost::bytes::Bytes,
89 #[prost(bytes = "bytes", tag = "2")]
91 pub target: ::prost::bytes::Bytes,
92}
93#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
95pub struct Entry {
96 #[prost(oneof = "entry::Entry", tags = "1, 2, 3")]
97 pub entry: ::core::option::Option<entry::Entry>,
98}
99pub mod entry {
101 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
102 pub enum Entry {
103 #[prost(message, tag = "1")]
104 Directory(super::DirectoryEntry),
105 #[prost(message, tag = "2")]
106 File(super::FileEntry),
107 #[prost(message, tag = "3")]
108 Symlink(super::SymlinkEntry),
109 }
110}
111#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
112pub struct StatBlobRequest {
113 #[prost(bytes = "bytes", tag = "1")]
115 pub digest: ::prost::bytes::Bytes,
116}
117#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
118pub struct StatBlobResponse {}
119#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
120pub struct GetBlobRequest {
121 #[prost(bytes = "bytes", tag = "1")]
123 pub digest: ::prost::bytes::Bytes,
124}
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct GetBlobResponse {
127 #[prost(message, optional, tag = "1")]
128 pub blob_meta: ::core::option::Option<BlobMeta>,
129}
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct PutBlobRequest {
132 #[prost(bytes = "bytes", tag = "1")]
134 pub digest: ::prost::bytes::Bytes,
135 #[prost(message, optional, tag = "2")]
137 pub blob_meta: ::core::option::Option<BlobMeta>,
138}
139#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
140pub struct PutBlobResponse {}
141pub mod blob_store_service_client {
143 #![allow(
144 unused_variables,
145 dead_code,
146 missing_docs,
147 clippy::wildcard_imports,
148 clippy::let_unit_value,
149 )]
150 use tonic::codegen::*;
151 use tonic::codegen::http::Uri;
152 #[derive(Debug, Clone)]
158 pub struct BlobStoreServiceClient<T> {
159 inner: tonic::client::Grpc<T>,
160 }
161 impl BlobStoreServiceClient<tonic::transport::Channel> {
162 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
164 where
165 D: TryInto<tonic::transport::Endpoint>,
166 D::Error: Into<StdError>,
167 {
168 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
169 Ok(Self::new(conn))
170 }
171 }
172 impl<T> BlobStoreServiceClient<T>
173 where
174 T: tonic::client::GrpcService<tonic::body::Body>,
175 T::Error: Into<StdError>,
176 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
177 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
178 {
179 pub fn new(inner: T) -> Self {
180 let inner = tonic::client::Grpc::new(inner);
181 Self { inner }
182 }
183 pub fn with_origin(inner: T, origin: Uri) -> Self {
184 let inner = tonic::client::Grpc::with_origin(inner, origin);
185 Self { inner }
186 }
187 pub fn with_interceptor<F>(
188 inner: T,
189 interceptor: F,
190 ) -> BlobStoreServiceClient<InterceptedService<T, F>>
191 where
192 F: tonic::service::Interceptor,
193 T::ResponseBody: Default,
194 T: tonic::codegen::Service<
195 http::Request<tonic::body::Body>,
196 Response = http::Response<
197 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
198 >,
199 >,
200 <T as tonic::codegen::Service<
201 http::Request<tonic::body::Body>,
202 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
203 {
204 BlobStoreServiceClient::new(InterceptedService::new(inner, interceptor))
205 }
206 #[must_use]
211 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
212 self.inner = self.inner.send_compressed(encoding);
213 self
214 }
215 #[must_use]
217 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
218 self.inner = self.inner.accept_compressed(encoding);
219 self
220 }
221 #[must_use]
225 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
226 self.inner = self.inner.max_decoding_message_size(limit);
227 self
228 }
229 #[must_use]
233 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
234 self.inner = self.inner.max_encoding_message_size(limit);
235 self
236 }
237 pub async fn stat_blob(
239 &mut self,
240 request: impl tonic::IntoRequest<super::StatBlobRequest>,
241 ) -> std::result::Result<
242 tonic::Response<super::StatBlobResponse>,
243 tonic::Status,
244 > {
245 self.inner
246 .ready()
247 .await
248 .map_err(|e| {
249 tonic::Status::unknown(
250 format!("Service was not ready: {}", e.into()),
251 )
252 })?;
253 let codec = tonic_prost::ProstCodec::default();
254 let path = http::uri::PathAndQuery::from_static(
255 "/snix.castore.v1.BlobStoreService/StatBlob",
256 );
257 let mut req = request.into_request();
258 req.extensions_mut()
259 .insert(GrpcMethod::new("snix.castore.v1.BlobStoreService", "StatBlob"));
260 self.inner.unary(req, path, codec).await
261 }
262 pub async fn get_blob(
264 &mut self,
265 request: impl tonic::IntoRequest<super::GetBlobRequest>,
266 ) -> std::result::Result<
267 tonic::Response<super::GetBlobResponse>,
268 tonic::Status,
269 > {
270 self.inner
271 .ready()
272 .await
273 .map_err(|e| {
274 tonic::Status::unknown(
275 format!("Service was not ready: {}", e.into()),
276 )
277 })?;
278 let codec = tonic_prost::ProstCodec::default();
279 let path = http::uri::PathAndQuery::from_static(
280 "/snix.castore.v1.BlobStoreService/GetBlob",
281 );
282 let mut req = request.into_request();
283 req.extensions_mut()
284 .insert(GrpcMethod::new("snix.castore.v1.BlobStoreService", "GetBlob"));
285 self.inner.unary(req, path, codec).await
286 }
287 pub async fn put_blob(
289 &mut self,
290 request: impl tonic::IntoRequest<super::PutBlobRequest>,
291 ) -> std::result::Result<
292 tonic::Response<super::PutBlobResponse>,
293 tonic::Status,
294 > {
295 self.inner
296 .ready()
297 .await
298 .map_err(|e| {
299 tonic::Status::unknown(
300 format!("Service was not ready: {}", e.into()),
301 )
302 })?;
303 let codec = tonic_prost::ProstCodec::default();
304 let path = http::uri::PathAndQuery::from_static(
305 "/snix.castore.v1.BlobStoreService/PutBlob",
306 );
307 let mut req = request.into_request();
308 req.extensions_mut()
309 .insert(GrpcMethod::new("snix.castore.v1.BlobStoreService", "PutBlob"));
310 self.inner.unary(req, path, codec).await
311 }
312 }
313}
314pub mod blob_store_service_server {
316 #![allow(
317 unused_variables,
318 dead_code,
319 missing_docs,
320 clippy::wildcard_imports,
321 clippy::let_unit_value,
322 )]
323 use tonic::codegen::*;
324 #[async_trait]
326 pub trait BlobStoreService: std::marker::Send + std::marker::Sync + 'static {
327 async fn stat_blob(
329 &self,
330 request: tonic::Request<super::StatBlobRequest>,
331 ) -> std::result::Result<
332 tonic::Response<super::StatBlobResponse>,
333 tonic::Status,
334 >;
335 async fn get_blob(
337 &self,
338 request: tonic::Request<super::GetBlobRequest>,
339 ) -> std::result::Result<tonic::Response<super::GetBlobResponse>, tonic::Status>;
340 async fn put_blob(
342 &self,
343 request: tonic::Request<super::PutBlobRequest>,
344 ) -> std::result::Result<tonic::Response<super::PutBlobResponse>, tonic::Status>;
345 }
346 #[derive(Debug)]
352 pub struct BlobStoreServiceServer<T> {
353 inner: Arc<T>,
354 accept_compression_encodings: EnabledCompressionEncodings,
355 send_compression_encodings: EnabledCompressionEncodings,
356 max_decoding_message_size: Option<usize>,
357 max_encoding_message_size: Option<usize>,
358 }
359 impl<T> BlobStoreServiceServer<T> {
360 pub fn new(inner: T) -> Self {
361 Self::from_arc(Arc::new(inner))
362 }
363 pub fn from_arc(inner: Arc<T>) -> Self {
364 Self {
365 inner,
366 accept_compression_encodings: Default::default(),
367 send_compression_encodings: Default::default(),
368 max_decoding_message_size: None,
369 max_encoding_message_size: None,
370 }
371 }
372 pub fn with_interceptor<F>(
373 inner: T,
374 interceptor: F,
375 ) -> InterceptedService<Self, F>
376 where
377 F: tonic::service::Interceptor,
378 {
379 InterceptedService::new(Self::new(inner), interceptor)
380 }
381 #[must_use]
383 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
384 self.accept_compression_encodings.enable(encoding);
385 self
386 }
387 #[must_use]
389 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
390 self.send_compression_encodings.enable(encoding);
391 self
392 }
393 #[must_use]
397 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
398 self.max_decoding_message_size = Some(limit);
399 self
400 }
401 #[must_use]
405 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
406 self.max_encoding_message_size = Some(limit);
407 self
408 }
409 }
410 impl<T, B> tonic::codegen::Service<http::Request<B>> for BlobStoreServiceServer<T>
411 where
412 T: BlobStoreService,
413 B: Body + std::marker::Send + 'static,
414 B::Error: Into<StdError> + std::marker::Send + 'static,
415 {
416 type Response = http::Response<tonic::body::Body>;
417 type Error = std::convert::Infallible;
418 type Future = BoxFuture<Self::Response, Self::Error>;
419 fn poll_ready(
420 &mut self,
421 _cx: &mut Context<'_>,
422 ) -> Poll<std::result::Result<(), Self::Error>> {
423 Poll::Ready(Ok(()))
424 }
425 fn call(&mut self, req: http::Request<B>) -> Self::Future {
426 match req.uri().path() {
427 "/snix.castore.v1.BlobStoreService/StatBlob" => {
428 #[allow(non_camel_case_types)]
429 struct StatBlobSvc<T: BlobStoreService>(pub Arc<T>);
430 impl<
431 T: BlobStoreService,
432 > tonic::server::UnaryService<super::StatBlobRequest>
433 for StatBlobSvc<T> {
434 type Response = super::StatBlobResponse;
435 type Future = BoxFuture<
436 tonic::Response<Self::Response>,
437 tonic::Status,
438 >;
439 fn call(
440 &mut self,
441 request: tonic::Request<super::StatBlobRequest>,
442 ) -> Self::Future {
443 let inner = Arc::clone(&self.0);
444 let fut = async move {
445 <T as BlobStoreService>::stat_blob(&inner, request).await
446 };
447 Box::pin(fut)
448 }
449 }
450 let accept_compression_encodings = self.accept_compression_encodings;
451 let send_compression_encodings = self.send_compression_encodings;
452 let max_decoding_message_size = self.max_decoding_message_size;
453 let max_encoding_message_size = self.max_encoding_message_size;
454 let inner = self.inner.clone();
455 let fut = async move {
456 let method = StatBlobSvc(inner);
457 let codec = tonic_prost::ProstCodec::default();
458 let mut grpc = tonic::server::Grpc::new(codec)
459 .apply_compression_config(
460 accept_compression_encodings,
461 send_compression_encodings,
462 )
463 .apply_max_message_size_config(
464 max_decoding_message_size,
465 max_encoding_message_size,
466 );
467 let res = grpc.unary(method, req).await;
468 Ok(res)
469 };
470 Box::pin(fut)
471 }
472 "/snix.castore.v1.BlobStoreService/GetBlob" => {
473 #[allow(non_camel_case_types)]
474 struct GetBlobSvc<T: BlobStoreService>(pub Arc<T>);
475 impl<
476 T: BlobStoreService,
477 > tonic::server::UnaryService<super::GetBlobRequest>
478 for GetBlobSvc<T> {
479 type Response = super::GetBlobResponse;
480 type Future = BoxFuture<
481 tonic::Response<Self::Response>,
482 tonic::Status,
483 >;
484 fn call(
485 &mut self,
486 request: tonic::Request<super::GetBlobRequest>,
487 ) -> Self::Future {
488 let inner = Arc::clone(&self.0);
489 let fut = async move {
490 <T as BlobStoreService>::get_blob(&inner, request).await
491 };
492 Box::pin(fut)
493 }
494 }
495 let accept_compression_encodings = self.accept_compression_encodings;
496 let send_compression_encodings = self.send_compression_encodings;
497 let max_decoding_message_size = self.max_decoding_message_size;
498 let max_encoding_message_size = self.max_encoding_message_size;
499 let inner = self.inner.clone();
500 let fut = async move {
501 let method = GetBlobSvc(inner);
502 let codec = tonic_prost::ProstCodec::default();
503 let mut grpc = tonic::server::Grpc::new(codec)
504 .apply_compression_config(
505 accept_compression_encodings,
506 send_compression_encodings,
507 )
508 .apply_max_message_size_config(
509 max_decoding_message_size,
510 max_encoding_message_size,
511 );
512 let res = grpc.unary(method, req).await;
513 Ok(res)
514 };
515 Box::pin(fut)
516 }
517 "/snix.castore.v1.BlobStoreService/PutBlob" => {
518 #[allow(non_camel_case_types)]
519 struct PutBlobSvc<T: BlobStoreService>(pub Arc<T>);
520 impl<
521 T: BlobStoreService,
522 > tonic::server::UnaryService<super::PutBlobRequest>
523 for PutBlobSvc<T> {
524 type Response = super::PutBlobResponse;
525 type Future = BoxFuture<
526 tonic::Response<Self::Response>,
527 tonic::Status,
528 >;
529 fn call(
530 &mut self,
531 request: tonic::Request<super::PutBlobRequest>,
532 ) -> Self::Future {
533 let inner = Arc::clone(&self.0);
534 let fut = async move {
535 <T as BlobStoreService>::put_blob(&inner, request).await
536 };
537 Box::pin(fut)
538 }
539 }
540 let accept_compression_encodings = self.accept_compression_encodings;
541 let send_compression_encodings = self.send_compression_encodings;
542 let max_decoding_message_size = self.max_decoding_message_size;
543 let max_encoding_message_size = self.max_encoding_message_size;
544 let inner = self.inner.clone();
545 let fut = async move {
546 let method = PutBlobSvc(inner);
547 let codec = tonic_prost::ProstCodec::default();
548 let mut grpc = tonic::server::Grpc::new(codec)
549 .apply_compression_config(
550 accept_compression_encodings,
551 send_compression_encodings,
552 )
553 .apply_max_message_size_config(
554 max_decoding_message_size,
555 max_encoding_message_size,
556 );
557 let res = grpc.unary(method, req).await;
558 Ok(res)
559 };
560 Box::pin(fut)
561 }
562 _ => {
563 Box::pin(async move {
564 let mut response = http::Response::new(
565 tonic::body::Body::default(),
566 );
567 let headers = response.headers_mut();
568 headers
569 .insert(
570 tonic::Status::GRPC_STATUS,
571 (tonic::Code::Unimplemented as i32).into(),
572 );
573 headers
574 .insert(
575 http::header::CONTENT_TYPE,
576 tonic::metadata::GRPC_CONTENT_TYPE,
577 );
578 Ok(response)
579 })
580 }
581 }
582 }
583 }
584 impl<T> Clone for BlobStoreServiceServer<T> {
585 fn clone(&self) -> Self {
586 let inner = self.inner.clone();
587 Self {
588 inner,
589 accept_compression_encodings: self.accept_compression_encodings,
590 send_compression_encodings: self.send_compression_encodings,
591 max_decoding_message_size: self.max_decoding_message_size,
592 max_encoding_message_size: self.max_encoding_message_size,
593 }
594 }
595 }
596 pub const SERVICE_NAME: &str = "snix.castore.v1.BlobStoreService";
598 impl<T> tonic::server::NamedService for BlobStoreServiceServer<T> {
599 const NAME: &'static str = SERVICE_NAME;
600 }
601}
602#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
603pub struct StatChunkRequest {
604 #[prost(bytes = "bytes", tag = "1")]
606 pub digest: ::prost::bytes::Bytes,
607}
608#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
609pub struct StatChunkResponse {}
610#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
611pub struct GetChunkRequest {
612 #[prost(bytes = "bytes", tag = "1")]
614 pub digest: ::prost::bytes::Bytes,
615}
616#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
617pub struct GetChunkResponse {
618 #[prost(bytes = "bytes", tag = "1")]
620 pub data: ::prost::bytes::Bytes,
621}
622#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
623pub struct PutChunkRequest {
624 #[prost(bytes = "bytes", tag = "1")]
626 pub data: ::prost::bytes::Bytes,
627}
628#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
629pub struct PutChunkResponse {
630 #[prost(bytes = "bytes", tag = "1")]
632 pub digest: ::prost::bytes::Bytes,
633}
634pub mod chunk_store_service_client {
636 #![allow(
637 unused_variables,
638 dead_code,
639 missing_docs,
640 clippy::wildcard_imports,
641 clippy::let_unit_value,
642 )]
643 use tonic::codegen::*;
644 use tonic::codegen::http::Uri;
645 #[derive(Debug, Clone)]
653 pub struct ChunkStoreServiceClient<T> {
654 inner: tonic::client::Grpc<T>,
655 }
656 impl ChunkStoreServiceClient<tonic::transport::Channel> {
657 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
659 where
660 D: TryInto<tonic::transport::Endpoint>,
661 D::Error: Into<StdError>,
662 {
663 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
664 Ok(Self::new(conn))
665 }
666 }
667 impl<T> ChunkStoreServiceClient<T>
668 where
669 T: tonic::client::GrpcService<tonic::body::Body>,
670 T::Error: Into<StdError>,
671 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
672 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
673 {
674 pub fn new(inner: T) -> Self {
675 let inner = tonic::client::Grpc::new(inner);
676 Self { inner }
677 }
678 pub fn with_origin(inner: T, origin: Uri) -> Self {
679 let inner = tonic::client::Grpc::with_origin(inner, origin);
680 Self { inner }
681 }
682 pub fn with_interceptor<F>(
683 inner: T,
684 interceptor: F,
685 ) -> ChunkStoreServiceClient<InterceptedService<T, F>>
686 where
687 F: tonic::service::Interceptor,
688 T::ResponseBody: Default,
689 T: tonic::codegen::Service<
690 http::Request<tonic::body::Body>,
691 Response = http::Response<
692 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
693 >,
694 >,
695 <T as tonic::codegen::Service<
696 http::Request<tonic::body::Body>,
697 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
698 {
699 ChunkStoreServiceClient::new(InterceptedService::new(inner, interceptor))
700 }
701 #[must_use]
706 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
707 self.inner = self.inner.send_compressed(encoding);
708 self
709 }
710 #[must_use]
712 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
713 self.inner = self.inner.accept_compressed(encoding);
714 self
715 }
716 #[must_use]
720 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
721 self.inner = self.inner.max_decoding_message_size(limit);
722 self
723 }
724 #[must_use]
728 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
729 self.inner = self.inner.max_encoding_message_size(limit);
730 self
731 }
732 pub async fn stat_chunk(
734 &mut self,
735 request: impl tonic::IntoRequest<super::StatChunkRequest>,
736 ) -> std::result::Result<
737 tonic::Response<super::StatChunkResponse>,
738 tonic::Status,
739 > {
740 self.inner
741 .ready()
742 .await
743 .map_err(|e| {
744 tonic::Status::unknown(
745 format!("Service was not ready: {}", e.into()),
746 )
747 })?;
748 let codec = tonic_prost::ProstCodec::default();
749 let path = http::uri::PathAndQuery::from_static(
750 "/snix.castore.v1.ChunkStoreService/StatChunk",
751 );
752 let mut req = request.into_request();
753 req.extensions_mut()
754 .insert(
755 GrpcMethod::new("snix.castore.v1.ChunkStoreService", "StatChunk"),
756 );
757 self.inner.unary(req, path, codec).await
758 }
759 pub async fn get_chunk(
763 &mut self,
764 request: impl tonic::IntoRequest<super::GetChunkRequest>,
765 ) -> std::result::Result<
766 tonic::Response<tonic::codec::Streaming<super::GetChunkResponse>>,
767 tonic::Status,
768 > {
769 self.inner
770 .ready()
771 .await
772 .map_err(|e| {
773 tonic::Status::unknown(
774 format!("Service was not ready: {}", e.into()),
775 )
776 })?;
777 let codec = tonic_prost::ProstCodec::default();
778 let path = http::uri::PathAndQuery::from_static(
779 "/snix.castore.v1.ChunkStoreService/GetChunk",
780 );
781 let mut req = request.into_request();
782 req.extensions_mut()
783 .insert(
784 GrpcMethod::new("snix.castore.v1.ChunkStoreService", "GetChunk"),
785 );
786 self.inner.server_streaming(req, path, codec).await
787 }
788 pub async fn put_chunk(
792 &mut self,
793 request: impl tonic::IntoStreamingRequest<Message = super::PutChunkRequest>,
794 ) -> std::result::Result<
795 tonic::Response<super::PutChunkResponse>,
796 tonic::Status,
797 > {
798 self.inner
799 .ready()
800 .await
801 .map_err(|e| {
802 tonic::Status::unknown(
803 format!("Service was not ready: {}", e.into()),
804 )
805 })?;
806 let codec = tonic_prost::ProstCodec::default();
807 let path = http::uri::PathAndQuery::from_static(
808 "/snix.castore.v1.ChunkStoreService/PutChunk",
809 );
810 let mut req = request.into_streaming_request();
811 req.extensions_mut()
812 .insert(
813 GrpcMethod::new("snix.castore.v1.ChunkStoreService", "PutChunk"),
814 );
815 self.inner.client_streaming(req, path, codec).await
816 }
817 }
818}
819pub mod chunk_store_service_server {
821 #![allow(
822 unused_variables,
823 dead_code,
824 missing_docs,
825 clippy::wildcard_imports,
826 clippy::let_unit_value,
827 )]
828 use tonic::codegen::*;
829 #[async_trait]
831 pub trait ChunkStoreService: std::marker::Send + std::marker::Sync + 'static {
832 async fn stat_chunk(
834 &self,
835 request: tonic::Request<super::StatChunkRequest>,
836 ) -> std::result::Result<
837 tonic::Response<super::StatChunkResponse>,
838 tonic::Status,
839 >;
840 type GetChunkStream: tonic::codegen::tokio_stream::Stream<
842 Item = std::result::Result<super::GetChunkResponse, tonic::Status>,
843 >
844 + std::marker::Send
845 + 'static;
846 async fn get_chunk(
850 &self,
851 request: tonic::Request<super::GetChunkRequest>,
852 ) -> std::result::Result<tonic::Response<Self::GetChunkStream>, tonic::Status>;
853 async fn put_chunk(
857 &self,
858 request: tonic::Request<tonic::Streaming<super::PutChunkRequest>>,
859 ) -> std::result::Result<
860 tonic::Response<super::PutChunkResponse>,
861 tonic::Status,
862 >;
863 }
864 #[derive(Debug)]
872 pub struct ChunkStoreServiceServer<T> {
873 inner: Arc<T>,
874 accept_compression_encodings: EnabledCompressionEncodings,
875 send_compression_encodings: EnabledCompressionEncodings,
876 max_decoding_message_size: Option<usize>,
877 max_encoding_message_size: Option<usize>,
878 }
879 impl<T> ChunkStoreServiceServer<T> {
880 pub fn new(inner: T) -> Self {
881 Self::from_arc(Arc::new(inner))
882 }
883 pub fn from_arc(inner: Arc<T>) -> Self {
884 Self {
885 inner,
886 accept_compression_encodings: Default::default(),
887 send_compression_encodings: Default::default(),
888 max_decoding_message_size: None,
889 max_encoding_message_size: None,
890 }
891 }
892 pub fn with_interceptor<F>(
893 inner: T,
894 interceptor: F,
895 ) -> InterceptedService<Self, F>
896 where
897 F: tonic::service::Interceptor,
898 {
899 InterceptedService::new(Self::new(inner), interceptor)
900 }
901 #[must_use]
903 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
904 self.accept_compression_encodings.enable(encoding);
905 self
906 }
907 #[must_use]
909 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
910 self.send_compression_encodings.enable(encoding);
911 self
912 }
913 #[must_use]
917 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
918 self.max_decoding_message_size = Some(limit);
919 self
920 }
921 #[must_use]
925 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
926 self.max_encoding_message_size = Some(limit);
927 self
928 }
929 }
930 impl<T, B> tonic::codegen::Service<http::Request<B>> for ChunkStoreServiceServer<T>
931 where
932 T: ChunkStoreService,
933 B: Body + std::marker::Send + 'static,
934 B::Error: Into<StdError> + std::marker::Send + 'static,
935 {
936 type Response = http::Response<tonic::body::Body>;
937 type Error = std::convert::Infallible;
938 type Future = BoxFuture<Self::Response, Self::Error>;
939 fn poll_ready(
940 &mut self,
941 _cx: &mut Context<'_>,
942 ) -> Poll<std::result::Result<(), Self::Error>> {
943 Poll::Ready(Ok(()))
944 }
945 fn call(&mut self, req: http::Request<B>) -> Self::Future {
946 match req.uri().path() {
947 "/snix.castore.v1.ChunkStoreService/StatChunk" => {
948 #[allow(non_camel_case_types)]
949 struct StatChunkSvc<T: ChunkStoreService>(pub Arc<T>);
950 impl<
951 T: ChunkStoreService,
952 > tonic::server::UnaryService<super::StatChunkRequest>
953 for StatChunkSvc<T> {
954 type Response = super::StatChunkResponse;
955 type Future = BoxFuture<
956 tonic::Response<Self::Response>,
957 tonic::Status,
958 >;
959 fn call(
960 &mut self,
961 request: tonic::Request<super::StatChunkRequest>,
962 ) -> Self::Future {
963 let inner = Arc::clone(&self.0);
964 let fut = async move {
965 <T as ChunkStoreService>::stat_chunk(&inner, request).await
966 };
967 Box::pin(fut)
968 }
969 }
970 let accept_compression_encodings = self.accept_compression_encodings;
971 let send_compression_encodings = self.send_compression_encodings;
972 let max_decoding_message_size = self.max_decoding_message_size;
973 let max_encoding_message_size = self.max_encoding_message_size;
974 let inner = self.inner.clone();
975 let fut = async move {
976 let method = StatChunkSvc(inner);
977 let codec = tonic_prost::ProstCodec::default();
978 let mut grpc = tonic::server::Grpc::new(codec)
979 .apply_compression_config(
980 accept_compression_encodings,
981 send_compression_encodings,
982 )
983 .apply_max_message_size_config(
984 max_decoding_message_size,
985 max_encoding_message_size,
986 );
987 let res = grpc.unary(method, req).await;
988 Ok(res)
989 };
990 Box::pin(fut)
991 }
992 "/snix.castore.v1.ChunkStoreService/GetChunk" => {
993 #[allow(non_camel_case_types)]
994 struct GetChunkSvc<T: ChunkStoreService>(pub Arc<T>);
995 impl<
996 T: ChunkStoreService,
997 > tonic::server::ServerStreamingService<super::GetChunkRequest>
998 for GetChunkSvc<T> {
999 type Response = super::GetChunkResponse;
1000 type ResponseStream = T::GetChunkStream;
1001 type Future = BoxFuture<
1002 tonic::Response<Self::ResponseStream>,
1003 tonic::Status,
1004 >;
1005 fn call(
1006 &mut self,
1007 request: tonic::Request<super::GetChunkRequest>,
1008 ) -> Self::Future {
1009 let inner = Arc::clone(&self.0);
1010 let fut = async move {
1011 <T as ChunkStoreService>::get_chunk(&inner, request).await
1012 };
1013 Box::pin(fut)
1014 }
1015 }
1016 let accept_compression_encodings = self.accept_compression_encodings;
1017 let send_compression_encodings = self.send_compression_encodings;
1018 let max_decoding_message_size = self.max_decoding_message_size;
1019 let max_encoding_message_size = self.max_encoding_message_size;
1020 let inner = self.inner.clone();
1021 let fut = async move {
1022 let method = GetChunkSvc(inner);
1023 let codec = tonic_prost::ProstCodec::default();
1024 let mut grpc = tonic::server::Grpc::new(codec)
1025 .apply_compression_config(
1026 accept_compression_encodings,
1027 send_compression_encodings,
1028 )
1029 .apply_max_message_size_config(
1030 max_decoding_message_size,
1031 max_encoding_message_size,
1032 );
1033 let res = grpc.server_streaming(method, req).await;
1034 Ok(res)
1035 };
1036 Box::pin(fut)
1037 }
1038 "/snix.castore.v1.ChunkStoreService/PutChunk" => {
1039 #[allow(non_camel_case_types)]
1040 struct PutChunkSvc<T: ChunkStoreService>(pub Arc<T>);
1041 impl<
1042 T: ChunkStoreService,
1043 > tonic::server::ClientStreamingService<super::PutChunkRequest>
1044 for PutChunkSvc<T> {
1045 type Response = super::PutChunkResponse;
1046 type Future = BoxFuture<
1047 tonic::Response<Self::Response>,
1048 tonic::Status,
1049 >;
1050 fn call(
1051 &mut self,
1052 request: tonic::Request<
1053 tonic::Streaming<super::PutChunkRequest>,
1054 >,
1055 ) -> Self::Future {
1056 let inner = Arc::clone(&self.0);
1057 let fut = async move {
1058 <T as ChunkStoreService>::put_chunk(&inner, request).await
1059 };
1060 Box::pin(fut)
1061 }
1062 }
1063 let accept_compression_encodings = self.accept_compression_encodings;
1064 let send_compression_encodings = self.send_compression_encodings;
1065 let max_decoding_message_size = self.max_decoding_message_size;
1066 let max_encoding_message_size = self.max_encoding_message_size;
1067 let inner = self.inner.clone();
1068 let fut = async move {
1069 let method = PutChunkSvc(inner);
1070 let codec = tonic_prost::ProstCodec::default();
1071 let mut grpc = tonic::server::Grpc::new(codec)
1072 .apply_compression_config(
1073 accept_compression_encodings,
1074 send_compression_encodings,
1075 )
1076 .apply_max_message_size_config(
1077 max_decoding_message_size,
1078 max_encoding_message_size,
1079 );
1080 let res = grpc.client_streaming(method, req).await;
1081 Ok(res)
1082 };
1083 Box::pin(fut)
1084 }
1085 _ => {
1086 Box::pin(async move {
1087 let mut response = http::Response::new(
1088 tonic::body::Body::default(),
1089 );
1090 let headers = response.headers_mut();
1091 headers
1092 .insert(
1093 tonic::Status::GRPC_STATUS,
1094 (tonic::Code::Unimplemented as i32).into(),
1095 );
1096 headers
1097 .insert(
1098 http::header::CONTENT_TYPE,
1099 tonic::metadata::GRPC_CONTENT_TYPE,
1100 );
1101 Ok(response)
1102 })
1103 }
1104 }
1105 }
1106 }
1107 impl<T> Clone for ChunkStoreServiceServer<T> {
1108 fn clone(&self) -> Self {
1109 let inner = self.inner.clone();
1110 Self {
1111 inner,
1112 accept_compression_encodings: self.accept_compression_encodings,
1113 send_compression_encodings: self.send_compression_encodings,
1114 max_decoding_message_size: self.max_decoding_message_size,
1115 max_encoding_message_size: self.max_encoding_message_size,
1116 }
1117 }
1118 }
1119 pub const SERVICE_NAME: &str = "snix.castore.v1.ChunkStoreService";
1121 impl<T> tonic::server::NamedService for ChunkStoreServiceServer<T> {
1122 const NAME: &'static str = SERVICE_NAME;
1123 }
1124}
1125#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1126pub struct GetDirectoryRequest {
1127 #[prost(bool, tag = "2")]
1132 pub recursive: bool,
1133 #[prost(oneof = "get_directory_request::ByWhat", tags = "1")]
1134 pub by_what: ::core::option::Option<get_directory_request::ByWhat>,
1135}
1136pub mod get_directory_request {
1138 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1139 pub enum ByWhat {
1140 #[prost(bytes, tag = "1")]
1144 Digest(::prost::bytes::Bytes),
1145 }
1146}
1147#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1148pub struct PutDirectoryResponse {
1149 #[prost(bytes = "bytes", tag = "1")]
1150 pub root_digest: ::prost::bytes::Bytes,
1151}
1152pub mod directory_service_client {
1154 #![allow(
1155 unused_variables,
1156 dead_code,
1157 missing_docs,
1158 clippy::wildcard_imports,
1159 clippy::let_unit_value,
1160 )]
1161 use tonic::codegen::*;
1162 use tonic::codegen::http::Uri;
1163 #[derive(Debug, Clone)]
1164 pub struct DirectoryServiceClient<T> {
1165 inner: tonic::client::Grpc<T>,
1166 }
1167 impl DirectoryServiceClient<tonic::transport::Channel> {
1168 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1170 where
1171 D: TryInto<tonic::transport::Endpoint>,
1172 D::Error: Into<StdError>,
1173 {
1174 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1175 Ok(Self::new(conn))
1176 }
1177 }
1178 impl<T> DirectoryServiceClient<T>
1179 where
1180 T: tonic::client::GrpcService<tonic::body::Body>,
1181 T::Error: Into<StdError>,
1182 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1183 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1184 {
1185 pub fn new(inner: T) -> Self {
1186 let inner = tonic::client::Grpc::new(inner);
1187 Self { inner }
1188 }
1189 pub fn with_origin(inner: T, origin: Uri) -> Self {
1190 let inner = tonic::client::Grpc::with_origin(inner, origin);
1191 Self { inner }
1192 }
1193 pub fn with_interceptor<F>(
1194 inner: T,
1195 interceptor: F,
1196 ) -> DirectoryServiceClient<InterceptedService<T, F>>
1197 where
1198 F: tonic::service::Interceptor,
1199 T::ResponseBody: Default,
1200 T: tonic::codegen::Service<
1201 http::Request<tonic::body::Body>,
1202 Response = http::Response<
1203 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1204 >,
1205 >,
1206 <T as tonic::codegen::Service<
1207 http::Request<tonic::body::Body>,
1208 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1209 {
1210 DirectoryServiceClient::new(InterceptedService::new(inner, interceptor))
1211 }
1212 #[must_use]
1217 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1218 self.inner = self.inner.send_compressed(encoding);
1219 self
1220 }
1221 #[must_use]
1223 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1224 self.inner = self.inner.accept_compressed(encoding);
1225 self
1226 }
1227 #[must_use]
1231 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1232 self.inner = self.inner.max_decoding_message_size(limit);
1233 self
1234 }
1235 #[must_use]
1239 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1240 self.inner = self.inner.max_encoding_message_size(limit);
1241 self
1242 }
1243 pub async fn get(
1254 &mut self,
1255 request: impl tonic::IntoRequest<super::GetDirectoryRequest>,
1256 ) -> std::result::Result<
1257 tonic::Response<tonic::codec::Streaming<super::Directory>>,
1258 tonic::Status,
1259 > {
1260 self.inner
1261 .ready()
1262 .await
1263 .map_err(|e| {
1264 tonic::Status::unknown(
1265 format!("Service was not ready: {}", e.into()),
1266 )
1267 })?;
1268 let codec = tonic_prost::ProstCodec::default();
1269 let path = http::uri::PathAndQuery::from_static(
1270 "/snix.castore.v1.DirectoryService/Get",
1271 );
1272 let mut req = request.into_request();
1273 req.extensions_mut()
1274 .insert(GrpcMethod::new("snix.castore.v1.DirectoryService", "Get"));
1275 self.inner.server_streaming(req, path, codec).await
1276 }
1277 pub async fn put(
1287 &mut self,
1288 request: impl tonic::IntoStreamingRequest<Message = super::Directory>,
1289 ) -> std::result::Result<
1290 tonic::Response<super::PutDirectoryResponse>,
1291 tonic::Status,
1292 > {
1293 self.inner
1294 .ready()
1295 .await
1296 .map_err(|e| {
1297 tonic::Status::unknown(
1298 format!("Service was not ready: {}", e.into()),
1299 )
1300 })?;
1301 let codec = tonic_prost::ProstCodec::default();
1302 let path = http::uri::PathAndQuery::from_static(
1303 "/snix.castore.v1.DirectoryService/Put",
1304 );
1305 let mut req = request.into_streaming_request();
1306 req.extensions_mut()
1307 .insert(GrpcMethod::new("snix.castore.v1.DirectoryService", "Put"));
1308 self.inner.client_streaming(req, path, codec).await
1309 }
1310 }
1311}
1312pub mod directory_service_server {
1314 #![allow(
1315 unused_variables,
1316 dead_code,
1317 missing_docs,
1318 clippy::wildcard_imports,
1319 clippy::let_unit_value,
1320 )]
1321 use tonic::codegen::*;
1322 #[async_trait]
1324 pub trait DirectoryService: std::marker::Send + std::marker::Sync + 'static {
1325 type GetStream: tonic::codegen::tokio_stream::Stream<
1327 Item = std::result::Result<super::Directory, tonic::Status>,
1328 >
1329 + std::marker::Send
1330 + 'static;
1331 async fn get(
1342 &self,
1343 request: tonic::Request<super::GetDirectoryRequest>,
1344 ) -> std::result::Result<tonic::Response<Self::GetStream>, tonic::Status>;
1345 async fn put(
1355 &self,
1356 request: tonic::Request<tonic::Streaming<super::Directory>>,
1357 ) -> std::result::Result<
1358 tonic::Response<super::PutDirectoryResponse>,
1359 tonic::Status,
1360 >;
1361 }
1362 #[derive(Debug)]
1363 pub struct DirectoryServiceServer<T> {
1364 inner: Arc<T>,
1365 accept_compression_encodings: EnabledCompressionEncodings,
1366 send_compression_encodings: EnabledCompressionEncodings,
1367 max_decoding_message_size: Option<usize>,
1368 max_encoding_message_size: Option<usize>,
1369 }
1370 impl<T> DirectoryServiceServer<T> {
1371 pub fn new(inner: T) -> Self {
1372 Self::from_arc(Arc::new(inner))
1373 }
1374 pub fn from_arc(inner: Arc<T>) -> Self {
1375 Self {
1376 inner,
1377 accept_compression_encodings: Default::default(),
1378 send_compression_encodings: Default::default(),
1379 max_decoding_message_size: None,
1380 max_encoding_message_size: None,
1381 }
1382 }
1383 pub fn with_interceptor<F>(
1384 inner: T,
1385 interceptor: F,
1386 ) -> InterceptedService<Self, F>
1387 where
1388 F: tonic::service::Interceptor,
1389 {
1390 InterceptedService::new(Self::new(inner), interceptor)
1391 }
1392 #[must_use]
1394 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1395 self.accept_compression_encodings.enable(encoding);
1396 self
1397 }
1398 #[must_use]
1400 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1401 self.send_compression_encodings.enable(encoding);
1402 self
1403 }
1404 #[must_use]
1408 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1409 self.max_decoding_message_size = Some(limit);
1410 self
1411 }
1412 #[must_use]
1416 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1417 self.max_encoding_message_size = Some(limit);
1418 self
1419 }
1420 }
1421 impl<T, B> tonic::codegen::Service<http::Request<B>> for DirectoryServiceServer<T>
1422 where
1423 T: DirectoryService,
1424 B: Body + std::marker::Send + 'static,
1425 B::Error: Into<StdError> + std::marker::Send + 'static,
1426 {
1427 type Response = http::Response<tonic::body::Body>;
1428 type Error = std::convert::Infallible;
1429 type Future = BoxFuture<Self::Response, Self::Error>;
1430 fn poll_ready(
1431 &mut self,
1432 _cx: &mut Context<'_>,
1433 ) -> Poll<std::result::Result<(), Self::Error>> {
1434 Poll::Ready(Ok(()))
1435 }
1436 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1437 match req.uri().path() {
1438 "/snix.castore.v1.DirectoryService/Get" => {
1439 #[allow(non_camel_case_types)]
1440 struct GetSvc<T: DirectoryService>(pub Arc<T>);
1441 impl<
1442 T: DirectoryService,
1443 > tonic::server::ServerStreamingService<super::GetDirectoryRequest>
1444 for GetSvc<T> {
1445 type Response = super::Directory;
1446 type ResponseStream = T::GetStream;
1447 type Future = BoxFuture<
1448 tonic::Response<Self::ResponseStream>,
1449 tonic::Status,
1450 >;
1451 fn call(
1452 &mut self,
1453 request: tonic::Request<super::GetDirectoryRequest>,
1454 ) -> Self::Future {
1455 let inner = Arc::clone(&self.0);
1456 let fut = async move {
1457 <T as DirectoryService>::get(&inner, request).await
1458 };
1459 Box::pin(fut)
1460 }
1461 }
1462 let accept_compression_encodings = self.accept_compression_encodings;
1463 let send_compression_encodings = self.send_compression_encodings;
1464 let max_decoding_message_size = self.max_decoding_message_size;
1465 let max_encoding_message_size = self.max_encoding_message_size;
1466 let inner = self.inner.clone();
1467 let fut = async move {
1468 let method = GetSvc(inner);
1469 let codec = tonic_prost::ProstCodec::default();
1470 let mut grpc = tonic::server::Grpc::new(codec)
1471 .apply_compression_config(
1472 accept_compression_encodings,
1473 send_compression_encodings,
1474 )
1475 .apply_max_message_size_config(
1476 max_decoding_message_size,
1477 max_encoding_message_size,
1478 );
1479 let res = grpc.server_streaming(method, req).await;
1480 Ok(res)
1481 };
1482 Box::pin(fut)
1483 }
1484 "/snix.castore.v1.DirectoryService/Put" => {
1485 #[allow(non_camel_case_types)]
1486 struct PutSvc<T: DirectoryService>(pub Arc<T>);
1487 impl<
1488 T: DirectoryService,
1489 > tonic::server::ClientStreamingService<super::Directory>
1490 for PutSvc<T> {
1491 type Response = super::PutDirectoryResponse;
1492 type Future = BoxFuture<
1493 tonic::Response<Self::Response>,
1494 tonic::Status,
1495 >;
1496 fn call(
1497 &mut self,
1498 request: tonic::Request<tonic::Streaming<super::Directory>>,
1499 ) -> Self::Future {
1500 let inner = Arc::clone(&self.0);
1501 let fut = async move {
1502 <T as DirectoryService>::put(&inner, request).await
1503 };
1504 Box::pin(fut)
1505 }
1506 }
1507 let accept_compression_encodings = self.accept_compression_encodings;
1508 let send_compression_encodings = self.send_compression_encodings;
1509 let max_decoding_message_size = self.max_decoding_message_size;
1510 let max_encoding_message_size = self.max_encoding_message_size;
1511 let inner = self.inner.clone();
1512 let fut = async move {
1513 let method = PutSvc(inner);
1514 let codec = tonic_prost::ProstCodec::default();
1515 let mut grpc = tonic::server::Grpc::new(codec)
1516 .apply_compression_config(
1517 accept_compression_encodings,
1518 send_compression_encodings,
1519 )
1520 .apply_max_message_size_config(
1521 max_decoding_message_size,
1522 max_encoding_message_size,
1523 );
1524 let res = grpc.client_streaming(method, req).await;
1525 Ok(res)
1526 };
1527 Box::pin(fut)
1528 }
1529 _ => {
1530 Box::pin(async move {
1531 let mut response = http::Response::new(
1532 tonic::body::Body::default(),
1533 );
1534 let headers = response.headers_mut();
1535 headers
1536 .insert(
1537 tonic::Status::GRPC_STATUS,
1538 (tonic::Code::Unimplemented as i32).into(),
1539 );
1540 headers
1541 .insert(
1542 http::header::CONTENT_TYPE,
1543 tonic::metadata::GRPC_CONTENT_TYPE,
1544 );
1545 Ok(response)
1546 })
1547 }
1548 }
1549 }
1550 }
1551 impl<T> Clone for DirectoryServiceServer<T> {
1552 fn clone(&self) -> Self {
1553 let inner = self.inner.clone();
1554 Self {
1555 inner,
1556 accept_compression_encodings: self.accept_compression_encodings,
1557 send_compression_encodings: self.send_compression_encodings,
1558 max_decoding_message_size: self.max_decoding_message_size,
1559 max_encoding_message_size: self.max_encoding_message_size,
1560 }
1561 }
1562 }
1563 pub const SERVICE_NAME: &str = "snix.castore.v1.DirectoryService";
1565 impl<T> tonic::server::NamedService for DirectoryServiceServer<T> {
1566 const NAME: &'static str = SERVICE_NAME;
1567 }
1568}