#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorParams {
#[prost(uint64, tag = "1")]
pub size: u64,
#[prost(enumeration = "Distance", tag = "2")]
pub distance: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorParamsMap {
#[prost(map = "string, message", tag = "1")]
pub map: ::std::collections::HashMap<::prost::alloc::string::String, VectorParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorsConfig {
#[prost(oneof = "vectors_config::Config", tags = "1, 2")]
pub config: ::core::option::Option<vectors_config::Config>,
}
pub mod vectors_config {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Config {
#[prost(message, tag = "1")]
Params(super::VectorParams),
#[prost(message, tag = "2")]
ParamsMap(super::VectorParamsMap),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCollectionInfoRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCollectionsRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionDescription {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCollectionInfoResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<CollectionInfo>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCollectionsResponse {
#[prost(message, repeated, tag = "1")]
pub collections: ::prost::alloc::vec::Vec<CollectionDescription>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptimizerStatus {
#[prost(bool, tag = "1")]
pub ok: bool,
#[prost(string, tag = "2")]
pub error: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HnswConfigDiff {
#[prost(uint64, optional, tag = "1")]
pub m: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub ef_construct: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub full_scan_threshold: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub max_indexing_threads: ::core::option::Option<u64>,
#[prost(bool, optional, tag = "5")]
pub on_disk: ::core::option::Option<bool>,
#[prost(uint64, optional, tag = "6")]
pub payload_m: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WalConfigDiff {
#[prost(uint64, optional, tag = "1")]
pub wal_capacity_mb: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub wal_segments_ahead: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptimizersConfigDiff {
#[prost(double, optional, tag = "1")]
pub deleted_threshold: ::core::option::Option<f64>,
#[prost(uint64, optional, tag = "2")]
pub vacuum_min_vector_number: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub default_segment_number: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub max_segment_size: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub memmap_threshold: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "6")]
pub indexing_threshold: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "7")]
pub flush_interval_sec: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "8")]
pub max_optimization_threads: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCollection {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub hnsw_config: ::core::option::Option<HnswConfigDiff>,
#[prost(message, optional, tag = "5")]
pub wal_config: ::core::option::Option<WalConfigDiff>,
#[prost(message, optional, tag = "6")]
pub optimizers_config: ::core::option::Option<OptimizersConfigDiff>,
#[prost(uint32, optional, tag = "7")]
pub shard_number: ::core::option::Option<u32>,
#[prost(bool, optional, tag = "8")]
pub on_disk_payload: ::core::option::Option<bool>,
#[prost(uint64, optional, tag = "9")]
pub timeout: ::core::option::Option<u64>,
#[prost(message, optional, tag = "10")]
pub vectors_config: ::core::option::Option<VectorsConfig>,
#[prost(uint32, optional, tag = "11")]
pub replication_factor: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "12")]
pub write_consistency_factor: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateCollection {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub optimizers_config: ::core::option::Option<OptimizersConfigDiff>,
#[prost(uint64, optional, tag = "3")]
pub timeout: ::core::option::Option<u64>,
#[prost(message, optional, tag = "4")]
pub params: ::core::option::Option<CollectionParamsDiff>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteCollection {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "2")]
pub timeout: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionOperationResponse {
#[prost(bool, tag = "1")]
pub result: bool,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionParams {
#[prost(uint32, tag = "3")]
pub shard_number: u32,
#[prost(bool, tag = "4")]
pub on_disk_payload: bool,
#[prost(message, optional, tag = "5")]
pub vectors_config: ::core::option::Option<VectorsConfig>,
#[prost(uint32, optional, tag = "6")]
pub replication_factor: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "7")]
pub write_consistency_factor: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionParamsDiff {
#[prost(uint32, optional, tag = "1")]
pub replication_factor: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "2")]
pub write_consistency_factor: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionConfig {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<CollectionParams>,
#[prost(message, optional, tag = "2")]
pub hnsw_config: ::core::option::Option<HnswConfigDiff>,
#[prost(message, optional, tag = "3")]
pub optimizer_config: ::core::option::Option<OptimizersConfigDiff>,
#[prost(message, optional, tag = "4")]
pub wal_config: ::core::option::Option<WalConfigDiff>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextIndexParams {
#[prost(enumeration = "TokenizerType", tag = "1")]
pub tokenizer: i32,
#[prost(bool, optional, tag = "2")]
pub lowercase: ::core::option::Option<bool>,
#[prost(uint64, optional, tag = "3")]
pub min_token_len: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub max_token_len: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadIndexParams {
#[prost(oneof = "payload_index_params::IndexParams", tags = "1")]
pub index_params: ::core::option::Option<payload_index_params::IndexParams>,
}
pub mod payload_index_params {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum IndexParams {
#[prost(message, tag = "1")]
TextIndexParams(super::TextIndexParams),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadSchemaInfo {
#[prost(enumeration = "PayloadSchemaType", tag = "1")]
pub data_type: i32,
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<PayloadIndexParams>,
#[prost(uint64, optional, tag = "3")]
pub points: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionInfo {
#[prost(enumeration = "CollectionStatus", tag = "1")]
pub status: i32,
#[prost(message, optional, tag = "2")]
pub optimizer_status: ::core::option::Option<OptimizerStatus>,
#[prost(uint64, tag = "3")]
pub vectors_count: u64,
#[prost(uint64, tag = "4")]
pub segments_count: u64,
#[prost(message, optional, tag = "7")]
pub config: ::core::option::Option<CollectionConfig>,
#[prost(map = "string, message", tag = "8")]
pub payload_schema: ::std::collections::HashMap<
::prost::alloc::string::String,
PayloadSchemaInfo,
>,
#[prost(uint64, tag = "9")]
pub points_count: u64,
#[prost(uint64, optional, tag = "10")]
pub indexed_vectors_count: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeAliases {
#[prost(message, repeated, tag = "1")]
pub actions: ::prost::alloc::vec::Vec<AliasOperations>,
#[prost(uint64, optional, tag = "2")]
pub timeout: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AliasOperations {
#[prost(oneof = "alias_operations::Action", tags = "1, 2, 3")]
pub action: ::core::option::Option<alias_operations::Action>,
}
pub mod alias_operations {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Action {
#[prost(message, tag = "1")]
CreateAlias(super::CreateAlias),
#[prost(message, tag = "2")]
RenameAlias(super::RenameAlias),
#[prost(message, tag = "3")]
DeleteAlias(super::DeleteAlias),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAlias {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alias_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RenameAlias {
#[prost(string, tag = "1")]
pub old_alias_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub new_alias_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAlias {
#[prost(string, tag = "1")]
pub alias_name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Distance {
UnknownDistance = 0,
Cosine = 1,
Euclid = 2,
Dot = 3,
}
impl Distance {
pub fn as_str_name(&self) -> &'static str {
match self {
Distance::UnknownDistance => "UnknownDistance",
Distance::Cosine => "Cosine",
Distance::Euclid => "Euclid",
Distance::Dot => "Dot",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownDistance" => Some(Self::UnknownDistance),
"Cosine" => Some(Self::Cosine),
"Euclid" => Some(Self::Euclid),
"Dot" => Some(Self::Dot),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CollectionStatus {
UnknownCollectionStatus = 0,
Green = 1,
Yellow = 2,
Red = 3,
}
impl CollectionStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
CollectionStatus::UnknownCollectionStatus => "UnknownCollectionStatus",
CollectionStatus::Green => "Green",
CollectionStatus::Yellow => "Yellow",
CollectionStatus::Red => "Red",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownCollectionStatus" => Some(Self::UnknownCollectionStatus),
"Green" => Some(Self::Green),
"Yellow" => Some(Self::Yellow),
"Red" => Some(Self::Red),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PayloadSchemaType {
UnknownType = 0,
Keyword = 1,
Integer = 2,
Float = 3,
Geo = 4,
Text = 5,
}
impl PayloadSchemaType {
pub fn as_str_name(&self) -> &'static str {
match self {
PayloadSchemaType::UnknownType => "UnknownType",
PayloadSchemaType::Keyword => "Keyword",
PayloadSchemaType::Integer => "Integer",
PayloadSchemaType::Float => "Float",
PayloadSchemaType::Geo => "Geo",
PayloadSchemaType::Text => "Text",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownType" => Some(Self::UnknownType),
"Keyword" => Some(Self::Keyword),
"Integer" => Some(Self::Integer),
"Float" => Some(Self::Float),
"Geo" => Some(Self::Geo),
"Text" => Some(Self::Text),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TokenizerType {
Unknown = 0,
Prefix = 1,
Whitespace = 2,
Word = 3,
}
impl TokenizerType {
pub fn as_str_name(&self) -> &'static str {
match self {
TokenizerType::Unknown => "Unknown",
TokenizerType::Prefix => "Prefix",
TokenizerType::Whitespace => "Whitespace",
TokenizerType::Word => "Word",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unknown" => Some(Self::Unknown),
"Prefix" => Some(Self::Prefix),
"Whitespace" => Some(Self::Whitespace),
"Word" => Some(Self::Word),
_ => None,
}
}
}
pub mod collections_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct CollectionsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CollectionsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> CollectionsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> CollectionsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
CollectionsClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetCollectionInfoRequest>,
) -> Result<tonic::Response<super::GetCollectionInfoResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Collections/Get");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListCollectionsRequest>,
) -> Result<tonic::Response<super::ListCollectionsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Collections/List");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateCollection>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Collections/Create",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateCollection>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Collections/Update",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCollection>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Collections/Delete",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_aliases(
&mut self,
request: impl tonic::IntoRequest<super::ChangeAliases>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Collections/UpdateAliases",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod collections_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Collections: Send + Sync + 'static {
async fn get(
&self,
request: tonic::Request<super::GetCollectionInfoRequest>,
) -> Result<tonic::Response<super::GetCollectionInfoResponse>, tonic::Status>;
async fn list(
&self,
request: tonic::Request<super::ListCollectionsRequest>,
) -> Result<tonic::Response<super::ListCollectionsResponse>, tonic::Status>;
async fn create(
&self,
request: tonic::Request<super::CreateCollection>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status>;
async fn update(
&self,
request: tonic::Request<super::UpdateCollection>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status>;
async fn delete(
&self,
request: tonic::Request<super::DeleteCollection>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status>;
async fn update_aliases(
&self,
request: tonic::Request<super::ChangeAliases>,
) -> Result<tonic::Response<super::CollectionOperationResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct CollectionsServer<T: Collections> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: Collections> CollectionsServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
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
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for CollectionsServer<T>
where
T: Collections,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/qdrant.Collections/Get" => {
#[allow(non_camel_case_types)]
struct GetSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::GetCollectionInfoRequest>
for GetSvc<T> {
type Response = super::GetCollectionInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetCollectionInfoRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).get(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GetSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Collections/List" => {
#[allow(non_camel_case_types)]
struct ListSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::ListCollectionsRequest>
for ListSvc<T> {
type Response = super::ListCollectionsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListCollectionsRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).list(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Collections/Create" => {
#[allow(non_camel_case_types)]
struct CreateSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::CreateCollection>
for CreateSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateCollection>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).create(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CreateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Collections/Update" => {
#[allow(non_camel_case_types)]
struct UpdateSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::UpdateCollection>
for UpdateSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateCollection>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).update(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UpdateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Collections/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::DeleteCollection>
for DeleteSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteCollection>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).delete(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
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,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Collections/UpdateAliases" => {
#[allow(non_camel_case_types)]
struct UpdateAliasesSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::ChangeAliases>
for UpdateAliasesSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ChangeAliases>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).update_aliases(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UpdateAliasesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Collections> Clone for CollectionsServer<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,
}
}
}
impl<T: Collections> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Collections> tonic::server::NamedService for CollectionsServer<T> {
const NAME: &'static str = "qdrant.Collections";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Struct {
#[prost(map = "string, message", tag = "1")]
pub fields: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
#[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6, 7")]
pub kind: ::core::option::Option<value::Kind>,
}
pub mod value {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
#[prost(enumeration = "super::NullValue", tag = "1")]
NullValue(i32),
#[prost(double, tag = "2")]
DoubleValue(f64),
#[prost(int64, tag = "3")]
IntegerValue(i64),
#[prost(string, tag = "4")]
StringValue(::prost::alloc::string::String),
#[prost(bool, tag = "5")]
BoolValue(bool),
#[prost(message, tag = "6")]
StructValue(super::Struct),
#[prost(message, tag = "7")]
ListValue(super::ListValue),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListValue {
#[prost(message, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<Value>,
}
#[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 {
NullValue::NullValue => "NULL_VALUE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NULL_VALUE" => Some(Self::NullValue),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointId {
#[prost(oneof = "point_id::PointIdOptions", tags = "1, 2")]
pub point_id_options: ::core::option::Option<point_id::PointIdOptions>,
}
pub mod point_id {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PointIdOptions {
#[prost(uint64, tag = "1")]
Num(u64),
#[prost(string, tag = "2")]
Uuid(::prost::alloc::string::String),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Vector {
#[prost(float, repeated, tag = "1")]
pub data: ::prost::alloc::vec::Vec<f32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpsertPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "3")]
pub points: ::prost::alloc::vec::Vec<PointStruct>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(message, optional, tag = "3")]
pub points: ::core::option::Option<PointsSelector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub ids: ::prost::alloc::vec::Vec<PointId>,
#[prost(message, optional, tag = "4")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
#[prost(message, optional, tag = "5")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetPayloadPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(map = "string, message", tag = "3")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
#[prost(message, repeated, tag = "4")]
pub points: ::prost::alloc::vec::Vec<PointId>,
#[prost(message, optional, tag = "5")]
pub points_selector: ::core::option::Option<PointsSelector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePayloadPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(string, repeated, tag = "3")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "4")]
pub points: ::prost::alloc::vec::Vec<PointId>,
#[prost(message, optional, tag = "5")]
pub points_selector: ::core::option::Option<PointsSelector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClearPayloadPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(message, optional, tag = "3")]
pub points: ::core::option::Option<PointsSelector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFieldIndexCollection {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(string, tag = "3")]
pub field_name: ::prost::alloc::string::String,
#[prost(enumeration = "FieldType", optional, tag = "4")]
pub field_type: ::core::option::Option<i32>,
#[prost(message, optional, tag = "5")]
pub field_index_params: ::core::option::Option<PayloadIndexParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFieldIndexCollection {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(string, tag = "3")]
pub field_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadIncludeSelector {
#[prost(string, repeated, tag = "1")]
pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadExcludeSelector {
#[prost(string, repeated, tag = "1")]
pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithPayloadSelector {
#[prost(oneof = "with_payload_selector::SelectorOptions", tags = "1, 2, 3")]
pub selector_options: ::core::option::Option<with_payload_selector::SelectorOptions>,
}
pub mod with_payload_selector {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SelectorOptions {
#[prost(bool, tag = "1")]
Enable(bool),
#[prost(message, tag = "2")]
Include(super::PayloadIncludeSelector),
#[prost(message, tag = "3")]
Exclude(super::PayloadExcludeSelector),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedVectors {
#[prost(map = "string, message", tag = "1")]
pub vectors: ::std::collections::HashMap<::prost::alloc::string::String, Vector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Vectors {
#[prost(oneof = "vectors::VectorsOptions", tags = "1, 2")]
pub vectors_options: ::core::option::Option<vectors::VectorsOptions>,
}
pub mod vectors {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum VectorsOptions {
#[prost(message, tag = "1")]
Vector(super::Vector),
#[prost(message, tag = "2")]
Vectors(super::NamedVectors),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorsSelector {
#[prost(string, repeated, tag = "1")]
pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithVectorsSelector {
#[prost(oneof = "with_vectors_selector::SelectorOptions", tags = "1, 2")]
pub selector_options: ::core::option::Option<with_vectors_selector::SelectorOptions>,
}
pub mod with_vectors_selector {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SelectorOptions {
#[prost(bool, tag = "1")]
Enable(bool),
#[prost(message, tag = "2")]
Include(super::VectorsSelector),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchParams {
#[prost(uint64, optional, tag = "1")]
pub hnsw_ef: ::core::option::Option<u64>,
#[prost(bool, optional, tag = "2")]
pub exact: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(float, repeated, tag = "2")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(message, optional, tag = "3")]
pub filter: ::core::option::Option<Filter>,
#[prost(uint64, tag = "4")]
pub limit: u64,
#[prost(message, optional, tag = "6")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
#[prost(message, optional, tag = "7")]
pub params: ::core::option::Option<SearchParams>,
#[prost(float, optional, tag = "8")]
pub score_threshold: ::core::option::Option<f32>,
#[prost(uint64, optional, tag = "9")]
pub offset: ::core::option::Option<u64>,
#[prost(string, optional, tag = "10")]
pub vector_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "11")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchBatchPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub search_points: ::prost::alloc::vec::Vec<SearchPoints>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScrollPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub filter: ::core::option::Option<Filter>,
#[prost(message, optional, tag = "3")]
pub offset: ::core::option::Option<PointId>,
#[prost(uint32, optional, tag = "4")]
pub limit: ::core::option::Option<u32>,
#[prost(message, optional, tag = "6")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
#[prost(message, optional, tag = "7")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupLocation {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub vector_name: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub positive: ::prost::alloc::vec::Vec<PointId>,
#[prost(message, repeated, tag = "3")]
pub negative: ::prost::alloc::vec::Vec<PointId>,
#[prost(message, optional, tag = "4")]
pub filter: ::core::option::Option<Filter>,
#[prost(uint64, tag = "5")]
pub limit: u64,
#[prost(message, optional, tag = "7")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
#[prost(message, optional, tag = "8")]
pub params: ::core::option::Option<SearchParams>,
#[prost(float, optional, tag = "9")]
pub score_threshold: ::core::option::Option<f32>,
#[prost(uint64, optional, tag = "10")]
pub offset: ::core::option::Option<u64>,
#[prost(string, optional, tag = "11")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
#[prost(message, optional, tag = "13")]
pub lookup_from: ::core::option::Option<LookupLocation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendBatchPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub recommend_points: ::prost::alloc::vec::Vec<RecommendPoints>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountPoints {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub filter: ::core::option::Option<Filter>,
#[prost(bool, optional, tag = "3")]
pub exact: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsOperationResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<UpdateResult>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateResult {
#[prost(uint64, tag = "1")]
pub operation_id: u64,
#[prost(enumeration = "UpdateStatus", tag = "2")]
pub status: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScoredPoint {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<PointId>,
#[prost(map = "string, message", tag = "2")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
#[prost(float, tag = "3")]
pub score: f32,
#[prost(uint64, tag = "5")]
pub version: u64,
#[prost(message, optional, tag = "6")]
pub vectors: ::core::option::Option<Vectors>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchResult {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchBatchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<BatchResult>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<CountResult>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScrollResponse {
#[prost(message, optional, tag = "1")]
pub next_page_offset: ::core::option::Option<PointId>,
#[prost(message, repeated, tag = "2")]
pub result: ::prost::alloc::vec::Vec<RetrievedPoint>,
#[prost(double, tag = "3")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountResult {
#[prost(uint64, tag = "1")]
pub count: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetrievedPoint {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<PointId>,
#[prost(map = "string, message", tag = "2")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
#[prost(message, optional, tag = "4")]
pub vectors: ::core::option::Option<Vectors>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<RetrievedPoint>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendBatchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<BatchResult>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Filter {
#[prost(message, repeated, tag = "1")]
pub should: ::prost::alloc::vec::Vec<Condition>,
#[prost(message, repeated, tag = "2")]
pub must: ::prost::alloc::vec::Vec<Condition>,
#[prost(message, repeated, tag = "3")]
pub must_not: ::prost::alloc::vec::Vec<Condition>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Condition {
#[prost(oneof = "condition::ConditionOneOf", tags = "1, 2, 3, 4")]
pub condition_one_of: ::core::option::Option<condition::ConditionOneOf>,
}
pub mod condition {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ConditionOneOf {
#[prost(message, tag = "1")]
Field(super::FieldCondition),
#[prost(message, tag = "2")]
IsEmpty(super::IsEmptyCondition),
#[prost(message, tag = "3")]
HasId(super::HasIdCondition),
#[prost(message, tag = "4")]
Filter(super::Filter),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IsEmptyCondition {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HasIdCondition {
#[prost(message, repeated, tag = "1")]
pub has_id: ::prost::alloc::vec::Vec<PointId>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldCondition {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub r#match: ::core::option::Option<Match>,
#[prost(message, optional, tag = "3")]
pub range: ::core::option::Option<Range>,
#[prost(message, optional, tag = "4")]
pub geo_bounding_box: ::core::option::Option<GeoBoundingBox>,
#[prost(message, optional, tag = "5")]
pub geo_radius: ::core::option::Option<GeoRadius>,
#[prost(message, optional, tag = "6")]
pub values_count: ::core::option::Option<ValuesCount>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Match {
#[prost(oneof = "r#match::MatchValue", tags = "1, 2, 3, 4")]
pub match_value: ::core::option::Option<r#match::MatchValue>,
}
pub mod r#match {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum MatchValue {
#[prost(string, tag = "1")]
Keyword(::prost::alloc::string::String),
#[prost(int64, tag = "2")]
Integer(i64),
#[prost(bool, tag = "3")]
Boolean(bool),
#[prost(string, tag = "4")]
Text(::prost::alloc::string::String),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Range {
#[prost(double, optional, tag = "1")]
pub lt: ::core::option::Option<f64>,
#[prost(double, optional, tag = "2")]
pub gt: ::core::option::Option<f64>,
#[prost(double, optional, tag = "3")]
pub gte: ::core::option::Option<f64>,
#[prost(double, optional, tag = "4")]
pub lte: ::core::option::Option<f64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoBoundingBox {
#[prost(message, optional, tag = "1")]
pub top_left: ::core::option::Option<GeoPoint>,
#[prost(message, optional, tag = "2")]
pub bottom_right: ::core::option::Option<GeoPoint>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoRadius {
#[prost(message, optional, tag = "1")]
pub center: ::core::option::Option<GeoPoint>,
#[prost(float, tag = "2")]
pub radius: f32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValuesCount {
#[prost(uint64, optional, tag = "1")]
pub lt: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub gt: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub gte: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub lte: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsSelector {
#[prost(oneof = "points_selector::PointsSelectorOneOf", tags = "1, 2")]
pub points_selector_one_of: ::core::option::Option<
points_selector::PointsSelectorOneOf,
>,
}
pub mod points_selector {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PointsSelectorOneOf {
#[prost(message, tag = "1")]
Points(super::PointsIdsList),
#[prost(message, tag = "2")]
Filter(super::Filter),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsIdsList {
#[prost(message, repeated, tag = "1")]
pub ids: ::prost::alloc::vec::Vec<PointId>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointStruct {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<PointId>,
#[prost(map = "string, message", tag = "3")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
#[prost(message, optional, tag = "4")]
pub vectors: ::core::option::Option<Vectors>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoPoint {
#[prost(double, tag = "1")]
pub lon: f64,
#[prost(double, tag = "2")]
pub lat: f64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FieldType {
Keyword = 0,
Integer = 1,
Float = 2,
Geo = 3,
Text = 4,
}
impl FieldType {
pub fn as_str_name(&self) -> &'static str {
match self {
FieldType::Keyword => "FieldTypeKeyword",
FieldType::Integer => "FieldTypeInteger",
FieldType::Float => "FieldTypeFloat",
FieldType::Geo => "FieldTypeGeo",
FieldType::Text => "FieldTypeText",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FieldTypeKeyword" => Some(Self::Keyword),
"FieldTypeInteger" => Some(Self::Integer),
"FieldTypeFloat" => Some(Self::Float),
"FieldTypeGeo" => Some(Self::Geo),
"FieldTypeText" => Some(Self::Text),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UpdateStatus {
UnknownUpdateStatus = 0,
Acknowledged = 1,
Completed = 2,
}
impl UpdateStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
UpdateStatus::UnknownUpdateStatus => "UnknownUpdateStatus",
UpdateStatus::Acknowledged => "Acknowledged",
UpdateStatus::Completed => "Completed",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownUpdateStatus" => Some(Self::UnknownUpdateStatus),
"Acknowledged" => Some(Self::Acknowledged),
"Completed" => Some(Self::Completed),
_ => None,
}
}
}
pub mod points_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct PointsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PointsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PointsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> PointsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
PointsClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn upsert(
&mut self,
request: impl tonic::IntoRequest<super::UpsertPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/Upsert");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeletePoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/Delete");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetPoints>,
) -> Result<tonic::Response<super::GetResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/Get");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn set_payload(
&mut self,
request: impl tonic::IntoRequest<super::SetPayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/SetPayload");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn overwrite_payload(
&mut self,
request: impl tonic::IntoRequest<super::SetPayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Points/OverwritePayload",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_payload(
&mut self,
request: impl tonic::IntoRequest<super::DeletePayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Points/DeletePayload",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn clear_payload(
&mut self,
request: impl tonic::IntoRequest<super::ClearPayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Points/ClearPayload",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create_field_index(
&mut self,
request: impl tonic::IntoRequest<super::CreateFieldIndexCollection>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Points/CreateFieldIndex",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_field_index(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFieldIndexCollection>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Points/DeleteFieldIndex",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn search(
&mut self,
request: impl tonic::IntoRequest<super::SearchPoints>,
) -> Result<tonic::Response<super::SearchResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/Search");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn search_batch(
&mut self,
request: impl tonic::IntoRequest<super::SearchBatchPoints>,
) -> Result<tonic::Response<super::SearchBatchResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Points/SearchBatch",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn scroll(
&mut self,
request: impl tonic::IntoRequest<super::ScrollPoints>,
) -> Result<tonic::Response<super::ScrollResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/Scroll");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn recommend(
&mut self,
request: impl tonic::IntoRequest<super::RecommendPoints>,
) -> Result<tonic::Response<super::RecommendResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/Recommend");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn recommend_batch(
&mut self,
request: impl tonic::IntoRequest<super::RecommendBatchPoints>,
) -> Result<tonic::Response<super::RecommendBatchResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Points/RecommendBatch",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn count(
&mut self,
request: impl tonic::IntoRequest<super::CountPoints>,
) -> Result<tonic::Response<super::CountResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Points/Count");
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod points_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Points: Send + Sync + 'static {
async fn upsert(
&self,
request: tonic::Request<super::UpsertPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn delete(
&self,
request: tonic::Request<super::DeletePoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn get(
&self,
request: tonic::Request<super::GetPoints>,
) -> Result<tonic::Response<super::GetResponse>, tonic::Status>;
async fn set_payload(
&self,
request: tonic::Request<super::SetPayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn overwrite_payload(
&self,
request: tonic::Request<super::SetPayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn delete_payload(
&self,
request: tonic::Request<super::DeletePayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn clear_payload(
&self,
request: tonic::Request<super::ClearPayloadPoints>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn create_field_index(
&self,
request: tonic::Request<super::CreateFieldIndexCollection>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn delete_field_index(
&self,
request: tonic::Request<super::DeleteFieldIndexCollection>,
) -> Result<tonic::Response<super::PointsOperationResponse>, tonic::Status>;
async fn search(
&self,
request: tonic::Request<super::SearchPoints>,
) -> Result<tonic::Response<super::SearchResponse>, tonic::Status>;
async fn search_batch(
&self,
request: tonic::Request<super::SearchBatchPoints>,
) -> Result<tonic::Response<super::SearchBatchResponse>, tonic::Status>;
async fn scroll(
&self,
request: tonic::Request<super::ScrollPoints>,
) -> Result<tonic::Response<super::ScrollResponse>, tonic::Status>;
async fn recommend(
&self,
request: tonic::Request<super::RecommendPoints>,
) -> Result<tonic::Response<super::RecommendResponse>, tonic::Status>;
async fn recommend_batch(
&self,
request: tonic::Request<super::RecommendBatchPoints>,
) -> Result<tonic::Response<super::RecommendBatchResponse>, tonic::Status>;
async fn count(
&self,
request: tonic::Request<super::CountPoints>,
) -> Result<tonic::Response<super::CountResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct PointsServer<T: Points> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: Points> PointsServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
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
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for PointsServer<T>
where
T: Points,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/qdrant.Points/Upsert" => {
#[allow(non_camel_case_types)]
struct UpsertSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::UpsertPoints>
for UpsertSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpsertPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).upsert(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
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,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::DeletePoints>
for DeleteSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).delete(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
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,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/Get" => {
#[allow(non_camel_case_types)]
struct GetSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::GetPoints>
for GetSvc<T> {
type Response = super::GetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).get(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GetSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/SetPayload" => {
#[allow(non_camel_case_types)]
struct SetPayloadSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SetPayloadPoints>
for SetPayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetPayloadPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).set_payload(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SetPayloadSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/OverwritePayload" => {
#[allow(non_camel_case_types)]
struct OverwritePayloadSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SetPayloadPoints>
for OverwritePayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetPayloadPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).overwrite_payload(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = OverwritePayloadSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/DeletePayload" => {
#[allow(non_camel_case_types)]
struct DeletePayloadSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::DeletePayloadPoints>
for DeletePayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePayloadPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).delete_payload(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DeletePayloadSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/ClearPayload" => {
#[allow(non_camel_case_types)]
struct ClearPayloadSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::ClearPayloadPoints>
for ClearPayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ClearPayloadPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).clear_payload(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ClearPayloadSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/CreateFieldIndex" => {
#[allow(non_camel_case_types)]
struct CreateFieldIndexSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::CreateFieldIndexCollection>
for CreateFieldIndexSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateFieldIndexCollection>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).create_field_index(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CreateFieldIndexSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/DeleteFieldIndex" => {
#[allow(non_camel_case_types)]
struct DeleteFieldIndexSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::DeleteFieldIndexCollection>
for DeleteFieldIndexSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteFieldIndexCollection>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).delete_field_index(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DeleteFieldIndexSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/Search" => {
#[allow(non_camel_case_types)]
struct SearchSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SearchPoints>
for SearchSvc<T> {
type Response = super::SearchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).search(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
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,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/SearchBatch" => {
#[allow(non_camel_case_types)]
struct SearchBatchSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SearchBatchPoints>
for SearchBatchSvc<T> {
type Response = super::SearchBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchBatchPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).search_batch(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
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,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/Scroll" => {
#[allow(non_camel_case_types)]
struct ScrollSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::ScrollPoints>
for ScrollSvc<T> {
type Response = super::ScrollResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ScrollPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).scroll(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ScrollSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/Recommend" => {
#[allow(non_camel_case_types)]
struct RecommendSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::RecommendPoints>
for RecommendSvc<T> {
type Response = super::RecommendResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RecommendPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).recommend(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = RecommendSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/RecommendBatch" => {
#[allow(non_camel_case_types)]
struct RecommendBatchSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::RecommendBatchPoints>
for RecommendBatchSvc<T> {
type Response = super::RecommendBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RecommendBatchPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).recommend_batch(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = RecommendBatchSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Points/Count" => {
#[allow(non_camel_case_types)]
struct CountSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::CountPoints>
for CountSvc<T> {
type Response = super::CountResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CountPoints>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).count(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CountSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Points> Clone for PointsServer<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,
}
}
}
impl<T: Points> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Points> tonic::server::NamedService for PointsServer<T> {
const NAME: &'static str = "qdrant.Points";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFullSnapshotRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFullSnapshotsRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSnapshotRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotDescription {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub creation_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int64, tag = "3")]
pub size: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSnapshotResponse {
#[prost(message, optional, tag = "1")]
pub snapshot_description: ::core::option::Option<SnapshotDescription>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsResponse {
#[prost(message, repeated, tag = "1")]
pub snapshot_descriptions: ::prost::alloc::vec::Vec<SnapshotDescription>,
#[prost(double, tag = "2")]
pub time: f64,
}
pub mod snapshots_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SnapshotsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SnapshotsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SnapshotsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> SnapshotsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
SnapshotsClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateSnapshotRequest>,
) -> Result<tonic::Response<super::CreateSnapshotResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Snapshots/Create");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListSnapshotsRequest>,
) -> Result<tonic::Response<super::ListSnapshotsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/qdrant.Snapshots/List");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create_full(
&mut self,
request: impl tonic::IntoRequest<super::CreateFullSnapshotRequest>,
) -> Result<tonic::Response<super::CreateSnapshotResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Snapshots/CreateFull",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn list_full(
&mut self,
request: impl tonic::IntoRequest<super::ListFullSnapshotsRequest>,
) -> Result<tonic::Response<super::ListSnapshotsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Snapshots/ListFull",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod snapshots_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Snapshots: Send + Sync + 'static {
async fn create(
&self,
request: tonic::Request<super::CreateSnapshotRequest>,
) -> Result<tonic::Response<super::CreateSnapshotResponse>, tonic::Status>;
async fn list(
&self,
request: tonic::Request<super::ListSnapshotsRequest>,
) -> Result<tonic::Response<super::ListSnapshotsResponse>, tonic::Status>;
async fn create_full(
&self,
request: tonic::Request<super::CreateFullSnapshotRequest>,
) -> Result<tonic::Response<super::CreateSnapshotResponse>, tonic::Status>;
async fn list_full(
&self,
request: tonic::Request<super::ListFullSnapshotsRequest>,
) -> Result<tonic::Response<super::ListSnapshotsResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct SnapshotsServer<T: Snapshots> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: Snapshots> SnapshotsServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
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
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for SnapshotsServer<T>
where
T: Snapshots,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/qdrant.Snapshots/Create" => {
#[allow(non_camel_case_types)]
struct CreateSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::CreateSnapshotRequest>
for CreateSvc<T> {
type Response = super::CreateSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateSnapshotRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).create(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CreateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Snapshots/List" => {
#[allow(non_camel_case_types)]
struct ListSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::ListSnapshotsRequest>
for ListSvc<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 = self.0.clone();
let fut = async move { (*inner).list(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Snapshots/CreateFull" => {
#[allow(non_camel_case_types)]
struct CreateFullSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::CreateFullSnapshotRequest>
for CreateFullSvc<T> {
type Response = super::CreateSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateFullSnapshotRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).create_full(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CreateFullSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.Snapshots/ListFull" => {
#[allow(non_camel_case_types)]
struct ListFullSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::ListFullSnapshotsRequest>
for ListFullSvc<T> {
type Response = super::ListSnapshotsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListFullSnapshotsRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).list_full(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListFullSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Snapshots> Clone for SnapshotsServer<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,
}
}
}
impl<T: Snapshots> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Snapshots> tonic::server::NamedService for SnapshotsServer<T> {
const NAME: &'static str = "qdrant.Snapshots";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckReply {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
}
pub mod qdrant_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct QdrantClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QdrantClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> QdrantClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> QdrantClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
QdrantClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn health_check(
&mut self,
request: impl tonic::IntoRequest<super::HealthCheckRequest>,
) -> Result<tonic::Response<super::HealthCheckReply>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.Qdrant/HealthCheck",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod qdrant_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Qdrant: Send + Sync + 'static {
async fn health_check(
&self,
request: tonic::Request<super::HealthCheckRequest>,
) -> Result<tonic::Response<super::HealthCheckReply>, tonic::Status>;
}
#[derive(Debug)]
pub struct QdrantServer<T: Qdrant> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: Qdrant> QdrantServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
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
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for QdrantServer<T>
where
T: Qdrant,
B: Body + Send + 'static,
B::Error: Into<StdError> + 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<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/qdrant.Qdrant/HealthCheck" => {
#[allow(non_camel_case_types)]
struct HealthCheckSvc<T: Qdrant>(pub Arc<T>);
impl<
T: Qdrant,
> tonic::server::UnaryService<super::HealthCheckRequest>
for HealthCheckSvc<T> {
type Response = super::HealthCheckReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::HealthCheckRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).health_check(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
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,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Qdrant> Clone for QdrantServer<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,
}
}
}
impl<T: Qdrant> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Qdrant> tonic::server::NamedService for QdrantServer<T> {
const NAME: &'static str = "qdrant.Qdrant";
}
}