#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpsertRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(float, repeated, tag = "2")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(map = "string, message", tag = "3")]
pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
#[prost(string, optional, tag = "4")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpsertResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, optional, tag = "2")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpsertRequest {
#[prost(message, repeated, tag = "1")]
pub records: ::prost::alloc::vec::Vec<UpsertRequest>,
#[prost(string, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpsertResponse {
#[prost(int32, tag = "1")]
pub inserted: i32,
#[prost(int32, tag = "2")]
pub updated: i32,
#[prost(string, repeated, tag = "3")]
pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRequest {
#[prost(float, repeated, tag = "1")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(int32, tag = "2")]
pub limit: i32,
#[prost(string, optional, tag = "3")]
pub filter: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResponse {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<QueryResult>,
#[prost(message, optional, tag = "2")]
pub stats: ::core::option::Option<QueryStats>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResult {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(float, tag = "2")]
pub score: f32,
#[prost(map = "string, message", tag = "3")]
pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QueryStats {
#[prost(int32, tag = "1")]
pub total_candidates: i32,
#[prost(int32, tag = "2")]
pub filtered_count: i32,
#[prost(double, tag = "3")]
pub duration_ms: f64,
#[prost(bool, tag = "4")]
pub cache_hit: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteResponse {
#[prost(bool, tag = "1")]
pub found: bool,
#[prost(bool, tag = "2")]
pub deleted: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SoftDeleteRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SoftDeleteResponse {
#[prost(bool, tag = "1")]
pub found: bool,
#[prost(bool, tag = "2")]
pub marked_deleted: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RestoreResponse {
#[prost(bool, tag = "1")]
pub found: bool,
#[prost(bool, tag = "2")]
pub restored: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactRequest {
#[prost(string, optional, tag = "2")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CompactResponse {
#[prost(int32, tag = "1")]
pub removed_count: i32,
#[prost(int64, tag = "2")]
pub freed_bytes: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatsRequest {
#[prost(string, optional, tag = "1")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StatsResponse {
#[prost(int64, tag = "1")]
pub total_vectors: i64,
#[prost(int64, tag = "2")]
pub active_vectors: i64,
#[prost(int64, tag = "3")]
pub deleted_vectors: i64,
#[prost(int32, tag = "4")]
pub dimension: i32,
#[prost(int64, tag = "5")]
pub storage_bytes: i64,
#[prost(message, optional, tag = "6")]
pub cache_stats: ::core::option::Option<CacheStats>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CacheStats {
#[prost(int64, tag = "1")]
pub hits: i64,
#[prost(int64, tag = "2")]
pub misses: i64,
#[prost(double, tag = "3")]
pub hit_rate: f64,
#[prost(int64, tag = "4")]
pub size: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ListSnapshotsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsResponse {
#[prost(message, repeated, tag = "1")]
pub snapshots: ::prost::alloc::vec::Vec<SnapshotInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub created_at: i64,
#[prost(int64, tag = "3")]
pub size_bytes: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreSnapshotRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RestoreSnapshotResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(int64, tag = "2")]
pub vectors_restored: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HybridQueryRequest {
#[prost(float, repeated, tag = "1")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(string, tag = "2")]
pub text_query: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub limit: i32,
#[prost(double, optional, tag = "4")]
pub alpha: ::core::option::Option<f64>,
#[prost(string, optional, tag = "5")]
pub filter: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub namespace: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HealthCheckRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckResponse {
#[prost(enumeration = "health_check_response::ServingStatus", tag = "1")]
pub status: i32,
#[prost(string, optional, tag = "2")]
pub message: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod health_check_response {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ServingStatus {
Unknown = 0,
Serving = 1,
NotServing = 2,
}
impl ServingStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Serving => "SERVING",
Self::NotServing => "NOT_SERVING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"SERVING" => Some(Self::Serving),
"NOT_SERVING" => Some(Self::NotServing),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
#[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6")]
pub kind: ::core::option::Option<value::Kind>,
}
pub mod value {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
#[prost(string, tag = "1")]
StringValue(::prost::alloc::string::String),
#[prost(double, tag = "2")]
NumberValue(f64),
#[prost(bool, tag = "3")]
BoolValue(bool),
#[prost(message, tag = "4")]
ArrayValue(super::ArrayValue),
#[prost(message, tag = "5")]
ObjectValue(super::ObjectValue),
#[prost(enumeration = "super::NullValue", tag = "6")]
NullValue(i32),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArrayValue {
#[prost(message, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectValue {
#[prost(map = "string, message", tag = "1")]
pub fields: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NamespaceQuotas {
#[prost(int64, optional, tag = "1")]
pub max_vectors: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "2")]
pub max_storage_bytes: ::core::option::Option<i64>,
#[prost(double, optional, tag = "3")]
pub max_requests_per_second: ::core::option::Option<f64>,
#[prost(int32, optional, tag = "4")]
pub max_concurrent_queries: ::core::option::Option<i32>,
#[prost(int32, optional, tag = "5")]
pub max_dimension: ::core::option::Option<i32>,
#[prost(int32, optional, tag = "6")]
pub max_results_per_query: ::core::option::Option<i32>,
#[prost(int32, optional, tag = "7")]
pub max_batch_size: ::core::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamespaceInfo {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub quotas: ::core::option::Option<NamespaceQuotas>,
#[prost(enumeration = "NamespaceStatus", tag = "5")]
pub status: i32,
#[prost(int64, tag = "6")]
pub created_at: i64,
#[prost(int64, tag = "7")]
pub updated_at: i64,
#[prost(map = "string, string", tag = "8")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateNamespaceRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub quotas: ::core::option::Option<NamespaceQuotas>,
#[prost(map = "string, string", tag = "5")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateNamespaceResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, optional, tag = "2")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub namespace: ::core::option::Option<NamespaceInfo>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ListNamespacesRequest {
#[prost(enumeration = "NamespaceStatus", optional, tag = "1")]
pub status_filter: ::core::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListNamespacesResponse {
#[prost(message, repeated, tag = "1")]
pub namespaces: ::prost::alloc::vec::Vec<NamespaceInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNamespaceRequest {
#[prost(string, tag = "1")]
pub namespace_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNamespaceResponse {
#[prost(message, optional, tag = "1")]
pub namespace: ::core::option::Option<NamespaceInfo>,
#[prost(string, optional, tag = "2")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateNamespaceQuotasRequest {
#[prost(string, tag = "1")]
pub namespace_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub quotas: ::core::option::Option<NamespaceQuotas>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateNamespaceQuotasResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, optional, tag = "2")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateNamespaceStatusRequest {
#[prost(string, tag = "1")]
pub namespace_id: ::prost::alloc::string::String,
#[prost(enumeration = "NamespaceStatus", tag = "2")]
pub status: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateNamespaceStatusResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, optional, tag = "2")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteNamespaceRequest {
#[prost(string, tag = "1")]
pub namespace_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteNamespaceResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, optional, tag = "2")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNamespaceStatsRequest {
#[prost(string, tag = "1")]
pub namespace_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNamespaceStatsResponse {
#[prost(string, tag = "1")]
pub namespace_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub vector_count: i64,
#[prost(int64, tag = "3")]
pub active_count: i64,
#[prost(int64, tag = "4")]
pub deleted_count: i64,
#[prost(int32, tag = "5")]
pub dimension: i32,
#[prost(double, tag = "6")]
pub quota_utilization: f64,
#[prost(int64, tag = "7")]
pub total_requests: i64,
#[prost(int64, tag = "8")]
pub total_queries: i64,
#[prost(int64, tag = "9")]
pub total_upserts: i64,
#[prost(int64, tag = "10")]
pub total_deletes: i64,
#[prost(enumeration = "NamespaceStatus", tag = "11")]
pub status: i32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetAggregateStatsRequest {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetAggregateStatsResponse {
#[prost(int32, tag = "1")]
pub total_namespaces: i32,
#[prost(int32, tag = "2")]
pub active_namespaces: i32,
#[prost(int64, tag = "3")]
pub total_vectors: i64,
#[prost(int64, tag = "4")]
pub total_requests: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NullValue {
NullValue = 0,
}
impl NullValue {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NullValue => "NULL_VALUE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NULL_VALUE" => Some(Self::NullValue),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NamespaceStatus {
NamespaceActive = 0,
NamespaceSuspended = 1,
NamespaceReadOnly = 2,
NamespacePendingDeletion = 3,
}
impl NamespaceStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NamespaceActive => "NAMESPACE_ACTIVE",
Self::NamespaceSuspended => "NAMESPACE_SUSPENDED",
Self::NamespaceReadOnly => "NAMESPACE_READ_ONLY",
Self::NamespacePendingDeletion => "NAMESPACE_PENDING_DELETION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NAMESPACE_ACTIVE" => Some(Self::NamespaceActive),
"NAMESPACE_SUSPENDED" => Some(Self::NamespaceSuspended),
"NAMESPACE_READ_ONLY" => Some(Self::NamespaceReadOnly),
"NAMESPACE_PENDING_DELETION" => Some(Self::NamespacePendingDeletion),
_ => None,
}
}
}
pub mod vec_store_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait VecStoreService: std::marker::Send + std::marker::Sync + 'static {
async fn upsert(
&self,
request: tonic::Request<super::UpsertRequest>,
) -> std::result::Result<tonic::Response<super::UpsertResponse>, tonic::Status>;
async fn batch_upsert(
&self,
request: tonic::Request<super::BatchUpsertRequest>,
) -> std::result::Result<
tonic::Response<super::BatchUpsertResponse>,
tonic::Status,
>;
async fn query(
&self,
request: tonic::Request<super::QueryRequest>,
) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status>;
type QueryStreamStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::QueryResult, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn query_stream(
&self,
request: tonic::Request<super::QueryRequest>,
) -> std::result::Result<
tonic::Response<Self::QueryStreamStream>,
tonic::Status,
>;
async fn delete(
&self,
request: tonic::Request<super::DeleteRequest>,
) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status>;
async fn soft_delete(
&self,
request: tonic::Request<super::SoftDeleteRequest>,
) -> std::result::Result<
tonic::Response<super::SoftDeleteResponse>,
tonic::Status,
>;
async fn restore(
&self,
request: tonic::Request<super::RestoreRequest>,
) -> std::result::Result<tonic::Response<super::RestoreResponse>, tonic::Status>;
async fn compact(
&self,
request: tonic::Request<super::CompactRequest>,
) -> std::result::Result<tonic::Response<super::CompactResponse>, tonic::Status>;
async fn get_stats(
&self,
request: tonic::Request<super::StatsRequest>,
) -> std::result::Result<tonic::Response<super::StatsResponse>, tonic::Status>;
async fn create_snapshot(
&self,
request: tonic::Request<super::SnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::SnapshotResponse>,
tonic::Status,
>;
async fn list_snapshots(
&self,
request: tonic::Request<super::ListSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
tonic::Status,
>;
async fn restore_snapshot(
&self,
request: tonic::Request<super::RestoreSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::RestoreSnapshotResponse>,
tonic::Status,
>;
async fn hybrid_query(
&self,
request: tonic::Request<super::HybridQueryRequest>,
) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status>;
async fn health_check(
&self,
request: tonic::Request<super::HealthCheckRequest>,
) -> std::result::Result<
tonic::Response<super::HealthCheckResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct VecStoreServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> VecStoreServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for VecStoreServiceServer<T>
where
T: VecStoreService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/vecstore.VecStoreService/Upsert" => {
#[allow(non_camel_case_types)]
struct UpsertSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::UpsertRequest>
for UpsertSvc<T> {
type Response = super::UpsertResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpsertRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::upsert(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpsertSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/BatchUpsert" => {
#[allow(non_camel_case_types)]
struct BatchUpsertSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::BatchUpsertRequest>
for BatchUpsertSvc<T> {
type Response = super::BatchUpsertResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchUpsertRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::batch_upsert(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = BatchUpsertSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/Query" => {
#[allow(non_camel_case_types)]
struct QuerySvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::QueryRequest> for QuerySvc<T> {
type Response = super::QueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::query(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QuerySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/QueryStream" => {
#[allow(non_camel_case_types)]
struct QueryStreamSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::ServerStreamingService<super::QueryRequest>
for QueryStreamSvc<T> {
type Response = super::QueryResult;
type ResponseStream = T::QueryStreamStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::query_stream(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QueryStreamSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::DeleteRequest>
for DeleteSvc<T> {
type Response = super::DeleteResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::delete(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/SoftDelete" => {
#[allow(non_camel_case_types)]
struct SoftDeleteSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::SoftDeleteRequest>
for SoftDeleteSvc<T> {
type Response = super::SoftDeleteResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SoftDeleteRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::soft_delete(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SoftDeleteSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/Restore" => {
#[allow(non_camel_case_types)]
struct RestoreSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::RestoreRequest>
for RestoreSvc<T> {
type Response = super::RestoreResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RestoreRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::restore(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RestoreSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/Compact" => {
#[allow(non_camel_case_types)]
struct CompactSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::CompactRequest>
for CompactSvc<T> {
type Response = super::CompactResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CompactRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::compact(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CompactSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/GetStats" => {
#[allow(non_camel_case_types)]
struct GetStatsSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::StatsRequest>
for GetStatsSvc<T> {
type Response = super::StatsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::get_stats(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetStatsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/CreateSnapshot" => {
#[allow(non_camel_case_types)]
struct CreateSnapshotSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::SnapshotRequest>
for CreateSnapshotSvc<T> {
type Response = super::SnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::create_snapshot(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CreateSnapshotSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/ListSnapshots" => {
#[allow(non_camel_case_types)]
struct ListSnapshotsSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::ListSnapshotsRequest>
for ListSnapshotsSvc<T> {
type Response = super::ListSnapshotsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListSnapshotsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::list_snapshots(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListSnapshotsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/RestoreSnapshot" => {
#[allow(non_camel_case_types)]
struct RestoreSnapshotSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::RestoreSnapshotRequest>
for RestoreSnapshotSvc<T> {
type Response = super::RestoreSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RestoreSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::restore_snapshot(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RestoreSnapshotSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/HybridQuery" => {
#[allow(non_camel_case_types)]
struct HybridQuerySvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::HybridQueryRequest>
for HybridQuerySvc<T> {
type Response = super::QueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::HybridQueryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::hybrid_query(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = HybridQuerySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreService/HealthCheck" => {
#[allow(non_camel_case_types)]
struct HealthCheckSvc<T: VecStoreService>(pub Arc<T>);
impl<
T: VecStoreService,
> tonic::server::UnaryService<super::HealthCheckRequest>
for HealthCheckSvc<T> {
type Response = super::HealthCheckResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::HealthCheckRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreService>::health_check(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = HealthCheckSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(empty_body());
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for VecStoreServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "vecstore.VecStoreService";
impl<T> tonic::server::NamedService for VecStoreServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod vec_store_admin_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait VecStoreAdminService: std::marker::Send + std::marker::Sync + 'static {
async fn create_namespace(
&self,
request: tonic::Request<super::CreateNamespaceRequest>,
) -> std::result::Result<
tonic::Response<super::CreateNamespaceResponse>,
tonic::Status,
>;
async fn list_namespaces(
&self,
request: tonic::Request<super::ListNamespacesRequest>,
) -> std::result::Result<
tonic::Response<super::ListNamespacesResponse>,
tonic::Status,
>;
async fn get_namespace(
&self,
request: tonic::Request<super::GetNamespaceRequest>,
) -> std::result::Result<
tonic::Response<super::GetNamespaceResponse>,
tonic::Status,
>;
async fn update_namespace_quotas(
&self,
request: tonic::Request<super::UpdateNamespaceQuotasRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateNamespaceQuotasResponse>,
tonic::Status,
>;
async fn update_namespace_status(
&self,
request: tonic::Request<super::UpdateNamespaceStatusRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateNamespaceStatusResponse>,
tonic::Status,
>;
async fn delete_namespace(
&self,
request: tonic::Request<super::DeleteNamespaceRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteNamespaceResponse>,
tonic::Status,
>;
async fn get_namespace_stats(
&self,
request: tonic::Request<super::GetNamespaceStatsRequest>,
) -> std::result::Result<
tonic::Response<super::GetNamespaceStatsResponse>,
tonic::Status,
>;
async fn get_aggregate_stats(
&self,
request: tonic::Request<super::GetAggregateStatsRequest>,
) -> std::result::Result<
tonic::Response<super::GetAggregateStatsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct VecStoreAdminServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> VecStoreAdminServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for VecStoreAdminServiceServer<T>
where
T: VecStoreAdminService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/vecstore.VecStoreAdminService/CreateNamespace" => {
#[allow(non_camel_case_types)]
struct CreateNamespaceSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::CreateNamespaceRequest>
for CreateNamespaceSvc<T> {
type Response = super::CreateNamespaceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateNamespaceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::create_namespace(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CreateNamespaceSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreAdminService/ListNamespaces" => {
#[allow(non_camel_case_types)]
struct ListNamespacesSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::ListNamespacesRequest>
for ListNamespacesSvc<T> {
type Response = super::ListNamespacesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListNamespacesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::list_namespaces(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListNamespacesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreAdminService/GetNamespace" => {
#[allow(non_camel_case_types)]
struct GetNamespaceSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::GetNamespaceRequest>
for GetNamespaceSvc<T> {
type Response = super::GetNamespaceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetNamespaceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::get_namespace(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetNamespaceSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreAdminService/UpdateNamespaceQuotas" => {
#[allow(non_camel_case_types)]
struct UpdateNamespaceQuotasSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::UpdateNamespaceQuotasRequest>
for UpdateNamespaceQuotasSvc<T> {
type Response = super::UpdateNamespaceQuotasResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateNamespaceQuotasRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::update_namespace_quotas(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpdateNamespaceQuotasSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreAdminService/UpdateNamespaceStatus" => {
#[allow(non_camel_case_types)]
struct UpdateNamespaceStatusSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::UpdateNamespaceStatusRequest>
for UpdateNamespaceStatusSvc<T> {
type Response = super::UpdateNamespaceStatusResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateNamespaceStatusRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::update_namespace_status(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpdateNamespaceStatusSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreAdminService/DeleteNamespace" => {
#[allow(non_camel_case_types)]
struct DeleteNamespaceSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::DeleteNamespaceRequest>
for DeleteNamespaceSvc<T> {
type Response = super::DeleteNamespaceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteNamespaceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::delete_namespace(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteNamespaceSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreAdminService/GetNamespaceStats" => {
#[allow(non_camel_case_types)]
struct GetNamespaceStatsSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::GetNamespaceStatsRequest>
for GetNamespaceStatsSvc<T> {
type Response = super::GetNamespaceStatsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetNamespaceStatsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::get_namespace_stats(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetNamespaceStatsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vecstore.VecStoreAdminService/GetAggregateStats" => {
#[allow(non_camel_case_types)]
struct GetAggregateStatsSvc<T: VecStoreAdminService>(pub Arc<T>);
impl<
T: VecStoreAdminService,
> tonic::server::UnaryService<super::GetAggregateStatsRequest>
for GetAggregateStatsSvc<T> {
type Response = super::GetAggregateStatsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetAggregateStatsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as VecStoreAdminService>::get_aggregate_stats(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetAggregateStatsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(empty_body());
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for VecStoreAdminServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "vecstore.VecStoreAdminService";
impl<T> tonic::server::NamedService for VecStoreAdminServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}