1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct SparseValues {
5 #[prost(uint32, repeated, packed = "false", tag = "1")]
6 pub indices: ::prost::alloc::vec::Vec<u32>,
7 #[prost(float, repeated, packed = "false", tag = "2")]
8 pub values: ::prost::alloc::vec::Vec<f32>,
9}
10#[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct Vector {
13 #[prost(string, tag = "1")]
15 pub id: ::prost::alloc::string::String,
16 #[prost(float, repeated, packed = "false", tag = "2")]
18 pub values: ::prost::alloc::vec::Vec<f32>,
19 #[prost(message, optional, tag = "4")]
20 pub sparse_values: ::core::option::Option<SparseValues>,
21 #[prost(message, optional, tag = "3")]
23 pub metadata: ::core::option::Option<::prost_types::Struct>,
24}
25#[allow(clippy::derive_partial_eq_without_eq)]
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct ScoredVector {
28 #[prost(string, tag = "1")]
30 pub id: ::prost::alloc::string::String,
31 #[prost(float, tag = "2")]
33 pub score: f32,
34 #[prost(float, repeated, tag = "3")]
36 pub values: ::prost::alloc::vec::Vec<f32>,
37 #[prost(message, optional, tag = "5")]
39 pub sparse_values: ::core::option::Option<SparseValues>,
40 #[prost(message, optional, tag = "4")]
42 pub metadata: ::core::option::Option<::prost_types::Struct>,
43}
44#[allow(clippy::derive_partial_eq_without_eq)]
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct RequestUnion {
49 #[prost(oneof = "request_union::RequestUnionInner", tags = "1, 2, 3")]
50 pub request_union_inner: ::core::option::Option<request_union::RequestUnionInner>,
51}
52pub mod request_union {
54 #[allow(clippy::derive_partial_eq_without_eq)]
55 #[derive(Clone, PartialEq, ::prost::Oneof)]
56 pub enum RequestUnionInner {
57 #[prost(message, tag = "1")]
58 Upsert(super::UpsertRequest),
59 #[prost(message, tag = "2")]
60 Delete(super::DeleteRequest),
61 #[prost(message, tag = "3")]
62 Update(super::UpdateRequest),
63 }
64}
65#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct UpsertRequest {
69 #[prost(message, repeated, tag = "1")]
71 pub vectors: ::prost::alloc::vec::Vec<Vector>,
72 #[prost(string, tag = "2")]
74 pub namespace: ::prost::alloc::string::String,
75}
76#[allow(clippy::derive_partial_eq_without_eq)]
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct UpsertResponse {
80 #[prost(uint32, tag = "1")]
82 pub upserted_count: u32,
83}
84#[allow(clippy::derive_partial_eq_without_eq)]
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct DeleteRequest {
88 #[prost(string, repeated, tag = "1")]
90 pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
91 #[prost(bool, tag = "2")]
93 pub delete_all: bool,
94 #[prost(string, tag = "3")]
96 pub namespace: ::prost::alloc::string::String,
97 #[prost(message, optional, tag = "4")]
102 pub filter: ::core::option::Option<::prost_types::Struct>,
103}
104#[allow(clippy::derive_partial_eq_without_eq)]
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct DeleteResponse {}
108#[allow(clippy::derive_partial_eq_without_eq)]
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct FetchRequest {
112 #[prost(string, repeated, tag = "1")]
114 pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
115 #[prost(string, tag = "2")]
116 pub namespace: ::prost::alloc::string::String,
117}
118#[allow(clippy::derive_partial_eq_without_eq)]
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct FetchResponse {
122 #[prost(map = "string, message", tag = "1")]
124 pub vectors: ::std::collections::HashMap<::prost::alloc::string::String, Vector>,
125 #[prost(string, tag = "2")]
127 pub namespace: ::prost::alloc::string::String,
128 #[prost(message, optional, tag = "3")]
130 pub usage: ::core::option::Option<Usage>,
131}
132#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct ListRequest {
136 #[prost(string, optional, tag = "1")]
138 pub prefix: ::core::option::Option<::prost::alloc::string::String>,
139 #[prost(uint32, optional, tag = "2")]
141 pub limit: ::core::option::Option<u32>,
142 #[prost(string, optional, tag = "3")]
144 pub pagination_token: ::core::option::Option<::prost::alloc::string::String>,
145 #[prost(string, tag = "4")]
146 pub namespace: ::prost::alloc::string::String,
147}
148#[allow(clippy::derive_partial_eq_without_eq)]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct Pagination {
151 #[prost(string, tag = "1")]
152 pub next: ::prost::alloc::string::String,
153}
154#[allow(clippy::derive_partial_eq_without_eq)]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct ListItem {
157 #[prost(string, tag = "1")]
158 pub id: ::prost::alloc::string::String,
159}
160#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct ListResponse {
164 #[prost(message, repeated, tag = "1")]
166 pub vectors: ::prost::alloc::vec::Vec<ListItem>,
167 #[prost(message, optional, tag = "2")]
169 pub pagination: ::core::option::Option<Pagination>,
170 #[prost(string, tag = "3")]
172 pub namespace: ::prost::alloc::string::String,
173 #[prost(message, optional, tag = "4")]
175 pub usage: ::core::option::Option<Usage>,
176}
177#[allow(clippy::derive_partial_eq_without_eq)]
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct QueryVector {
181 #[prost(float, repeated, packed = "false", tag = "1")]
183 pub values: ::prost::alloc::vec::Vec<f32>,
184 #[prost(message, optional, tag = "5")]
186 pub sparse_values: ::core::option::Option<SparseValues>,
187 #[prost(uint32, tag = "2")]
189 pub top_k: u32,
190 #[prost(string, tag = "3")]
192 pub namespace: ::prost::alloc::string::String,
193 #[prost(message, optional, tag = "4")]
195 pub filter: ::core::option::Option<::prost_types::Struct>,
196}
197#[allow(clippy::derive_partial_eq_without_eq)]
199#[derive(Clone, PartialEq, ::prost::Message)]
200pub struct QueryRequest {
201 #[prost(string, tag = "1")]
203 pub namespace: ::prost::alloc::string::String,
204 #[prost(uint32, tag = "2")]
206 pub top_k: u32,
207 #[prost(message, optional, tag = "3")]
209 pub filter: ::core::option::Option<::prost_types::Struct>,
210 #[prost(bool, tag = "4")]
212 pub include_values: bool,
213 #[prost(bool, tag = "5")]
215 pub include_metadata: bool,
216 #[deprecated]
218 #[prost(message, repeated, tag = "6")]
219 pub queries: ::prost::alloc::vec::Vec<QueryVector>,
220 #[prost(float, repeated, tag = "7")]
222 pub vector: ::prost::alloc::vec::Vec<f32>,
223 #[prost(message, optional, tag = "9")]
225 pub sparse_vector: ::core::option::Option<SparseValues>,
226 #[prost(string, tag = "8")]
228 pub id: ::prost::alloc::string::String,
229}
230#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct SingleQueryResults {
234 #[prost(message, repeated, tag = "1")]
236 pub matches: ::prost::alloc::vec::Vec<ScoredVector>,
237 #[prost(string, tag = "2")]
239 pub namespace: ::prost::alloc::string::String,
240}
241#[allow(clippy::derive_partial_eq_without_eq)]
243#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct QueryResponse {
245 #[deprecated]
247 #[prost(message, repeated, tag = "1")]
248 pub results: ::prost::alloc::vec::Vec<SingleQueryResults>,
249 #[prost(message, repeated, tag = "2")]
251 pub matches: ::prost::alloc::vec::Vec<ScoredVector>,
252 #[prost(string, tag = "3")]
254 pub namespace: ::prost::alloc::string::String,
255 #[prost(message, optional, tag = "4")]
257 pub usage: ::core::option::Option<Usage>,
258}
259#[allow(clippy::derive_partial_eq_without_eq)]
260#[derive(Clone, PartialEq, ::prost::Message)]
261pub struct Usage {
262 #[prost(uint32, optional, tag = "1")]
264 pub read_units: ::core::option::Option<u32>,
265}
266#[allow(clippy::derive_partial_eq_without_eq)]
268#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct UpdateRequest {
270 #[prost(string, tag = "1")]
272 pub id: ::prost::alloc::string::String,
273 #[prost(float, repeated, tag = "2")]
275 pub values: ::prost::alloc::vec::Vec<f32>,
276 #[prost(message, optional, tag = "5")]
277 pub sparse_values: ::core::option::Option<SparseValues>,
278 #[prost(message, optional, tag = "3")]
280 pub set_metadata: ::core::option::Option<::prost_types::Struct>,
281 #[prost(string, tag = "4")]
283 pub namespace: ::prost::alloc::string::String,
284}
285#[allow(clippy::derive_partial_eq_without_eq)]
287#[derive(Clone, PartialEq, ::prost::Message)]
288pub struct UpdateResponse {}
289#[allow(clippy::derive_partial_eq_without_eq)]
291#[derive(Clone, PartialEq, ::prost::Message)]
292pub struct DescribeIndexStatsRequest {
293 #[prost(message, optional, tag = "1")]
297 pub filter: ::core::option::Option<::prost_types::Struct>,
298}
299#[allow(clippy::derive_partial_eq_without_eq)]
301#[derive(Clone, PartialEq, ::prost::Message)]
302pub struct NamespaceSummary {
303 #[prost(uint32, tag = "1")]
306 pub vector_count: u32,
307}
308#[allow(clippy::derive_partial_eq_without_eq)]
310#[derive(Clone, PartialEq, ::prost::Message)]
311pub struct DescribeIndexStatsResponse {
312 #[prost(map = "string, message", tag = "1")]
316 pub namespaces: ::std::collections::HashMap<
317 ::prost::alloc::string::String,
318 NamespaceSummary,
319 >,
320 #[prost(uint32, tag = "2")]
322 pub dimension: u32,
323 #[prost(float, tag = "3")]
329 pub index_fullness: f32,
330 #[prost(uint32, tag = "4")]
332 pub total_vector_count: u32,
333}
334pub mod vector_service_client {
336 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
337 use tonic::codegen::*;
338 use tonic::codegen::http::Uri;
339 #[derive(Debug, Clone)]
342 pub struct VectorServiceClient<T> {
343 inner: tonic::client::Grpc<T>,
344 }
345 impl VectorServiceClient<tonic::transport::Channel> {
346 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
348 where
349 D: TryInto<tonic::transport::Endpoint>,
350 D::Error: Into<StdError>,
351 {
352 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
353 Ok(Self::new(conn))
354 }
355 }
356 impl<T> VectorServiceClient<T>
357 where
358 T: tonic::client::GrpcService<tonic::body::BoxBody>,
359 T::Error: Into<StdError>,
360 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
361 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
362 {
363 pub fn new(inner: T) -> Self {
364 let inner = tonic::client::Grpc::new(inner);
365 Self { inner }
366 }
367 pub fn with_origin(inner: T, origin: Uri) -> Self {
368 let inner = tonic::client::Grpc::with_origin(inner, origin);
369 Self { inner }
370 }
371 pub fn with_interceptor<F>(
372 inner: T,
373 interceptor: F,
374 ) -> VectorServiceClient<InterceptedService<T, F>>
375 where
376 F: tonic::service::Interceptor,
377 T::ResponseBody: Default,
378 T: tonic::codegen::Service<
379 http::Request<tonic::body::BoxBody>,
380 Response = http::Response<
381 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
382 >,
383 >,
384 <T as tonic::codegen::Service<
385 http::Request<tonic::body::BoxBody>,
386 >>::Error: Into<StdError> + Send + Sync,
387 {
388 VectorServiceClient::new(InterceptedService::new(inner, interceptor))
389 }
390 #[must_use]
395 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
396 self.inner = self.inner.send_compressed(encoding);
397 self
398 }
399 #[must_use]
401 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
402 self.inner = self.inner.accept_compressed(encoding);
403 self
404 }
405 #[must_use]
409 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
410 self.inner = self.inner.max_decoding_message_size(limit);
411 self
412 }
413 #[must_use]
417 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
418 self.inner = self.inner.max_encoding_message_size(limit);
419 self
420 }
421 pub async fn upsert(
427 &mut self,
428 request: impl tonic::IntoRequest<super::UpsertRequest>,
429 ) -> std::result::Result<tonic::Response<super::UpsertResponse>, tonic::Status> {
430 self.inner
431 .ready()
432 .await
433 .map_err(|e| {
434 tonic::Status::new(
435 tonic::Code::Unknown,
436 format!("Service was not ready: {}", e.into()),
437 )
438 })?;
439 let codec = tonic::codec::ProstCodec::default();
440 let path = http::uri::PathAndQuery::from_static("/VectorService/Upsert");
441 let mut req = request.into_request();
442 req.extensions_mut().insert(GrpcMethod::new("VectorService", "Upsert"));
443 self.inner.unary(req, path, codec).await
444 }
445 pub async fn delete(
451 &mut self,
452 request: impl tonic::IntoRequest<super::DeleteRequest>,
453 ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
454 self.inner
455 .ready()
456 .await
457 .map_err(|e| {
458 tonic::Status::new(
459 tonic::Code::Unknown,
460 format!("Service was not ready: {}", e.into()),
461 )
462 })?;
463 let codec = tonic::codec::ProstCodec::default();
464 let path = http::uri::PathAndQuery::from_static("/VectorService/Delete");
465 let mut req = request.into_request();
466 req.extensions_mut().insert(GrpcMethod::new("VectorService", "Delete"));
467 self.inner.unary(req, path, codec).await
468 }
469 pub async fn fetch(
475 &mut self,
476 request: impl tonic::IntoRequest<super::FetchRequest>,
477 ) -> std::result::Result<tonic::Response<super::FetchResponse>, tonic::Status> {
478 self.inner
479 .ready()
480 .await
481 .map_err(|e| {
482 tonic::Status::new(
483 tonic::Code::Unknown,
484 format!("Service was not ready: {}", e.into()),
485 )
486 })?;
487 let codec = tonic::codec::ProstCodec::default();
488 let path = http::uri::PathAndQuery::from_static("/VectorService/Fetch");
489 let mut req = request.into_request();
490 req.extensions_mut().insert(GrpcMethod::new("VectorService", "Fetch"));
491 self.inner.unary(req, path, codec).await
492 }
493 pub async fn list(
503 &mut self,
504 request: impl tonic::IntoRequest<super::ListRequest>,
505 ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status> {
506 self.inner
507 .ready()
508 .await
509 .map_err(|e| {
510 tonic::Status::new(
511 tonic::Code::Unknown,
512 format!("Service was not ready: {}", e.into()),
513 )
514 })?;
515 let codec = tonic::codec::ProstCodec::default();
516 let path = http::uri::PathAndQuery::from_static("/VectorService/List");
517 let mut req = request.into_request();
518 req.extensions_mut().insert(GrpcMethod::new("VectorService", "List"));
519 self.inner.unary(req, path, codec).await
520 }
521 pub async fn query(
527 &mut self,
528 request: impl tonic::IntoRequest<super::QueryRequest>,
529 ) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status> {
530 self.inner
531 .ready()
532 .await
533 .map_err(|e| {
534 tonic::Status::new(
535 tonic::Code::Unknown,
536 format!("Service was not ready: {}", e.into()),
537 )
538 })?;
539 let codec = tonic::codec::ProstCodec::default();
540 let path = http::uri::PathAndQuery::from_static("/VectorService/Query");
541 let mut req = request.into_request();
542 req.extensions_mut().insert(GrpcMethod::new("VectorService", "Query"));
543 self.inner.unary(req, path, codec).await
544 }
545 pub async fn update(
551 &mut self,
552 request: impl tonic::IntoRequest<super::UpdateRequest>,
553 ) -> std::result::Result<tonic::Response<super::UpdateResponse>, tonic::Status> {
554 self.inner
555 .ready()
556 .await
557 .map_err(|e| {
558 tonic::Status::new(
559 tonic::Code::Unknown,
560 format!("Service was not ready: {}", e.into()),
561 )
562 })?;
563 let codec = tonic::codec::ProstCodec::default();
564 let path = http::uri::PathAndQuery::from_static("/VectorService/Update");
565 let mut req = request.into_request();
566 req.extensions_mut().insert(GrpcMethod::new("VectorService", "Update"));
567 self.inner.unary(req, path, codec).await
568 }
569 pub async fn describe_index_stats(
577 &mut self,
578 request: impl tonic::IntoRequest<super::DescribeIndexStatsRequest>,
579 ) -> std::result::Result<
580 tonic::Response<super::DescribeIndexStatsResponse>,
581 tonic::Status,
582 > {
583 self.inner
584 .ready()
585 .await
586 .map_err(|e| {
587 tonic::Status::new(
588 tonic::Code::Unknown,
589 format!("Service was not ready: {}", e.into()),
590 )
591 })?;
592 let codec = tonic::codec::ProstCodec::default();
593 let path = http::uri::PathAndQuery::from_static(
594 "/VectorService/DescribeIndexStats",
595 );
596 let mut req = request.into_request();
597 req.extensions_mut()
598 .insert(GrpcMethod::new("VectorService", "DescribeIndexStats"));
599 self.inner.unary(req, path, codec).await
600 }
601 }
602}
603pub mod vector_service_server {
605 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
606 use tonic::codegen::*;
607 #[async_trait]
609 pub trait VectorService: Send + Sync + 'static {
610 async fn upsert(
616 &self,
617 request: tonic::Request<super::UpsertRequest>,
618 ) -> std::result::Result<tonic::Response<super::UpsertResponse>, tonic::Status>;
619 async fn delete(
625 &self,
626 request: tonic::Request<super::DeleteRequest>,
627 ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status>;
628 async fn fetch(
634 &self,
635 request: tonic::Request<super::FetchRequest>,
636 ) -> std::result::Result<tonic::Response<super::FetchResponse>, tonic::Status>;
637 async fn list(
647 &self,
648 request: tonic::Request<super::ListRequest>,
649 ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status>;
650 async fn query(
656 &self,
657 request: tonic::Request<super::QueryRequest>,
658 ) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status>;
659 async fn update(
665 &self,
666 request: tonic::Request<super::UpdateRequest>,
667 ) -> std::result::Result<tonic::Response<super::UpdateResponse>, tonic::Status>;
668 async fn describe_index_stats(
676 &self,
677 request: tonic::Request<super::DescribeIndexStatsRequest>,
678 ) -> std::result::Result<
679 tonic::Response<super::DescribeIndexStatsResponse>,
680 tonic::Status,
681 >;
682 }
683 #[derive(Debug)]
686 pub struct VectorServiceServer<T: VectorService> {
687 inner: _Inner<T>,
688 accept_compression_encodings: EnabledCompressionEncodings,
689 send_compression_encodings: EnabledCompressionEncodings,
690 max_decoding_message_size: Option<usize>,
691 max_encoding_message_size: Option<usize>,
692 }
693 struct _Inner<T>(Arc<T>);
694 impl<T: VectorService> VectorServiceServer<T> {
695 pub fn new(inner: T) -> Self {
696 Self::from_arc(Arc::new(inner))
697 }
698 pub fn from_arc(inner: Arc<T>) -> Self {
699 let inner = _Inner(inner);
700 Self {
701 inner,
702 accept_compression_encodings: Default::default(),
703 send_compression_encodings: Default::default(),
704 max_decoding_message_size: None,
705 max_encoding_message_size: None,
706 }
707 }
708 pub fn with_interceptor<F>(
709 inner: T,
710 interceptor: F,
711 ) -> InterceptedService<Self, F>
712 where
713 F: tonic::service::Interceptor,
714 {
715 InterceptedService::new(Self::new(inner), interceptor)
716 }
717 #[must_use]
719 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
720 self.accept_compression_encodings.enable(encoding);
721 self
722 }
723 #[must_use]
725 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
726 self.send_compression_encodings.enable(encoding);
727 self
728 }
729 #[must_use]
733 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
734 self.max_decoding_message_size = Some(limit);
735 self
736 }
737 #[must_use]
741 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
742 self.max_encoding_message_size = Some(limit);
743 self
744 }
745 }
746 impl<T, B> tonic::codegen::Service<http::Request<B>> for VectorServiceServer<T>
747 where
748 T: VectorService,
749 B: Body + Send + 'static,
750 B::Error: Into<StdError> + Send + 'static,
751 {
752 type Response = http::Response<tonic::body::BoxBody>;
753 type Error = std::convert::Infallible;
754 type Future = BoxFuture<Self::Response, Self::Error>;
755 fn poll_ready(
756 &mut self,
757 _cx: &mut Context<'_>,
758 ) -> Poll<std::result::Result<(), Self::Error>> {
759 Poll::Ready(Ok(()))
760 }
761 fn call(&mut self, req: http::Request<B>) -> Self::Future {
762 let inner = self.inner.clone();
763 match req.uri().path() {
764 "/VectorService/Upsert" => {
765 #[allow(non_camel_case_types)]
766 struct UpsertSvc<T: VectorService>(pub Arc<T>);
767 impl<
768 T: VectorService,
769 > tonic::server::UnaryService<super::UpsertRequest>
770 for UpsertSvc<T> {
771 type Response = super::UpsertResponse;
772 type Future = BoxFuture<
773 tonic::Response<Self::Response>,
774 tonic::Status,
775 >;
776 fn call(
777 &mut self,
778 request: tonic::Request<super::UpsertRequest>,
779 ) -> Self::Future {
780 let inner = Arc::clone(&self.0);
781 let fut = async move {
782 <T as VectorService>::upsert(&inner, request).await
783 };
784 Box::pin(fut)
785 }
786 }
787 let accept_compression_encodings = self.accept_compression_encodings;
788 let send_compression_encodings = self.send_compression_encodings;
789 let max_decoding_message_size = self.max_decoding_message_size;
790 let max_encoding_message_size = self.max_encoding_message_size;
791 let inner = self.inner.clone();
792 let fut = async move {
793 let inner = inner.0;
794 let method = UpsertSvc(inner);
795 let codec = tonic::codec::ProstCodec::default();
796 let mut grpc = tonic::server::Grpc::new(codec)
797 .apply_compression_config(
798 accept_compression_encodings,
799 send_compression_encodings,
800 )
801 .apply_max_message_size_config(
802 max_decoding_message_size,
803 max_encoding_message_size,
804 );
805 let res = grpc.unary(method, req).await;
806 Ok(res)
807 };
808 Box::pin(fut)
809 }
810 "/VectorService/Delete" => {
811 #[allow(non_camel_case_types)]
812 struct DeleteSvc<T: VectorService>(pub Arc<T>);
813 impl<
814 T: VectorService,
815 > tonic::server::UnaryService<super::DeleteRequest>
816 for DeleteSvc<T> {
817 type Response = super::DeleteResponse;
818 type Future = BoxFuture<
819 tonic::Response<Self::Response>,
820 tonic::Status,
821 >;
822 fn call(
823 &mut self,
824 request: tonic::Request<super::DeleteRequest>,
825 ) -> Self::Future {
826 let inner = Arc::clone(&self.0);
827 let fut = async move {
828 <T as VectorService>::delete(&inner, request).await
829 };
830 Box::pin(fut)
831 }
832 }
833 let accept_compression_encodings = self.accept_compression_encodings;
834 let send_compression_encodings = self.send_compression_encodings;
835 let max_decoding_message_size = self.max_decoding_message_size;
836 let max_encoding_message_size = self.max_encoding_message_size;
837 let inner = self.inner.clone();
838 let fut = async move {
839 let inner = inner.0;
840 let method = DeleteSvc(inner);
841 let codec = tonic::codec::ProstCodec::default();
842 let mut grpc = tonic::server::Grpc::new(codec)
843 .apply_compression_config(
844 accept_compression_encodings,
845 send_compression_encodings,
846 )
847 .apply_max_message_size_config(
848 max_decoding_message_size,
849 max_encoding_message_size,
850 );
851 let res = grpc.unary(method, req).await;
852 Ok(res)
853 };
854 Box::pin(fut)
855 }
856 "/VectorService/Fetch" => {
857 #[allow(non_camel_case_types)]
858 struct FetchSvc<T: VectorService>(pub Arc<T>);
859 impl<
860 T: VectorService,
861 > tonic::server::UnaryService<super::FetchRequest> for FetchSvc<T> {
862 type Response = super::FetchResponse;
863 type Future = BoxFuture<
864 tonic::Response<Self::Response>,
865 tonic::Status,
866 >;
867 fn call(
868 &mut self,
869 request: tonic::Request<super::FetchRequest>,
870 ) -> Self::Future {
871 let inner = Arc::clone(&self.0);
872 let fut = async move {
873 <T as VectorService>::fetch(&inner, request).await
874 };
875 Box::pin(fut)
876 }
877 }
878 let accept_compression_encodings = self.accept_compression_encodings;
879 let send_compression_encodings = self.send_compression_encodings;
880 let max_decoding_message_size = self.max_decoding_message_size;
881 let max_encoding_message_size = self.max_encoding_message_size;
882 let inner = self.inner.clone();
883 let fut = async move {
884 let inner = inner.0;
885 let method = FetchSvc(inner);
886 let codec = tonic::codec::ProstCodec::default();
887 let mut grpc = tonic::server::Grpc::new(codec)
888 .apply_compression_config(
889 accept_compression_encodings,
890 send_compression_encodings,
891 )
892 .apply_max_message_size_config(
893 max_decoding_message_size,
894 max_encoding_message_size,
895 );
896 let res = grpc.unary(method, req).await;
897 Ok(res)
898 };
899 Box::pin(fut)
900 }
901 "/VectorService/List" => {
902 #[allow(non_camel_case_types)]
903 struct ListSvc<T: VectorService>(pub Arc<T>);
904 impl<
905 T: VectorService,
906 > tonic::server::UnaryService<super::ListRequest> for ListSvc<T> {
907 type Response = super::ListResponse;
908 type Future = BoxFuture<
909 tonic::Response<Self::Response>,
910 tonic::Status,
911 >;
912 fn call(
913 &mut self,
914 request: tonic::Request<super::ListRequest>,
915 ) -> Self::Future {
916 let inner = Arc::clone(&self.0);
917 let fut = async move {
918 <T as VectorService>::list(&inner, request).await
919 };
920 Box::pin(fut)
921 }
922 }
923 let accept_compression_encodings = self.accept_compression_encodings;
924 let send_compression_encodings = self.send_compression_encodings;
925 let max_decoding_message_size = self.max_decoding_message_size;
926 let max_encoding_message_size = self.max_encoding_message_size;
927 let inner = self.inner.clone();
928 let fut = async move {
929 let inner = inner.0;
930 let method = ListSvc(inner);
931 let codec = tonic::codec::ProstCodec::default();
932 let mut grpc = tonic::server::Grpc::new(codec)
933 .apply_compression_config(
934 accept_compression_encodings,
935 send_compression_encodings,
936 )
937 .apply_max_message_size_config(
938 max_decoding_message_size,
939 max_encoding_message_size,
940 );
941 let res = grpc.unary(method, req).await;
942 Ok(res)
943 };
944 Box::pin(fut)
945 }
946 "/VectorService/Query" => {
947 #[allow(non_camel_case_types)]
948 struct QuerySvc<T: VectorService>(pub Arc<T>);
949 impl<
950 T: VectorService,
951 > tonic::server::UnaryService<super::QueryRequest> for QuerySvc<T> {
952 type Response = super::QueryResponse;
953 type Future = BoxFuture<
954 tonic::Response<Self::Response>,
955 tonic::Status,
956 >;
957 fn call(
958 &mut self,
959 request: tonic::Request<super::QueryRequest>,
960 ) -> Self::Future {
961 let inner = Arc::clone(&self.0);
962 let fut = async move {
963 <T as VectorService>::query(&inner, request).await
964 };
965 Box::pin(fut)
966 }
967 }
968 let accept_compression_encodings = self.accept_compression_encodings;
969 let send_compression_encodings = self.send_compression_encodings;
970 let max_decoding_message_size = self.max_decoding_message_size;
971 let max_encoding_message_size = self.max_encoding_message_size;
972 let inner = self.inner.clone();
973 let fut = async move {
974 let inner = inner.0;
975 let method = QuerySvc(inner);
976 let codec = tonic::codec::ProstCodec::default();
977 let mut grpc = tonic::server::Grpc::new(codec)
978 .apply_compression_config(
979 accept_compression_encodings,
980 send_compression_encodings,
981 )
982 .apply_max_message_size_config(
983 max_decoding_message_size,
984 max_encoding_message_size,
985 );
986 let res = grpc.unary(method, req).await;
987 Ok(res)
988 };
989 Box::pin(fut)
990 }
991 "/VectorService/Update" => {
992 #[allow(non_camel_case_types)]
993 struct UpdateSvc<T: VectorService>(pub Arc<T>);
994 impl<
995 T: VectorService,
996 > tonic::server::UnaryService<super::UpdateRequest>
997 for UpdateSvc<T> {
998 type Response = super::UpdateResponse;
999 type Future = BoxFuture<
1000 tonic::Response<Self::Response>,
1001 tonic::Status,
1002 >;
1003 fn call(
1004 &mut self,
1005 request: tonic::Request<super::UpdateRequest>,
1006 ) -> Self::Future {
1007 let inner = Arc::clone(&self.0);
1008 let fut = async move {
1009 <T as VectorService>::update(&inner, request).await
1010 };
1011 Box::pin(fut)
1012 }
1013 }
1014 let accept_compression_encodings = self.accept_compression_encodings;
1015 let send_compression_encodings = self.send_compression_encodings;
1016 let max_decoding_message_size = self.max_decoding_message_size;
1017 let max_encoding_message_size = self.max_encoding_message_size;
1018 let inner = self.inner.clone();
1019 let fut = async move {
1020 let inner = inner.0;
1021 let method = UpdateSvc(inner);
1022 let codec = tonic::codec::ProstCodec::default();
1023 let mut grpc = tonic::server::Grpc::new(codec)
1024 .apply_compression_config(
1025 accept_compression_encodings,
1026 send_compression_encodings,
1027 )
1028 .apply_max_message_size_config(
1029 max_decoding_message_size,
1030 max_encoding_message_size,
1031 );
1032 let res = grpc.unary(method, req).await;
1033 Ok(res)
1034 };
1035 Box::pin(fut)
1036 }
1037 "/VectorService/DescribeIndexStats" => {
1038 #[allow(non_camel_case_types)]
1039 struct DescribeIndexStatsSvc<T: VectorService>(pub Arc<T>);
1040 impl<
1041 T: VectorService,
1042 > tonic::server::UnaryService<super::DescribeIndexStatsRequest>
1043 for DescribeIndexStatsSvc<T> {
1044 type Response = super::DescribeIndexStatsResponse;
1045 type Future = BoxFuture<
1046 tonic::Response<Self::Response>,
1047 tonic::Status,
1048 >;
1049 fn call(
1050 &mut self,
1051 request: tonic::Request<super::DescribeIndexStatsRequest>,
1052 ) -> Self::Future {
1053 let inner = Arc::clone(&self.0);
1054 let fut = async move {
1055 <T as VectorService>::describe_index_stats(&inner, request)
1056 .await
1057 };
1058 Box::pin(fut)
1059 }
1060 }
1061 let accept_compression_encodings = self.accept_compression_encodings;
1062 let send_compression_encodings = self.send_compression_encodings;
1063 let max_decoding_message_size = self.max_decoding_message_size;
1064 let max_encoding_message_size = self.max_encoding_message_size;
1065 let inner = self.inner.clone();
1066 let fut = async move {
1067 let inner = inner.0;
1068 let method = DescribeIndexStatsSvc(inner);
1069 let codec = tonic::codec::ProstCodec::default();
1070 let mut grpc = tonic::server::Grpc::new(codec)
1071 .apply_compression_config(
1072 accept_compression_encodings,
1073 send_compression_encodings,
1074 )
1075 .apply_max_message_size_config(
1076 max_decoding_message_size,
1077 max_encoding_message_size,
1078 );
1079 let res = grpc.unary(method, req).await;
1080 Ok(res)
1081 };
1082 Box::pin(fut)
1083 }
1084 _ => {
1085 Box::pin(async move {
1086 Ok(
1087 http::Response::builder()
1088 .status(200)
1089 .header("grpc-status", "12")
1090 .header("content-type", "application/grpc")
1091 .body(empty_body())
1092 .unwrap(),
1093 )
1094 })
1095 }
1096 }
1097 }
1098 }
1099 impl<T: VectorService> Clone for VectorServiceServer<T> {
1100 fn clone(&self) -> Self {
1101 let inner = self.inner.clone();
1102 Self {
1103 inner,
1104 accept_compression_encodings: self.accept_compression_encodings,
1105 send_compression_encodings: self.send_compression_encodings,
1106 max_decoding_message_size: self.max_decoding_message_size,
1107 max_encoding_message_size: self.max_encoding_message_size,
1108 }
1109 }
1110 }
1111 impl<T: VectorService> Clone for _Inner<T> {
1112 fn clone(&self) -> Self {
1113 Self(Arc::clone(&self.0))
1114 }
1115 }
1116 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1117 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1118 write!(f, "{:?}", self.0)
1119 }
1120 }
1121 impl<T: VectorService> tonic::server::NamedService for VectorServiceServer<T> {
1122 const NAME: &'static str = "VectorService";
1123 }
1124}