// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIndexRequest {
    /// Index name (unique identifier)
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Vector dimension (e.g., 768 for BERT, 1536 for OpenAI)
    #[prost(uint32, tag = "2")]
    pub dimension: u32,
    /// HNSW configuration
    #[prost(message, optional, tag = "3")]
    pub config: ::core::option::Option<HnswConfig>,
    /// Distance metric
    #[prost(enumeration = "DistanceMetric", tag = "4")]
    pub metric: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIndexResponse {
    /// Whether the index was created successfully
    #[prost(bool, tag = "1")]
    pub success: bool,
    /// Error message if failed
    #[prost(string, tag = "2")]
    pub error: ::prost::alloc::string::String,
    /// Index metadata
    #[prost(message, optional, tag = "3")]
    pub info: ::core::option::Option<IndexInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DropIndexRequest {
    /// Index name to drop
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DropIndexResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InsertBatchRequest {
    /// Index name
    #[prost(string, tag = "1")]
    pub index_name: ::prost::alloc::string::String,
    /// Vector IDs (must match vectors length)
    #[prost(uint64, repeated, tag = "2")]
    pub ids: ::prost::alloc::vec::Vec<u64>,
    /// Flat vector data (row-major, length = len(ids) * dimension)
    #[prost(float, repeated, tag = "3")]
    pub vectors: ::prost::alloc::vec::Vec<f32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InsertBatchResponse {
    /// Number of vectors successfully inserted
    #[prost(uint32, tag = "1")]
    pub inserted_count: u32,
    /// Error message if any
    #[prost(string, tag = "2")]
    pub error: ::prost::alloc::string::String,
    /// Duration in microseconds
    #[prost(uint64, tag = "3")]
    pub duration_us: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InsertStreamRequest {
    /// Index name (only required in first message)
    #[prost(string, tag = "1")]
    pub index_name: ::prost::alloc::string::String,
    /// Single vector to insert
    #[prost(uint64, tag = "2")]
    pub id: u64,
    #[prost(float, repeated, tag = "3")]
    pub vector: ::prost::alloc::vec::Vec<f32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InsertStreamResponse {
    /// Total vectors inserted
    #[prost(uint32, tag = "1")]
    pub total_inserted: u32,
    /// Errors encountered (if any)
    #[prost(string, repeated, tag = "2")]
    pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Total duration in microseconds
    #[prost(uint64, tag = "3")]
    pub duration_us: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchRequest {
    /// Index name
    #[prost(string, tag = "1")]
    pub index_name: ::prost::alloc::string::String,
    /// Query vector
    #[prost(float, repeated, tag = "2")]
    pub query: ::prost::alloc::vec::Vec<f32>,
    /// Number of neighbors to return
    #[prost(uint32, tag = "3")]
    pub k: u32,
    /// Expansion factor during search (optional, default: ef_search from config)
    #[prost(uint32, tag = "4")]
    pub ef: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResponse {
    /// Search results ordered by distance (ascending)
    #[prost(message, repeated, tag = "1")]
    pub results: ::prost::alloc::vec::Vec<SearchResult>,
    /// Duration in microseconds
    #[prost(uint64, tag = "2")]
    pub duration_us: u64,
    /// Error message if any
    #[prost(string, tag = "3")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchResult {
    /// Vector ID
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Distance to query vector
    #[prost(float, tag = "2")]
    pub distance: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchBatchRequest {
    /// Index name
    #[prost(string, tag = "1")]
    pub index_name: ::prost::alloc::string::String,
    /// Multiple query vectors (flat, row-major)
    #[prost(float, repeated, tag = "2")]
    pub queries: ::prost::alloc::vec::Vec<f32>,
    /// Number of queries
    #[prost(uint32, tag = "3")]
    pub num_queries: u32,
    /// K neighbors per query
    #[prost(uint32, tag = "4")]
    pub k: u32,
    /// Expansion factor
    #[prost(uint32, tag = "5")]
    pub ef: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchBatchResponse {
    /// Results for each query
    #[prost(message, repeated, tag = "1")]
    pub results: ::prost::alloc::vec::Vec<QueryResults>,
    /// Total duration in microseconds
    #[prost(uint64, tag = "2")]
    pub duration_us: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResults {
    #[prost(message, repeated, tag = "1")]
    pub results: ::prost::alloc::vec::Vec<SearchResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStatsRequest {
    /// Index name
    #[prost(string, tag = "1")]
    pub index_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStatsResponse {
    #[prost(message, optional, tag = "1")]
    pub stats: ::core::option::Option<IndexStats>,
    #[prost(string, tag = "2")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct IndexStats {
    /// Number of vectors in the index
    #[prost(uint64, tag = "1")]
    pub num_vectors: u64,
    /// Vector dimension
    #[prost(uint32, tag = "2")]
    pub dimension: u32,
    /// Maximum layer level
    #[prost(uint32, tag = "3")]
    pub max_layer: u32,
    /// Memory usage in bytes
    #[prost(uint64, tag = "4")]
    pub memory_bytes: u64,
    /// Average connections per node
    #[prost(float, tag = "5")]
    pub avg_connections: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckRequest {
    /// Optional: specific index to check
    #[prost(string, tag = "1")]
    pub index_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckResponse {
    #[prost(enumeration = "health_check_response::Status", tag = "1")]
    pub status: i32,
    /// Server version
    #[prost(string, tag = "2")]
    pub version: ::prost::alloc::string::String,
    /// Available indexes
    #[prost(string, repeated, tag = "3")]
    pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `HealthCheckResponse`.
pub mod health_check_response {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Status {
        Unknown = 0,
        Serving = 1,
        NotServing = 2,
    }
    impl Status {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unknown => "UNKNOWN",
                Self::Serving => "SERVING",
                Self::NotServing => "NOT_SERVING",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        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, Copy, PartialEq, ::prost::Message)]
pub struct HnswConfig {
    /// Maximum connections per node (M parameter, default: 16)
    #[prost(uint32, tag = "1")]
    pub max_connections: u32,
    /// Maximum connections for layer 0 (M0, default: 32)
    #[prost(uint32, tag = "2")]
    pub max_connections_layer0: u32,
    /// Expansion factor during construction (default: 200)
    #[prost(uint32, tag = "3")]
    pub ef_construction: u32,
    /// Expansion factor during search (default: 50)
    #[prost(uint32, tag = "4")]
    pub ef_search: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndexInfo {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub dimension: u32,
    #[prost(enumeration = "DistanceMetric", tag = "3")]
    pub metric: i32,
    #[prost(message, optional, tag = "4")]
    pub config: ::core::option::Option<HnswConfig>,
    /// Unix timestamp
    #[prost(uint64, tag = "5")]
    pub created_at: u64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DistanceMetric {
    Unspecified = 0,
    L2 = 1,
    Cosine = 2,
    DotProduct = 3,
}
impl DistanceMetric {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "DISTANCE_METRIC_UNSPECIFIED",
            Self::L2 => "DISTANCE_METRIC_L2",
            Self::Cosine => "DISTANCE_METRIC_COSINE",
            Self::DotProduct => "DISTANCE_METRIC_DOT_PRODUCT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DISTANCE_METRIC_UNSPECIFIED" => Some(Self::Unspecified),
            "DISTANCE_METRIC_L2" => Some(Self::L2),
            "DISTANCE_METRIC_COSINE" => Some(Self::Cosine),
            "DISTANCE_METRIC_DOT_PRODUCT" => Some(Self::DotProduct),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod vector_index_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// / VectorIndexService provides gRPC interface for HNSW vector index operations.
    /// /
    /// / This service supports:
    /// / - Batch insert operations with streaming
    /// / - K-nearest neighbor search
    /// / - Index statistics and health checks
    #[derive(Debug, Clone)]
    pub struct VectorIndexServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl VectorIndexServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> VectorIndexServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> VectorIndexServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            VectorIndexServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Create a new vector index
        pub async fn create_index(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateIndexRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateIndexResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/CreateIndex",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("sochdb.vector.v1.VectorIndexService", "CreateIndex"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Drop an existing index
        pub async fn drop_index(
            &mut self,
            request: impl tonic::IntoRequest<super::DropIndexRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DropIndexResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/DropIndex",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("sochdb.vector.v1.VectorIndexService", "DropIndex"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Insert a batch of vectors
        pub async fn insert_batch(
            &mut self,
            request: impl tonic::IntoRequest<super::InsertBatchRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InsertBatchResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/InsertBatch",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("sochdb.vector.v1.VectorIndexService", "InsertBatch"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Insert vectors via streaming (for large batches)
        pub async fn insert_stream(
            &mut self,
            request: impl tonic::IntoStreamingRequest<
                Message = super::InsertStreamRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::InsertStreamResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/InsertStream",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "sochdb.vector.v1.VectorIndexService",
                        "InsertStream",
                    ),
                );
            self.inner.client_streaming(req, path, codec).await
        }
        /// Search for k-nearest neighbors
        pub async fn search(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchRequest>,
        ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/Search",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("sochdb.vector.v1.VectorIndexService", "Search"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Batch search multiple queries
        pub async fn search_batch(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchBatchRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchBatchResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/SearchBatch",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("sochdb.vector.v1.VectorIndexService", "SearchBatch"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get index statistics
        pub async fn get_stats(
            &mut self,
            request: impl tonic::IntoRequest<super::GetStatsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetStatsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/GetStats",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("sochdb.vector.v1.VectorIndexService", "GetStats"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Health check for load balancers
        pub async fn health_check(
            &mut self,
            request: impl tonic::IntoRequest<super::HealthCheckRequest>,
        ) -> std::result::Result<
            tonic::Response<super::HealthCheckResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/sochdb.vector.v1.VectorIndexService/HealthCheck",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("sochdb.vector.v1.VectorIndexService", "HealthCheck"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod vector_index_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with VectorIndexServiceServer.
    #[async_trait]
    pub trait VectorIndexService: std::marker::Send + std::marker::Sync + 'static {
        /// Create a new vector index
        async fn create_index(
            &self,
            request: tonic::Request<super::CreateIndexRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateIndexResponse>,
            tonic::Status,
        >;
        /// Drop an existing index
        async fn drop_index(
            &self,
            request: tonic::Request<super::DropIndexRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DropIndexResponse>,
            tonic::Status,
        >;
        /// Insert a batch of vectors
        async fn insert_batch(
            &self,
            request: tonic::Request<super::InsertBatchRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InsertBatchResponse>,
            tonic::Status,
        >;
        /// Insert vectors via streaming (for large batches)
        async fn insert_stream(
            &self,
            request: tonic::Request<tonic::Streaming<super::InsertStreamRequest>>,
        ) -> std::result::Result<
            tonic::Response<super::InsertStreamResponse>,
            tonic::Status,
        >;
        /// Search for k-nearest neighbors
        async fn search(
            &self,
            request: tonic::Request<super::SearchRequest>,
        ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status>;
        /// Batch search multiple queries
        async fn search_batch(
            &self,
            request: tonic::Request<super::SearchBatchRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchBatchResponse>,
            tonic::Status,
        >;
        /// Get index statistics
        async fn get_stats(
            &self,
            request: tonic::Request<super::GetStatsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetStatsResponse>,
            tonic::Status,
        >;
        /// Health check for load balancers
        async fn health_check(
            &self,
            request: tonic::Request<super::HealthCheckRequest>,
        ) -> std::result::Result<
            tonic::Response<super::HealthCheckResponse>,
            tonic::Status,
        >;
    }
    /// / VectorIndexService provides gRPC interface for HNSW vector index operations.
    /// /
    /// / This service supports:
    /// / - Batch insert operations with streaming
    /// / - K-nearest neighbor search
    /// / - Index statistics and health checks
    #[derive(Debug)]
    pub struct VectorIndexServiceServer<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> VectorIndexServiceServer<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)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[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 VectorIndexServiceServer<T>
    where
        T: VectorIndexService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        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() {
                "/sochdb.vector.v1.VectorIndexService/CreateIndex" => {
                    #[allow(non_camel_case_types)]
                    struct CreateIndexSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > tonic::server::UnaryService<super::CreateIndexRequest>
                    for CreateIndexSvc<T> {
                        type Response = super::CreateIndexResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::CreateIndexRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as VectorIndexService>::create_index(&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 = CreateIndexSvc(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)
                }
                "/sochdb.vector.v1.VectorIndexService/DropIndex" => {
                    #[allow(non_camel_case_types)]
                    struct DropIndexSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > tonic::server::UnaryService<super::DropIndexRequest>
                    for DropIndexSvc<T> {
                        type Response = super::DropIndexResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DropIndexRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as VectorIndexService>::drop_index(&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 = DropIndexSvc(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)
                }
                "/sochdb.vector.v1.VectorIndexService/InsertBatch" => {
                    #[allow(non_camel_case_types)]
                    struct InsertBatchSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > tonic::server::UnaryService<super::InsertBatchRequest>
                    for InsertBatchSvc<T> {
                        type Response = super::InsertBatchResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InsertBatchRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as VectorIndexService>::insert_batch(&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 = InsertBatchSvc(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)
                }
                "/sochdb.vector.v1.VectorIndexService/InsertStream" => {
                    #[allow(non_camel_case_types)]
                    struct InsertStreamSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > tonic::server::ClientStreamingService<super::InsertStreamRequest>
                    for InsertStreamSvc<T> {
                        type Response = super::InsertStreamResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                tonic::Streaming<super::InsertStreamRequest>,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as VectorIndexService>::insert_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 = InsertStreamSvc(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.client_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/sochdb.vector.v1.VectorIndexService/Search" => {
                    #[allow(non_camel_case_types)]
                    struct SearchSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > tonic::server::UnaryService<super::SearchRequest>
                    for SearchSvc<T> {
                        type Response = super::SearchResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SearchRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as VectorIndexService>::search(&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 = SearchSvc(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)
                }
                "/sochdb.vector.v1.VectorIndexService/SearchBatch" => {
                    #[allow(non_camel_case_types)]
                    struct SearchBatchSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > tonic::server::UnaryService<super::SearchBatchRequest>
                    for SearchBatchSvc<T> {
                        type Response = super::SearchBatchResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SearchBatchRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as VectorIndexService>::search_batch(&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 = SearchBatchSvc(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)
                }
                "/sochdb.vector.v1.VectorIndexService/GetStats" => {
                    #[allow(non_camel_case_types)]
                    struct GetStatsSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > tonic::server::UnaryService<super::GetStatsRequest>
                    for GetStatsSvc<T> {
                        type Response = super::GetStatsResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GetStatsRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as VectorIndexService>::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)
                }
                "/sochdb.vector.v1.VectorIndexService/HealthCheck" => {
                    #[allow(non_camel_case_types)]
                    struct HealthCheckSvc<T: VectorIndexService>(pub Arc<T>);
                    impl<
                        T: VectorIndexService,
                    > 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 VectorIndexService>::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(
                            tonic::body::Body::default(),
                        );
                        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 VectorIndexServiceServer<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,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "sochdb.vector.v1.VectorIndexService";
    impl<T> tonic::server::NamedService for VectorIndexServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
