1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct SimilarityMetric {
4 #[prost(oneof = "similarity_metric::SimilarityMetric", tags = "1, 2, 3")]
5 pub similarity_metric: ::core::option::Option<similarity_metric::SimilarityMetric>,
6}
7pub mod similarity_metric {
9 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
10 pub struct EuclideanSimilarity {}
11 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
12 pub struct InnerProduct {}
13 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
14 pub struct CosineSimilarity {}
15 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
16 pub enum SimilarityMetric {
17 #[prost(message, tag = "1")]
18 EuclideanSimilarity(EuclideanSimilarity),
19 #[prost(message, tag = "2")]
20 InnerProduct(InnerProduct),
21 #[prost(message, tag = "3")]
22 CosineSimilarity(CosineSimilarity),
23 }
24}
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct CreateIndexRequest {
27 #[prost(string, tag = "1")]
28 pub index_name: ::prost::alloc::string::String,
29 #[prost(uint64, tag = "2")]
30 pub num_dimensions: u64,
31 #[prost(message, optional, tag = "3")]
32 pub similarity_metric: ::core::option::Option<SimilarityMetric>,
33}
34#[derive(Clone, Copy, PartialEq, ::prost::Message)]
35pub struct CreateIndexResponse {}
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct DeleteIndexRequest {
38 #[prost(string, tag = "1")]
39 pub index_name: ::prost::alloc::string::String,
40}
41#[derive(Clone, Copy, PartialEq, ::prost::Message)]
42pub struct DeleteIndexResponse {}
43#[derive(Clone, Copy, PartialEq, ::prost::Message)]
44pub struct ListIndexesRequest {}
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct ListIndexesResponse {
47 #[prost(message, repeated, tag = "1")]
48 pub indexes: ::prost::alloc::vec::Vec<list_indexes_response::Index>,
49}
50pub mod list_indexes_response {
52 #[derive(Clone, PartialEq, ::prost::Message)]
53 pub struct Index {
54 #[prost(string, tag = "1")]
55 pub index_name: ::prost::alloc::string::String,
56 #[prost(uint64, tag = "2")]
57 pub num_dimensions: u64,
58 #[prost(message, optional, tag = "3")]
59 pub similarity_metric: ::core::option::Option<super::SimilarityMetric>,
60 }
61}
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct DeleteCacheRequest {
64 #[prost(string, tag = "1")]
65 pub cache_name: ::prost::alloc::string::String,
66}
67#[derive(Clone, Copy, PartialEq, ::prost::Message)]
68pub struct DeleteCacheResponse {}
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct CreateCacheRequest {
71 #[prost(string, tag = "1")]
72 pub cache_name: ::prost::alloc::string::String,
73}
74#[derive(Clone, Copy, PartialEq, ::prost::Message)]
75pub struct CreateCacheResponse {}
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct ListCachesRequest {
78 #[prost(string, tag = "1")]
79 pub next_token: ::prost::alloc::string::String,
80}
81#[derive(Clone, Copy, PartialEq, ::prost::Message)]
82pub struct CacheLimits {
83 #[prost(uint32, tag = "1")]
85 pub max_traffic_rate: u32,
86 #[prost(uint32, tag = "2")]
88 pub max_throughput_kbps: u32,
89 #[prost(uint32, tag = "3")]
91 pub max_item_size_kb: u32,
92 #[prost(uint64, tag = "4")]
94 pub max_ttl_seconds: u64,
95}
96#[derive(Clone, Copy, PartialEq, ::prost::Message)]
97pub struct TopicLimits {
98 #[prost(uint32, tag = "1")]
100 pub max_publish_rate: u32,
101 #[prost(uint32, tag = "2")]
103 pub max_subscription_count: u32,
104 #[prost(uint32, tag = "3")]
106 pub max_publish_message_size_kb: u32,
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct Cache {
110 #[prost(string, tag = "1")]
111 pub cache_name: ::prost::alloc::string::String,
112 #[prost(message, optional, tag = "2")]
113 pub cache_limits: ::core::option::Option<CacheLimits>,
114 #[prost(message, optional, tag = "3")]
115 pub topic_limits: ::core::option::Option<TopicLimits>,
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct ListCachesResponse {
119 #[prost(message, repeated, tag = "1")]
120 pub cache: ::prost::alloc::vec::Vec<Cache>,
121 #[prost(string, tag = "2")]
122 pub next_token: ::prost::alloc::string::String,
123}
124#[derive(Clone, Copy, PartialEq, ::prost::Message)]
125pub struct CreateSigningKeyRequest {
126 #[prost(uint32, tag = "1")]
127 pub ttl_minutes: u32,
128}
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CreateSigningKeyResponse {
131 #[prost(string, tag = "1")]
132 pub key: ::prost::alloc::string::String,
133 #[prost(uint64, tag = "2")]
134 pub expires_at: u64,
135}
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct RevokeSigningKeyRequest {
138 #[prost(string, tag = "1")]
139 pub key_id: ::prost::alloc::string::String,
140}
141#[derive(Clone, Copy, PartialEq, ::prost::Message)]
142pub struct RevokeSigningKeyResponse {}
143#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct SigningKey {
145 #[prost(string, tag = "1")]
147 pub key_id: ::prost::alloc::string::String,
148 #[prost(uint64, tag = "2")]
150 pub expires_at: u64,
151}
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct ListSigningKeysRequest {
154 #[prost(string, tag = "1")]
155 pub next_token: ::prost::alloc::string::String,
156}
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct ListSigningKeysResponse {
159 #[prost(message, repeated, tag = "1")]
160 pub signing_key: ::prost::alloc::vec::Vec<SigningKey>,
161 #[prost(string, tag = "2")]
162 pub next_token: ::prost::alloc::string::String,
163}
164#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct FlushCacheRequest {
166 #[prost(string, tag = "1")]
167 pub cache_name: ::prost::alloc::string::String,
168}
169#[derive(Clone, Copy, PartialEq, ::prost::Message)]
170pub struct FlushCacheResponse {}
171pub mod scs_control_client {
173 #![allow(
174 unused_variables,
175 dead_code,
176 missing_docs,
177 clippy::wildcard_imports,
178 clippy::let_unit_value,
179 )]
180 use tonic::codegen::*;
181 use tonic::codegen::http::Uri;
182 #[derive(Debug, Clone)]
183 pub struct ScsControlClient<T> {
184 inner: tonic::client::Grpc<T>,
185 }
186 impl ScsControlClient<tonic::transport::Channel> {
187 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
189 where
190 D: TryInto<tonic::transport::Endpoint>,
191 D::Error: Into<StdError>,
192 {
193 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
194 Ok(Self::new(conn))
195 }
196 }
197 impl<T> ScsControlClient<T>
198 where
199 T: tonic::client::GrpcService<tonic::body::Body>,
200 T::Error: Into<StdError>,
201 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
202 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
203 {
204 pub fn new(inner: T) -> Self {
205 let inner = tonic::client::Grpc::new(inner);
206 Self { inner }
207 }
208 pub fn with_origin(inner: T, origin: Uri) -> Self {
209 let inner = tonic::client::Grpc::with_origin(inner, origin);
210 Self { inner }
211 }
212 pub fn with_interceptor<F>(
213 inner: T,
214 interceptor: F,
215 ) -> ScsControlClient<InterceptedService<T, F>>
216 where
217 F: tonic::service::Interceptor,
218 T::ResponseBody: Default,
219 T: tonic::codegen::Service<
220 http::Request<tonic::body::Body>,
221 Response = http::Response<
222 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
223 >,
224 >,
225 <T as tonic::codegen::Service<
226 http::Request<tonic::body::Body>,
227 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
228 {
229 ScsControlClient::new(InterceptedService::new(inner, interceptor))
230 }
231 #[must_use]
236 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
237 self.inner = self.inner.send_compressed(encoding);
238 self
239 }
240 #[must_use]
242 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
243 self.inner = self.inner.accept_compressed(encoding);
244 self
245 }
246 #[must_use]
250 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
251 self.inner = self.inner.max_decoding_message_size(limit);
252 self
253 }
254 #[must_use]
258 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
259 self.inner = self.inner.max_encoding_message_size(limit);
260 self
261 }
262 pub async fn create_cache(
263 &mut self,
264 request: impl tonic::IntoRequest<super::CreateCacheRequest>,
265 ) -> std::result::Result<
266 tonic::Response<super::CreateCacheResponse>,
267 tonic::Status,
268 > {
269 self.inner
270 .ready()
271 .await
272 .map_err(|e| {
273 tonic::Status::unknown(
274 format!("Service was not ready: {}", e.into()),
275 )
276 })?;
277 let codec = tonic::codec::ProstCodec::default();
278 let path = http::uri::PathAndQuery::from_static(
279 "/control_client.ScsControl/CreateCache",
280 );
281 let mut req = request.into_request();
282 req.extensions_mut()
283 .insert(GrpcMethod::new("control_client.ScsControl", "CreateCache"));
284 self.inner.unary(req, path, codec).await
285 }
286 pub async fn delete_cache(
287 &mut self,
288 request: impl tonic::IntoRequest<super::DeleteCacheRequest>,
289 ) -> std::result::Result<
290 tonic::Response<super::DeleteCacheResponse>,
291 tonic::Status,
292 > {
293 self.inner
294 .ready()
295 .await
296 .map_err(|e| {
297 tonic::Status::unknown(
298 format!("Service was not ready: {}", e.into()),
299 )
300 })?;
301 let codec = tonic::codec::ProstCodec::default();
302 let path = http::uri::PathAndQuery::from_static(
303 "/control_client.ScsControl/DeleteCache",
304 );
305 let mut req = request.into_request();
306 req.extensions_mut()
307 .insert(GrpcMethod::new("control_client.ScsControl", "DeleteCache"));
308 self.inner.unary(req, path, codec).await
309 }
310 pub async fn list_caches(
311 &mut self,
312 request: impl tonic::IntoRequest<super::ListCachesRequest>,
313 ) -> std::result::Result<
314 tonic::Response<super::ListCachesResponse>,
315 tonic::Status,
316 > {
317 self.inner
318 .ready()
319 .await
320 .map_err(|e| {
321 tonic::Status::unknown(
322 format!("Service was not ready: {}", e.into()),
323 )
324 })?;
325 let codec = tonic::codec::ProstCodec::default();
326 let path = http::uri::PathAndQuery::from_static(
327 "/control_client.ScsControl/ListCaches",
328 );
329 let mut req = request.into_request();
330 req.extensions_mut()
331 .insert(GrpcMethod::new("control_client.ScsControl", "ListCaches"));
332 self.inner.unary(req, path, codec).await
333 }
334 pub async fn flush_cache(
335 &mut self,
336 request: impl tonic::IntoRequest<super::FlushCacheRequest>,
337 ) -> std::result::Result<
338 tonic::Response<super::FlushCacheResponse>,
339 tonic::Status,
340 > {
341 self.inner
342 .ready()
343 .await
344 .map_err(|e| {
345 tonic::Status::unknown(
346 format!("Service was not ready: {}", e.into()),
347 )
348 })?;
349 let codec = tonic::codec::ProstCodec::default();
350 let path = http::uri::PathAndQuery::from_static(
351 "/control_client.ScsControl/FlushCache",
352 );
353 let mut req = request.into_request();
354 req.extensions_mut()
355 .insert(GrpcMethod::new("control_client.ScsControl", "FlushCache"));
356 self.inner.unary(req, path, codec).await
357 }
358 pub async fn create_signing_key(
359 &mut self,
360 request: impl tonic::IntoRequest<super::CreateSigningKeyRequest>,
361 ) -> std::result::Result<
362 tonic::Response<super::CreateSigningKeyResponse>,
363 tonic::Status,
364 > {
365 self.inner
366 .ready()
367 .await
368 .map_err(|e| {
369 tonic::Status::unknown(
370 format!("Service was not ready: {}", e.into()),
371 )
372 })?;
373 let codec = tonic::codec::ProstCodec::default();
374 let path = http::uri::PathAndQuery::from_static(
375 "/control_client.ScsControl/CreateSigningKey",
376 );
377 let mut req = request.into_request();
378 req.extensions_mut()
379 .insert(
380 GrpcMethod::new("control_client.ScsControl", "CreateSigningKey"),
381 );
382 self.inner.unary(req, path, codec).await
383 }
384 pub async fn revoke_signing_key(
385 &mut self,
386 request: impl tonic::IntoRequest<super::RevokeSigningKeyRequest>,
387 ) -> std::result::Result<
388 tonic::Response<super::RevokeSigningKeyResponse>,
389 tonic::Status,
390 > {
391 self.inner
392 .ready()
393 .await
394 .map_err(|e| {
395 tonic::Status::unknown(
396 format!("Service was not ready: {}", e.into()),
397 )
398 })?;
399 let codec = tonic::codec::ProstCodec::default();
400 let path = http::uri::PathAndQuery::from_static(
401 "/control_client.ScsControl/RevokeSigningKey",
402 );
403 let mut req = request.into_request();
404 req.extensions_mut()
405 .insert(
406 GrpcMethod::new("control_client.ScsControl", "RevokeSigningKey"),
407 );
408 self.inner.unary(req, path, codec).await
409 }
410 pub async fn list_signing_keys(
411 &mut self,
412 request: impl tonic::IntoRequest<super::ListSigningKeysRequest>,
413 ) -> std::result::Result<
414 tonic::Response<super::ListSigningKeysResponse>,
415 tonic::Status,
416 > {
417 self.inner
418 .ready()
419 .await
420 .map_err(|e| {
421 tonic::Status::unknown(
422 format!("Service was not ready: {}", e.into()),
423 )
424 })?;
425 let codec = tonic::codec::ProstCodec::default();
426 let path = http::uri::PathAndQuery::from_static(
427 "/control_client.ScsControl/ListSigningKeys",
428 );
429 let mut req = request.into_request();
430 req.extensions_mut()
431 .insert(GrpcMethod::new("control_client.ScsControl", "ListSigningKeys"));
432 self.inner.unary(req, path, codec).await
433 }
434 pub async fn create_index(
435 &mut self,
436 request: impl tonic::IntoRequest<super::CreateIndexRequest>,
437 ) -> std::result::Result<
438 tonic::Response<super::CreateIndexResponse>,
439 tonic::Status,
440 > {
441 self.inner
442 .ready()
443 .await
444 .map_err(|e| {
445 tonic::Status::unknown(
446 format!("Service was not ready: {}", e.into()),
447 )
448 })?;
449 let codec = tonic::codec::ProstCodec::default();
450 let path = http::uri::PathAndQuery::from_static(
451 "/control_client.ScsControl/CreateIndex",
452 );
453 let mut req = request.into_request();
454 req.extensions_mut()
455 .insert(GrpcMethod::new("control_client.ScsControl", "CreateIndex"));
456 self.inner.unary(req, path, codec).await
457 }
458 pub async fn delete_index(
459 &mut self,
460 request: impl tonic::IntoRequest<super::DeleteIndexRequest>,
461 ) -> std::result::Result<
462 tonic::Response<super::DeleteIndexResponse>,
463 tonic::Status,
464 > {
465 self.inner
466 .ready()
467 .await
468 .map_err(|e| {
469 tonic::Status::unknown(
470 format!("Service was not ready: {}", e.into()),
471 )
472 })?;
473 let codec = tonic::codec::ProstCodec::default();
474 let path = http::uri::PathAndQuery::from_static(
475 "/control_client.ScsControl/DeleteIndex",
476 );
477 let mut req = request.into_request();
478 req.extensions_mut()
479 .insert(GrpcMethod::new("control_client.ScsControl", "DeleteIndex"));
480 self.inner.unary(req, path, codec).await
481 }
482 pub async fn list_indexes(
483 &mut self,
484 request: impl tonic::IntoRequest<super::ListIndexesRequest>,
485 ) -> std::result::Result<
486 tonic::Response<super::ListIndexesResponse>,
487 tonic::Status,
488 > {
489 self.inner
490 .ready()
491 .await
492 .map_err(|e| {
493 tonic::Status::unknown(
494 format!("Service was not ready: {}", e.into()),
495 )
496 })?;
497 let codec = tonic::codec::ProstCodec::default();
498 let path = http::uri::PathAndQuery::from_static(
499 "/control_client.ScsControl/ListIndexes",
500 );
501 let mut req = request.into_request();
502 req.extensions_mut()
503 .insert(GrpcMethod::new("control_client.ScsControl", "ListIndexes"));
504 self.inner.unary(req, path, codec).await
505 }
506 }
507}
508pub mod scs_control_server {
510 #![allow(
511 unused_variables,
512 dead_code,
513 missing_docs,
514 clippy::wildcard_imports,
515 clippy::let_unit_value,
516 )]
517 use tonic::codegen::*;
518 #[async_trait]
520 pub trait ScsControl: std::marker::Send + std::marker::Sync + 'static {
521 async fn create_cache(
522 &self,
523 request: tonic::Request<super::CreateCacheRequest>,
524 ) -> std::result::Result<
525 tonic::Response<super::CreateCacheResponse>,
526 tonic::Status,
527 >;
528 async fn delete_cache(
529 &self,
530 request: tonic::Request<super::DeleteCacheRequest>,
531 ) -> std::result::Result<
532 tonic::Response<super::DeleteCacheResponse>,
533 tonic::Status,
534 >;
535 async fn list_caches(
536 &self,
537 request: tonic::Request<super::ListCachesRequest>,
538 ) -> std::result::Result<
539 tonic::Response<super::ListCachesResponse>,
540 tonic::Status,
541 >;
542 async fn flush_cache(
543 &self,
544 request: tonic::Request<super::FlushCacheRequest>,
545 ) -> std::result::Result<
546 tonic::Response<super::FlushCacheResponse>,
547 tonic::Status,
548 >;
549 async fn create_signing_key(
550 &self,
551 request: tonic::Request<super::CreateSigningKeyRequest>,
552 ) -> std::result::Result<
553 tonic::Response<super::CreateSigningKeyResponse>,
554 tonic::Status,
555 >;
556 async fn revoke_signing_key(
557 &self,
558 request: tonic::Request<super::RevokeSigningKeyRequest>,
559 ) -> std::result::Result<
560 tonic::Response<super::RevokeSigningKeyResponse>,
561 tonic::Status,
562 >;
563 async fn list_signing_keys(
564 &self,
565 request: tonic::Request<super::ListSigningKeysRequest>,
566 ) -> std::result::Result<
567 tonic::Response<super::ListSigningKeysResponse>,
568 tonic::Status,
569 >;
570 async fn create_index(
571 &self,
572 request: tonic::Request<super::CreateIndexRequest>,
573 ) -> std::result::Result<
574 tonic::Response<super::CreateIndexResponse>,
575 tonic::Status,
576 >;
577 async fn delete_index(
578 &self,
579 request: tonic::Request<super::DeleteIndexRequest>,
580 ) -> std::result::Result<
581 tonic::Response<super::DeleteIndexResponse>,
582 tonic::Status,
583 >;
584 async fn list_indexes(
585 &self,
586 request: tonic::Request<super::ListIndexesRequest>,
587 ) -> std::result::Result<
588 tonic::Response<super::ListIndexesResponse>,
589 tonic::Status,
590 >;
591 }
592 #[derive(Debug)]
593 pub struct ScsControlServer<T> {
594 inner: Arc<T>,
595 accept_compression_encodings: EnabledCompressionEncodings,
596 send_compression_encodings: EnabledCompressionEncodings,
597 max_decoding_message_size: Option<usize>,
598 max_encoding_message_size: Option<usize>,
599 }
600 impl<T> ScsControlServer<T> {
601 pub fn new(inner: T) -> Self {
602 Self::from_arc(Arc::new(inner))
603 }
604 pub fn from_arc(inner: Arc<T>) -> Self {
605 Self {
606 inner,
607 accept_compression_encodings: Default::default(),
608 send_compression_encodings: Default::default(),
609 max_decoding_message_size: None,
610 max_encoding_message_size: None,
611 }
612 }
613 pub fn with_interceptor<F>(
614 inner: T,
615 interceptor: F,
616 ) -> InterceptedService<Self, F>
617 where
618 F: tonic::service::Interceptor,
619 {
620 InterceptedService::new(Self::new(inner), interceptor)
621 }
622 #[must_use]
624 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
625 self.accept_compression_encodings.enable(encoding);
626 self
627 }
628 #[must_use]
630 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
631 self.send_compression_encodings.enable(encoding);
632 self
633 }
634 #[must_use]
638 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
639 self.max_decoding_message_size = Some(limit);
640 self
641 }
642 #[must_use]
646 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
647 self.max_encoding_message_size = Some(limit);
648 self
649 }
650 }
651 impl<T, B> tonic::codegen::Service<http::Request<B>> for ScsControlServer<T>
652 where
653 T: ScsControl,
654 B: Body + std::marker::Send + 'static,
655 B::Error: Into<StdError> + std::marker::Send + 'static,
656 {
657 type Response = http::Response<tonic::body::Body>;
658 type Error = std::convert::Infallible;
659 type Future = BoxFuture<Self::Response, Self::Error>;
660 fn poll_ready(
661 &mut self,
662 _cx: &mut Context<'_>,
663 ) -> Poll<std::result::Result<(), Self::Error>> {
664 Poll::Ready(Ok(()))
665 }
666 fn call(&mut self, req: http::Request<B>) -> Self::Future {
667 match req.uri().path() {
668 "/control_client.ScsControl/CreateCache" => {
669 #[allow(non_camel_case_types)]
670 struct CreateCacheSvc<T: ScsControl>(pub Arc<T>);
671 impl<
672 T: ScsControl,
673 > tonic::server::UnaryService<super::CreateCacheRequest>
674 for CreateCacheSvc<T> {
675 type Response = super::CreateCacheResponse;
676 type Future = BoxFuture<
677 tonic::Response<Self::Response>,
678 tonic::Status,
679 >;
680 fn call(
681 &mut self,
682 request: tonic::Request<super::CreateCacheRequest>,
683 ) -> Self::Future {
684 let inner = Arc::clone(&self.0);
685 let fut = async move {
686 <T as ScsControl>::create_cache(&inner, request).await
687 };
688 Box::pin(fut)
689 }
690 }
691 let accept_compression_encodings = self.accept_compression_encodings;
692 let send_compression_encodings = self.send_compression_encodings;
693 let max_decoding_message_size = self.max_decoding_message_size;
694 let max_encoding_message_size = self.max_encoding_message_size;
695 let inner = self.inner.clone();
696 let fut = async move {
697 let method = CreateCacheSvc(inner);
698 let codec = tonic::codec::ProstCodec::default();
699 let mut grpc = tonic::server::Grpc::new(codec)
700 .apply_compression_config(
701 accept_compression_encodings,
702 send_compression_encodings,
703 )
704 .apply_max_message_size_config(
705 max_decoding_message_size,
706 max_encoding_message_size,
707 );
708 let res = grpc.unary(method, req).await;
709 Ok(res)
710 };
711 Box::pin(fut)
712 }
713 "/control_client.ScsControl/DeleteCache" => {
714 #[allow(non_camel_case_types)]
715 struct DeleteCacheSvc<T: ScsControl>(pub Arc<T>);
716 impl<
717 T: ScsControl,
718 > tonic::server::UnaryService<super::DeleteCacheRequest>
719 for DeleteCacheSvc<T> {
720 type Response = super::DeleteCacheResponse;
721 type Future = BoxFuture<
722 tonic::Response<Self::Response>,
723 tonic::Status,
724 >;
725 fn call(
726 &mut self,
727 request: tonic::Request<super::DeleteCacheRequest>,
728 ) -> Self::Future {
729 let inner = Arc::clone(&self.0);
730 let fut = async move {
731 <T as ScsControl>::delete_cache(&inner, request).await
732 };
733 Box::pin(fut)
734 }
735 }
736 let accept_compression_encodings = self.accept_compression_encodings;
737 let send_compression_encodings = self.send_compression_encodings;
738 let max_decoding_message_size = self.max_decoding_message_size;
739 let max_encoding_message_size = self.max_encoding_message_size;
740 let inner = self.inner.clone();
741 let fut = async move {
742 let method = DeleteCacheSvc(inner);
743 let codec = tonic::codec::ProstCodec::default();
744 let mut grpc = tonic::server::Grpc::new(codec)
745 .apply_compression_config(
746 accept_compression_encodings,
747 send_compression_encodings,
748 )
749 .apply_max_message_size_config(
750 max_decoding_message_size,
751 max_encoding_message_size,
752 );
753 let res = grpc.unary(method, req).await;
754 Ok(res)
755 };
756 Box::pin(fut)
757 }
758 "/control_client.ScsControl/ListCaches" => {
759 #[allow(non_camel_case_types)]
760 struct ListCachesSvc<T: ScsControl>(pub Arc<T>);
761 impl<
762 T: ScsControl,
763 > tonic::server::UnaryService<super::ListCachesRequest>
764 for ListCachesSvc<T> {
765 type Response = super::ListCachesResponse;
766 type Future = BoxFuture<
767 tonic::Response<Self::Response>,
768 tonic::Status,
769 >;
770 fn call(
771 &mut self,
772 request: tonic::Request<super::ListCachesRequest>,
773 ) -> Self::Future {
774 let inner = Arc::clone(&self.0);
775 let fut = async move {
776 <T as ScsControl>::list_caches(&inner, request).await
777 };
778 Box::pin(fut)
779 }
780 }
781 let accept_compression_encodings = self.accept_compression_encodings;
782 let send_compression_encodings = self.send_compression_encodings;
783 let max_decoding_message_size = self.max_decoding_message_size;
784 let max_encoding_message_size = self.max_encoding_message_size;
785 let inner = self.inner.clone();
786 let fut = async move {
787 let method = ListCachesSvc(inner);
788 let codec = tonic::codec::ProstCodec::default();
789 let mut grpc = tonic::server::Grpc::new(codec)
790 .apply_compression_config(
791 accept_compression_encodings,
792 send_compression_encodings,
793 )
794 .apply_max_message_size_config(
795 max_decoding_message_size,
796 max_encoding_message_size,
797 );
798 let res = grpc.unary(method, req).await;
799 Ok(res)
800 };
801 Box::pin(fut)
802 }
803 "/control_client.ScsControl/FlushCache" => {
804 #[allow(non_camel_case_types)]
805 struct FlushCacheSvc<T: ScsControl>(pub Arc<T>);
806 impl<
807 T: ScsControl,
808 > tonic::server::UnaryService<super::FlushCacheRequest>
809 for FlushCacheSvc<T> {
810 type Response = super::FlushCacheResponse;
811 type Future = BoxFuture<
812 tonic::Response<Self::Response>,
813 tonic::Status,
814 >;
815 fn call(
816 &mut self,
817 request: tonic::Request<super::FlushCacheRequest>,
818 ) -> Self::Future {
819 let inner = Arc::clone(&self.0);
820 let fut = async move {
821 <T as ScsControl>::flush_cache(&inner, request).await
822 };
823 Box::pin(fut)
824 }
825 }
826 let accept_compression_encodings = self.accept_compression_encodings;
827 let send_compression_encodings = self.send_compression_encodings;
828 let max_decoding_message_size = self.max_decoding_message_size;
829 let max_encoding_message_size = self.max_encoding_message_size;
830 let inner = self.inner.clone();
831 let fut = async move {
832 let method = FlushCacheSvc(inner);
833 let codec = tonic::codec::ProstCodec::default();
834 let mut grpc = tonic::server::Grpc::new(codec)
835 .apply_compression_config(
836 accept_compression_encodings,
837 send_compression_encodings,
838 )
839 .apply_max_message_size_config(
840 max_decoding_message_size,
841 max_encoding_message_size,
842 );
843 let res = grpc.unary(method, req).await;
844 Ok(res)
845 };
846 Box::pin(fut)
847 }
848 "/control_client.ScsControl/CreateSigningKey" => {
849 #[allow(non_camel_case_types)]
850 struct CreateSigningKeySvc<T: ScsControl>(pub Arc<T>);
851 impl<
852 T: ScsControl,
853 > tonic::server::UnaryService<super::CreateSigningKeyRequest>
854 for CreateSigningKeySvc<T> {
855 type Response = super::CreateSigningKeyResponse;
856 type Future = BoxFuture<
857 tonic::Response<Self::Response>,
858 tonic::Status,
859 >;
860 fn call(
861 &mut self,
862 request: tonic::Request<super::CreateSigningKeyRequest>,
863 ) -> Self::Future {
864 let inner = Arc::clone(&self.0);
865 let fut = async move {
866 <T as ScsControl>::create_signing_key(&inner, request).await
867 };
868 Box::pin(fut)
869 }
870 }
871 let accept_compression_encodings = self.accept_compression_encodings;
872 let send_compression_encodings = self.send_compression_encodings;
873 let max_decoding_message_size = self.max_decoding_message_size;
874 let max_encoding_message_size = self.max_encoding_message_size;
875 let inner = self.inner.clone();
876 let fut = async move {
877 let method = CreateSigningKeySvc(inner);
878 let codec = tonic::codec::ProstCodec::default();
879 let mut grpc = tonic::server::Grpc::new(codec)
880 .apply_compression_config(
881 accept_compression_encodings,
882 send_compression_encodings,
883 )
884 .apply_max_message_size_config(
885 max_decoding_message_size,
886 max_encoding_message_size,
887 );
888 let res = grpc.unary(method, req).await;
889 Ok(res)
890 };
891 Box::pin(fut)
892 }
893 "/control_client.ScsControl/RevokeSigningKey" => {
894 #[allow(non_camel_case_types)]
895 struct RevokeSigningKeySvc<T: ScsControl>(pub Arc<T>);
896 impl<
897 T: ScsControl,
898 > tonic::server::UnaryService<super::RevokeSigningKeyRequest>
899 for RevokeSigningKeySvc<T> {
900 type Response = super::RevokeSigningKeyResponse;
901 type Future = BoxFuture<
902 tonic::Response<Self::Response>,
903 tonic::Status,
904 >;
905 fn call(
906 &mut self,
907 request: tonic::Request<super::RevokeSigningKeyRequest>,
908 ) -> Self::Future {
909 let inner = Arc::clone(&self.0);
910 let fut = async move {
911 <T as ScsControl>::revoke_signing_key(&inner, request).await
912 };
913 Box::pin(fut)
914 }
915 }
916 let accept_compression_encodings = self.accept_compression_encodings;
917 let send_compression_encodings = self.send_compression_encodings;
918 let max_decoding_message_size = self.max_decoding_message_size;
919 let max_encoding_message_size = self.max_encoding_message_size;
920 let inner = self.inner.clone();
921 let fut = async move {
922 let method = RevokeSigningKeySvc(inner);
923 let codec = tonic::codec::ProstCodec::default();
924 let mut grpc = tonic::server::Grpc::new(codec)
925 .apply_compression_config(
926 accept_compression_encodings,
927 send_compression_encodings,
928 )
929 .apply_max_message_size_config(
930 max_decoding_message_size,
931 max_encoding_message_size,
932 );
933 let res = grpc.unary(method, req).await;
934 Ok(res)
935 };
936 Box::pin(fut)
937 }
938 "/control_client.ScsControl/ListSigningKeys" => {
939 #[allow(non_camel_case_types)]
940 struct ListSigningKeysSvc<T: ScsControl>(pub Arc<T>);
941 impl<
942 T: ScsControl,
943 > tonic::server::UnaryService<super::ListSigningKeysRequest>
944 for ListSigningKeysSvc<T> {
945 type Response = super::ListSigningKeysResponse;
946 type Future = BoxFuture<
947 tonic::Response<Self::Response>,
948 tonic::Status,
949 >;
950 fn call(
951 &mut self,
952 request: tonic::Request<super::ListSigningKeysRequest>,
953 ) -> Self::Future {
954 let inner = Arc::clone(&self.0);
955 let fut = async move {
956 <T as ScsControl>::list_signing_keys(&inner, request).await
957 };
958 Box::pin(fut)
959 }
960 }
961 let accept_compression_encodings = self.accept_compression_encodings;
962 let send_compression_encodings = self.send_compression_encodings;
963 let max_decoding_message_size = self.max_decoding_message_size;
964 let max_encoding_message_size = self.max_encoding_message_size;
965 let inner = self.inner.clone();
966 let fut = async move {
967 let method = ListSigningKeysSvc(inner);
968 let codec = tonic::codec::ProstCodec::default();
969 let mut grpc = tonic::server::Grpc::new(codec)
970 .apply_compression_config(
971 accept_compression_encodings,
972 send_compression_encodings,
973 )
974 .apply_max_message_size_config(
975 max_decoding_message_size,
976 max_encoding_message_size,
977 );
978 let res = grpc.unary(method, req).await;
979 Ok(res)
980 };
981 Box::pin(fut)
982 }
983 "/control_client.ScsControl/CreateIndex" => {
984 #[allow(non_camel_case_types)]
985 struct CreateIndexSvc<T: ScsControl>(pub Arc<T>);
986 impl<
987 T: ScsControl,
988 > tonic::server::UnaryService<super::CreateIndexRequest>
989 for CreateIndexSvc<T> {
990 type Response = super::CreateIndexResponse;
991 type Future = BoxFuture<
992 tonic::Response<Self::Response>,
993 tonic::Status,
994 >;
995 fn call(
996 &mut self,
997 request: tonic::Request<super::CreateIndexRequest>,
998 ) -> Self::Future {
999 let inner = Arc::clone(&self.0);
1000 let fut = async move {
1001 <T as ScsControl>::create_index(&inner, request).await
1002 };
1003 Box::pin(fut)
1004 }
1005 }
1006 let accept_compression_encodings = self.accept_compression_encodings;
1007 let send_compression_encodings = self.send_compression_encodings;
1008 let max_decoding_message_size = self.max_decoding_message_size;
1009 let max_encoding_message_size = self.max_encoding_message_size;
1010 let inner = self.inner.clone();
1011 let fut = async move {
1012 let method = CreateIndexSvc(inner);
1013 let codec = tonic::codec::ProstCodec::default();
1014 let mut grpc = tonic::server::Grpc::new(codec)
1015 .apply_compression_config(
1016 accept_compression_encodings,
1017 send_compression_encodings,
1018 )
1019 .apply_max_message_size_config(
1020 max_decoding_message_size,
1021 max_encoding_message_size,
1022 );
1023 let res = grpc.unary(method, req).await;
1024 Ok(res)
1025 };
1026 Box::pin(fut)
1027 }
1028 "/control_client.ScsControl/DeleteIndex" => {
1029 #[allow(non_camel_case_types)]
1030 struct DeleteIndexSvc<T: ScsControl>(pub Arc<T>);
1031 impl<
1032 T: ScsControl,
1033 > tonic::server::UnaryService<super::DeleteIndexRequest>
1034 for DeleteIndexSvc<T> {
1035 type Response = super::DeleteIndexResponse;
1036 type Future = BoxFuture<
1037 tonic::Response<Self::Response>,
1038 tonic::Status,
1039 >;
1040 fn call(
1041 &mut self,
1042 request: tonic::Request<super::DeleteIndexRequest>,
1043 ) -> Self::Future {
1044 let inner = Arc::clone(&self.0);
1045 let fut = async move {
1046 <T as ScsControl>::delete_index(&inner, request).await
1047 };
1048 Box::pin(fut)
1049 }
1050 }
1051 let accept_compression_encodings = self.accept_compression_encodings;
1052 let send_compression_encodings = self.send_compression_encodings;
1053 let max_decoding_message_size = self.max_decoding_message_size;
1054 let max_encoding_message_size = self.max_encoding_message_size;
1055 let inner = self.inner.clone();
1056 let fut = async move {
1057 let method = DeleteIndexSvc(inner);
1058 let codec = tonic::codec::ProstCodec::default();
1059 let mut grpc = tonic::server::Grpc::new(codec)
1060 .apply_compression_config(
1061 accept_compression_encodings,
1062 send_compression_encodings,
1063 )
1064 .apply_max_message_size_config(
1065 max_decoding_message_size,
1066 max_encoding_message_size,
1067 );
1068 let res = grpc.unary(method, req).await;
1069 Ok(res)
1070 };
1071 Box::pin(fut)
1072 }
1073 "/control_client.ScsControl/ListIndexes" => {
1074 #[allow(non_camel_case_types)]
1075 struct ListIndexesSvc<T: ScsControl>(pub Arc<T>);
1076 impl<
1077 T: ScsControl,
1078 > tonic::server::UnaryService<super::ListIndexesRequest>
1079 for ListIndexesSvc<T> {
1080 type Response = super::ListIndexesResponse;
1081 type Future = BoxFuture<
1082 tonic::Response<Self::Response>,
1083 tonic::Status,
1084 >;
1085 fn call(
1086 &mut self,
1087 request: tonic::Request<super::ListIndexesRequest>,
1088 ) -> Self::Future {
1089 let inner = Arc::clone(&self.0);
1090 let fut = async move {
1091 <T as ScsControl>::list_indexes(&inner, request).await
1092 };
1093 Box::pin(fut)
1094 }
1095 }
1096 let accept_compression_encodings = self.accept_compression_encodings;
1097 let send_compression_encodings = self.send_compression_encodings;
1098 let max_decoding_message_size = self.max_decoding_message_size;
1099 let max_encoding_message_size = self.max_encoding_message_size;
1100 let inner = self.inner.clone();
1101 let fut = async move {
1102 let method = ListIndexesSvc(inner);
1103 let codec = tonic::codec::ProstCodec::default();
1104 let mut grpc = tonic::server::Grpc::new(codec)
1105 .apply_compression_config(
1106 accept_compression_encodings,
1107 send_compression_encodings,
1108 )
1109 .apply_max_message_size_config(
1110 max_decoding_message_size,
1111 max_encoding_message_size,
1112 );
1113 let res = grpc.unary(method, req).await;
1114 Ok(res)
1115 };
1116 Box::pin(fut)
1117 }
1118 _ => {
1119 Box::pin(async move {
1120 let mut response = http::Response::new(
1121 tonic::body::Body::default(),
1122 );
1123 let headers = response.headers_mut();
1124 headers
1125 .insert(
1126 tonic::Status::GRPC_STATUS,
1127 (tonic::Code::Unimplemented as i32).into(),
1128 );
1129 headers
1130 .insert(
1131 http::header::CONTENT_TYPE,
1132 tonic::metadata::GRPC_CONTENT_TYPE,
1133 );
1134 Ok(response)
1135 })
1136 }
1137 }
1138 }
1139 }
1140 impl<T> Clone for ScsControlServer<T> {
1141 fn clone(&self) -> Self {
1142 let inner = self.inner.clone();
1143 Self {
1144 inner,
1145 accept_compression_encodings: self.accept_compression_encodings,
1146 send_compression_encodings: self.send_compression_encodings,
1147 max_decoding_message_size: self.max_decoding_message_size,
1148 max_encoding_message_size: self.max_encoding_message_size,
1149 }
1150 }
1151 }
1152 pub const SERVICE_NAME: &str = "control_client.ScsControl";
1154 impl<T> tonic::server::NamedService for ScsControlServer<T> {
1155 const NAME: &'static str = SERVICE_NAME;
1156 }
1157}