From e4e74727d40b9826e492e92e3636f159cdbd0d4d Mon Sep 17 00:00:00 2001 From: Arnaud Gourlay Date: Tue, 11 Apr 2023 14:56:47 +0200 Subject: [PATCH 1/4] dependency update --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 839c9977..17558692 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,14 +17,14 @@ tonic = { version = "0.8.3", features = ["tls", "tls-roots"] } prost = "0.11.8" prost-types = "0.11.8" anyhow = "1" -reqwest = { version = "0.11.14", optional = true, features = ["stream"] } -futures-util = { version = "0.3.27", optional = true } +reqwest = { version = "0.11.16", optional = true, features = ["stream"] } +futures-util = { version = "0.3.28", optional = true } [build-dependencies] tonic-build = { version = "0.8.4", features = ["prost"] } [dev-dependencies] -tokio = { version = "1.26.0", features = ["rt-multi-thread"] } +tokio = { version = "1.27.0", features = ["rt-multi-thread"] } [features] default = ["download_snapshots"] From debc8f18a6864c1b484e9675e09fb40b90a2cfd0 Mon Sep 17 00:00:00 2001 From: Arnaud Gourlay Date: Tue, 11 Apr 2023 14:58:56 +0200 Subject: [PATCH 2/4] sync API definition --- examples/search.rs | 2 + proto/collections.proto | 24 +- proto/json_with_int.proto | 8 +- proto/points.proto | 7 +- proto/points_service.proto | 4 +- src/client.rs | 44 +- src/lib.rs | 12 +- src/qdrant.rs | 1334 +++++++++++++----------------------- 8 files changed, 561 insertions(+), 874 deletions(-) diff --git a/examples/search.rs b/examples/search.rs index d094e225..13161fa3 100644 --- a/examples/search.rs +++ b/examples/search.rs @@ -32,6 +32,8 @@ async fn main() -> Result<()> { config: Some(Config::Params(VectorParams { size: 10, distance: Distance::Cosine.into(), + hnsw_config: None, + quantization_config: None, })), }), ..Default::default() diff --git a/proto/collections.proto b/proto/collections.proto index 2021fe67..6b54a856 100644 --- a/proto/collections.proto +++ b/proto/collections.proto @@ -4,6 +4,8 @@ package qdrant; message VectorParams { uint64 size = 1; // Size of the vectors Distance distance = 2; // Distance function used for comparing vectors + optional HnswConfigDiff hnsw_config = 3; // Configuration of vector HNSW graph. If omitted - the collection configuration will be used + optional QuantizationConfig quantization_config = 4; // Configuration of vector quantization config. If omitted - the collection configuration will be used } message VectorParamsMap { @@ -77,14 +79,14 @@ message HnswConfigDiff { */ optional uint64 m = 1; /* - Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index. + Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index. */ optional uint64 ef_construct = 2; /* Minimal size (in KiloBytes) of vectors for additional payload-based indexing. - If payload chunk is smaller than `full_scan_threshold` additional indexing won't be used - + If the payload chunk is smaller than `full_scan_threshold` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. - Note: 1Kb = 1 vector of size 256 + Note: 1 Kb = 1 vector of size 256 */ optional uint64 full_scan_threshold = 3; /* @@ -92,7 +94,7 @@ message HnswConfigDiff { */ optional uint64 max_indexing_threads = 4; /* - Store HNSW index on disk. If set to false, index will be stored in RAM. + Store HNSW index on disk. If set to false, the index will be stored in RAM. */ optional bool on_disk = 5; /* @@ -116,13 +118,13 @@ message OptimizersConfigDiff { */ optional uint64 vacuum_min_vector_number = 2; /* - Target amount of segments optimizer will try to keep. + Target amount of segments the optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points. - Current write RPS. - It is recommended to select default number of segments as a factor of the number of search threads, + It is recommended to select the default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads. */ optional uint64 default_segment_number = 3; @@ -131,14 +133,14 @@ message OptimizersConfigDiff { Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments. - If indexation speed have more priority for your - make this parameter lower. + If indexation speed has more priority for you - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256 */ optional uint64 max_segment_size = 4; /* Maximum size (in KiloBytes) of vectors to store in-memory per segment. - Segments larger than this threshold will be stored as read-only memmaped file. + Segments larger than this threshold will be stored as a read-only memmaped file. To enable memmap storage, lower the threshold Note: 1Kb = 1 vector of size 256 */ @@ -185,7 +187,7 @@ message CreateCollection { optional uint32 replication_factor = 11; // Number of replicas of each shard that network tries to maintain, default = 1 optional uint32 write_consistency_factor = 12; // How many replicas should apply the operation for us to consider it successful, default = 1 optional string init_from_collection = 13; // Specify name of the other collection to copy data from - optional QuantizationConfig quantization_config = 14; + optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector } message UpdateCollection { @@ -237,7 +239,7 @@ enum TokenizerType { message TextIndexParams { TokenizerType tokenizer = 1; // Tokenizer type - optional bool lowercase = 2; // If true - all tokens will be lowercased + optional bool lowercase = 2; // If true - all tokens will be lowercase optional uint64 min_token_len = 3; // Minimal token length optional uint64 max_token_len = 4; // Maximal token length } @@ -309,4 +311,4 @@ message AliasDescription { message ListAliasesResponse { repeated AliasDescription aliases = 1; double time = 2; // Time spent to process -} \ No newline at end of file +} diff --git a/proto/json_with_int.proto b/proto/json_with_int.proto index 8d03757c..3fc496e8 100644 --- a/proto/json_with_int.proto +++ b/proto/json_with_int.proto @@ -11,7 +11,7 @@ package qdrant; // object. The details of that representation are described together // with the proto support for the language. // -// The JSON representation for `Struct` is JSON object. +// The JSON representation for `Struct` is a JSON object. message Struct { // Unordered map of dynamically typed values. map fields = 1; @@ -19,10 +19,10 @@ message Struct { // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a -// list of values. A producer of value is expected to set one of that +// list of values. A producer of value is expected to set one of those // variants, absence of any variant indicates an error. // -// The JSON representation for `Value` is JSON value. +// The JSON representation for `Value` is a JSON value. message Value { // The kind of value. oneof kind { @@ -54,7 +54,7 @@ enum NullValue { // `ListValue` is a wrapper around a repeated field of values. // -// The JSON representation for `ListValue` is JSON array. +// The JSON representation for `ListValue` is a JSON array. message ListValue { // Repeated field of dynamically typed values. repeated Value values = 1; diff --git a/proto/points.proto b/proto/points.proto index a2753dd0..5fb39eb5 100644 --- a/proto/points.proto +++ b/proto/points.proto @@ -350,6 +350,7 @@ message Condition { IsEmptyCondition is_empty = 2; HasIdCondition has_id = 3; Filter filter = 4; + IsNullCondition is_null = 5; } } @@ -357,6 +358,10 @@ message IsEmptyCondition { string key = 1; } +message IsNullCondition { + string key = 1; +} + message HasIdCondition { repeated PointId has_id = 1; } @@ -365,7 +370,7 @@ message FieldCondition { string key = 1; Match match = 2; // Check if point has field with a given value Range range = 3; // Check if points value lies in a given range - GeoBoundingBox geo_bounding_box = 4; // Check if points geo location lies in a given area + GeoBoundingBox geo_bounding_box = 4; // Check if points geolocation lies in a given area GeoRadius geo_radius = 5; // Check if geo point is within a given radius ValuesCount values_count = 6; // Check number of values for a specific field } diff --git a/proto/points_service.proto b/proto/points_service.proto index 52a8f6e8..cc21e936 100644 --- a/proto/points_service.proto +++ b/proto/points_service.proto @@ -8,7 +8,7 @@ import "google/protobuf/struct.proto"; service Points { /* - Perform insert + updates on points. If point with given ID already exists - it will be overwritten. + Perform insert + updates on points. If a point with a given ID already exists - it will be overwritten. */ rpc Upsert (UpsertPoints) returns (PointsOperationResponse) {} /* @@ -67,4 +67,4 @@ service Points { Count points in collection with given filtering conditions */ rpc Count (CountPoints) returns (CountResponse) {} -} \ No newline at end of file +} diff --git a/src/client.rs b/src/client.rs index 4ecbbd49..dbd9bc52 100644 --- a/src/client.rs +++ b/src/client.rs @@ -9,7 +9,24 @@ use crate::qdrant::snapshots_client::SnapshotsClient; use crate::qdrant::value::Kind; use crate::qdrant::vectors::VectorsOptions; use crate::qdrant::with_payload_selector::SelectorOptions; -use crate::qdrant::{qdrant_client, with_vectors_selector, AliasOperations, ChangeAliases, ClearPayloadPoints, CollectionOperationResponse, Condition, CountPoints, CountResponse, CreateAlias, CreateCollection, CreateFieldIndexCollection, CreateFullSnapshotRequest, CreateSnapshotRequest, CreateSnapshotResponse, DeleteAlias, DeleteCollection, DeleteFieldIndexCollection, DeleteFullSnapshotRequest, DeletePayloadPoints, DeletePoints, DeleteSnapshotRequest, DeleteSnapshotResponse, FieldCondition, FieldType, Filter, GetCollectionInfoRequest, GetCollectionInfoResponse, GetPoints, GetResponse, HasIdCondition, HealthCheckReply, HealthCheckRequest, IsEmptyCondition, ListAliasesRequest, ListAliasesResponse, ListCollectionAliasesRequest, ListCollectionsRequest, ListCollectionsResponse, ListFullSnapshotsRequest, ListSnapshotsRequest, ListSnapshotsResponse, ListValue, NamedVectors, OptimizersConfigDiff, PayloadIncludeSelector, PayloadIndexParams, PointId, PointStruct, PointsIdsList, PointsOperationResponse, PointsSelector, RecommendBatchPoints, RecommendBatchResponse, RecommendPoints, RecommendResponse, RenameAlias, ScrollPoints, ScrollResponse, SearchBatchPoints, SearchBatchResponse, SearchPoints, SearchResponse, SetPayloadPoints, Struct, UpdateCollection, UpsertPoints, Value, Vector, Vectors, VectorsSelector, WithPayloadSelector, WithVectorsSelector, WriteOrdering, ReadConsistency}; +use crate::qdrant::{ + qdrant_client, with_vectors_selector, AliasOperations, ChangeAliases, ClearPayloadPoints, + CollectionOperationResponse, Condition, CountPoints, CountResponse, CreateAlias, + CreateCollection, CreateFieldIndexCollection, CreateFullSnapshotRequest, CreateSnapshotRequest, + CreateSnapshotResponse, DeleteAlias, DeleteCollection, DeleteFieldIndexCollection, + DeleteFullSnapshotRequest, DeletePayloadPoints, DeletePoints, DeleteSnapshotRequest, + DeleteSnapshotResponse, FieldCondition, FieldType, Filter, GetCollectionInfoRequest, + GetCollectionInfoResponse, GetPoints, GetResponse, HasIdCondition, HealthCheckReply, + HealthCheckRequest, IsEmptyCondition, ListAliasesRequest, ListAliasesResponse, + ListCollectionAliasesRequest, ListCollectionsRequest, ListCollectionsResponse, + ListFullSnapshotsRequest, ListSnapshotsRequest, ListSnapshotsResponse, ListValue, NamedVectors, + OptimizersConfigDiff, PayloadIncludeSelector, PayloadIndexParams, PointId, PointStruct, + PointsIdsList, PointsOperationResponse, PointsSelector, ReadConsistency, RecommendBatchPoints, + RecommendBatchResponse, RecommendPoints, RecommendResponse, RenameAlias, ScrollPoints, + ScrollResponse, SearchBatchPoints, SearchBatchResponse, SearchPoints, SearchResponse, + SetPayloadPoints, Struct, UpdateCollection, UpsertPoints, Value, Vector, Vectors, + VectorsSelector, WithPayloadSelector, WithVectorsSelector, WriteOrdering, +}; use anyhow::{bail, Result}; use std::collections::HashMap; use std::future::Future; @@ -30,7 +47,10 @@ pub struct QdrantClientConfig { impl QdrantClientConfig { pub fn from_url(url: &str) -> Self { - QdrantClientConfig { uri: url.to_string(), ..Self::default() } + QdrantClientConfig { + uri: url.to_string(), + ..Self::default() + } } pub fn set_api_key(&mut self, api_key: &str) { @@ -499,7 +519,8 @@ impl QdrantClient { points: Vec, ordering: Option, ) -> Result { - self._upsert_points(collection_name, &points, false, ordering).await + self._upsert_points(collection_name, &points, false, ordering) + .await } pub async fn upsert_points_blocking( @@ -508,7 +529,8 @@ impl QdrantClient { points: Vec, ordering: Option, ) -> Result { - self._upsert_points(collection_name, &points, true, ordering).await + self._upsert_points(collection_name, &points, true, ordering) + .await } #[inline] @@ -517,7 +539,7 @@ impl QdrantClient { collection_name: impl ToString, points: &Vec, block: bool, - ordering: Option + ordering: Option, ) -> Result { let collection_name = collection_name.to_string(); let collection_name_ref = collection_name.as_str(); @@ -554,7 +576,7 @@ impl QdrantClient { collection_name: impl ToString, points: &PointsSelector, payload: Payload, - ordering: Option + ordering: Option, ) -> Result { self._set_payload(collection_name, points, &payload, true, ordering) .await @@ -594,7 +616,7 @@ impl QdrantClient { collection_name: impl ToString, points: &PointsSelector, payload: Payload, - ordering: Option + ordering: Option, ) -> Result { self._overwrite_payload(collection_name, points, &payload, false, ordering) .await @@ -618,7 +640,7 @@ impl QdrantClient { points: &PointsSelector, payload: &Payload, block: bool, - ordering: Option + ordering: Option, ) -> Result { let collection_name = collection_name.to_string(); let collection_name_ref = collection_name.as_str(); @@ -800,7 +822,8 @@ impl QdrantClient { points: &PointsSelector, ordering: Option, ) -> Result { - self._delete_points(collection_name, false, points, ordering).await + self._delete_points(collection_name, false, points, ordering) + .await } pub async fn delete_points_blocking( @@ -809,7 +832,8 @@ impl QdrantClient { points: &PointsSelector, ordering: Option, ) -> Result { - self._delete_points(collection_name, true, points, ordering).await + self._delete_points(collection_name, true, points, ordering) + .await } async fn _delete_points( diff --git a/src/lib.rs b/src/lib.rs index 436c1b55..d787f385 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,6 +33,8 @@ mod tests { config: Some(Config::Params(VectorParams { size: 10, distance: Distance::Cosine.into(), + hnsw_config: None, + quantization_config: None, })), }), ..Default::default() @@ -92,13 +94,19 @@ mod tests { collection_name, &vec![0.into()].into(), vec!["sub_payload".to_string()], - None + None, ) .await?; // retrieve points let points = client - .get_points(collection_name, &vec![0.into()], Some(true), Some(true), None) + .get_points( + collection_name, + &vec![0.into()], + Some(true), + Some(true), + None, + ) .await?; assert_eq!(points.result.len(), 1); diff --git a/src/qdrant.rs b/src/qdrant.rs index 359a9702..34757e58 100644 --- a/src/qdrant.rs +++ b/src/qdrant.rs @@ -7,6 +7,12 @@ pub struct VectorParams { /// Distance function used for comparing vectors #[prost(enumeration = "Distance", tag = "2")] pub distance: i32, + /// Configuration of vector HNSW graph. If omitted - the collection configuration will be used + #[prost(message, optional, tag = "3")] + pub hnsw_config: ::core::option::Option, + /// Configuration of vector quantization config. If omitted - the collection configuration will be used + #[prost(message, optional, tag = "4")] + pub quantization_config: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -82,14 +88,14 @@ pub struct HnswConfigDiff { #[prost(uint64, optional, tag = "1")] pub m: ::core::option::Option, /// - /// Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index. + /// Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index. #[prost(uint64, optional, tag = "2")] pub ef_construct: ::core::option::Option, /// /// Minimal size (in KiloBytes) of vectors for additional payload-based indexing. - /// If payload chunk is smaller than `full_scan_threshold` additional indexing won't be used - + /// If the payload chunk is smaller than `full_scan_threshold` additional indexing won't be used - /// in this case full-scan search should be preferred by query planner and additional indexing is not required. - /// Note: 1Kb = 1 vector of size 256 + /// Note: 1 Kb = 1 vector of size 256 #[prost(uint64, optional, tag = "3")] pub full_scan_threshold: ::core::option::Option, /// @@ -97,7 +103,7 @@ pub struct HnswConfigDiff { #[prost(uint64, optional, tag = "4")] pub max_indexing_threads: ::core::option::Option, /// - /// Store HNSW index on disk. If set to false, index will be stored in RAM. + /// Store HNSW index on disk. If set to false, the index will be stored in RAM. #[prost(bool, optional, tag = "5")] pub on_disk: ::core::option::Option, /// @@ -127,13 +133,13 @@ pub struct OptimizersConfigDiff { #[prost(uint64, optional, tag = "2")] pub vacuum_min_vector_number: ::core::option::Option, /// - /// Target amount of segments optimizer will try to keep. + /// Target amount of segments the optimizer will try to keep. /// Real amount of segments may vary depending on multiple parameters: /// /// - Amount of stored points. /// - Current write RPS. /// - /// It is recommended to select default number of segments as a factor of the number of search threads, + /// It is recommended to select the default number of segments as a factor of the number of search threads, /// so that each segment would be handled evenly by one of the threads. #[prost(uint64, optional, tag = "3")] pub default_segment_number: ::core::option::Option, @@ -142,14 +148,14 @@ pub struct OptimizersConfigDiff { /// Large segments might require disproportionately long indexation times, /// therefore it makes sense to limit the size of segments. /// - /// If indexation speed have more priority for your - make this parameter lower. + /// If indexation speed has more priority for you - make this parameter lower. /// If search speed is more important - make this parameter higher. /// Note: 1Kb = 1 vector of size 256 #[prost(uint64, optional, tag = "4")] pub max_segment_size: ::core::option::Option, /// /// Maximum size (in KiloBytes) of vectors to store in-memory per segment. - /// Segments larger than this threshold will be stored as read-only memmaped file. + /// Segments larger than this threshold will be stored as a read-only memmaped file. /// To enable memmap storage, lower the threshold /// Note: 1Kb = 1 vector of size 256 #[prost(uint64, optional, tag = "5")] @@ -233,6 +239,7 @@ pub struct CreateCollection { /// Specify name of the other collection to copy data from #[prost(string, optional, tag = "13")] pub init_from_collection: ::core::option::Option<::prost::alloc::string::String>, + /// Quantization configuration of vector #[prost(message, optional, tag = "14")] pub quantization_config: ::core::option::Option, } @@ -326,7 +333,7 @@ pub struct TextIndexParams { /// Tokenizer type #[prost(enumeration = "TokenizerType", tag = "1")] pub tokenizer: i32, - /// If true - all tokens will be lowercased + /// If true - all tokens will be lowercase #[prost(bool, optional, tag = "2")] pub lowercase: ::core::option::Option, /// Minimal token length @@ -385,10 +392,8 @@ pub struct CollectionInfo { pub config: ::core::option::Option, /// Collection data types #[prost(map = "string, message", tag = "8")] - pub payload_schema: ::std::collections::HashMap< - ::prost::alloc::string::String, - PayloadSchemaInfo, - >, + pub payload_schema: + ::std::collections::HashMap<::prost::alloc::string::String, PayloadSchemaInfo>, /// number of points in the collection #[prost(uint64, tag = "9")] pub points_count: u64, @@ -647,8 +652,8 @@ impl TokenizerType { /// Generated client implementations. pub mod collections_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct CollectionsClient { inner: tonic::client::Grpc, @@ -692,9 +697,8 @@ pub mod collections_client { >::ResponseBody, >, >, - , - >>::Error: Into + Send + Sync, + >>::Error: + Into + Send + Sync, { CollectionsClient::new(InterceptedService::new(inner, interceptor)) } @@ -719,15 +723,12 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -738,15 +739,12 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -757,19 +755,14 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Collections/Create"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -778,19 +771,14 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Collections/Update"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -799,19 +787,14 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Collections/Delete"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -820,19 +803,14 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Collections/UpdateAliases"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -841,19 +819,15 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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/ListCollectionAliases", - ); + let path = + http::uri::PathAndQuery::from_static("/qdrant.Collections/ListCollectionAliases"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -862,19 +836,14 @@ pub mod collections_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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/ListAliases", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Collections/ListAliases"); self.inner.unary(request.into_request(), path, codec).await } } @@ -954,10 +923,7 @@ pub mod collections_server { send_compression_encodings: Default::default(), } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -985,10 +951,7 @@ pub mod collections_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -997,15 +960,11 @@ pub mod collections_server { "/qdrant.Collections/Get" => { #[allow(non_camel_case_types)] struct GetSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for GetSvc { + impl + tonic::server::UnaryService for GetSvc + { type Response = super::GetCollectionInfoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -1022,11 +981,10 @@ pub mod collections_server { 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 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) }; @@ -1035,15 +993,9 @@ pub mod collections_server { "/qdrant.Collections/List" => { #[allow(non_camel_case_types)] struct ListSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for ListSvc { + impl tonic::server::UnaryService for ListSvc { type Response = super::ListCollectionsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -1060,11 +1012,10 @@ pub mod collections_server { 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 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) }; @@ -1073,15 +1024,9 @@ pub mod collections_server { "/qdrant.Collections/Create" => { #[allow(non_camel_case_types)] struct CreateSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for CreateSvc { + impl tonic::server::UnaryService for CreateSvc { type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -1098,11 +1043,10 @@ pub mod collections_server { 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 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) }; @@ -1111,15 +1055,9 @@ pub mod collections_server { "/qdrant.Collections/Update" => { #[allow(non_camel_case_types)] struct UpdateSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for UpdateSvc { + impl tonic::server::UnaryService for UpdateSvc { type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -1136,11 +1074,10 @@ pub mod collections_server { 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 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) }; @@ -1149,15 +1086,9 @@ pub mod collections_server { "/qdrant.Collections/Delete" => { #[allow(non_camel_case_types)] struct DeleteSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for DeleteSvc { + impl tonic::server::UnaryService for DeleteSvc { type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -1174,11 +1105,10 @@ pub mod collections_server { 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 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) }; @@ -1187,23 +1117,15 @@ pub mod collections_server { "/qdrant.Collections/UpdateAliases" => { #[allow(non_camel_case_types)] struct UpdateAliasesSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for UpdateAliasesSvc { + impl tonic::server::UnaryService for UpdateAliasesSvc { type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).update_aliases(request).await - }; + let fut = async move { (*inner).update_aliases(request).await }; Box::pin(fut) } } @@ -1214,11 +1136,10 @@ pub mod collections_server { 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 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) }; @@ -1227,23 +1148,19 @@ pub mod collections_server { "/qdrant.Collections/ListCollectionAliases" => { #[allow(non_camel_case_types)] struct ListCollectionAliasesSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for ListCollectionAliasesSvc { + impl + tonic::server::UnaryService + for ListCollectionAliasesSvc + { type Response = super::ListAliasesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).list_collection_aliases(request).await - }; + let fut = + async move { (*inner).list_collection_aliases(request).await }; Box::pin(fut) } } @@ -1254,11 +1171,10 @@ pub mod collections_server { let inner = inner.0; let method = ListCollectionAliasesSvc(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 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) }; @@ -1267,23 +1183,15 @@ pub mod collections_server { "/qdrant.Collections/ListAliases" => { #[allow(non_camel_case_types)] struct ListAliasesSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for ListAliasesSvc { + impl tonic::server::UnaryService for ListAliasesSvc { type Response = super::ListAliasesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).list_aliases(request).await - }; + let fut = async move { (*inner).list_aliases(request).await }; Box::pin(fut) } } @@ -1294,28 +1202,23 @@ pub mod collections_server { let inner = inner.0; let method = ListAliasesSvc(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 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(), - ) - }) - } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), } } } @@ -1350,7 +1253,7 @@ pub mod collections_server { /// object. The details of that representation are described together /// with the proto support for the language. /// -/// The JSON representation for `Struct` is JSON object. +/// The JSON representation for `Struct` is a JSON object. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Struct { @@ -1360,10 +1263,10 @@ pub struct Struct { } /// `Value` represents a dynamically typed value which can be either /// null, a number, a string, a boolean, a recursive struct value, or a -/// list of values. A producer of value is expected to set one of that +/// list of values. A producer of value is expected to set one of those /// variants, absence of any variant indicates an error. /// -/// The JSON representation for `Value` is JSON value. +/// The JSON representation for `Value` is a JSON value. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Value { @@ -1402,7 +1305,7 @@ pub mod value { } /// `ListValue` is a wrapper around a repeated field of values. /// -/// The JSON representation for `ListValue` is JSON array. +/// The JSON representation for `ListValue` is a JSON array. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListValue { @@ -2035,7 +1938,7 @@ pub struct Filter { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Condition { - #[prost(oneof = "condition::ConditionOneOf", tags = "1, 2, 3, 4")] + #[prost(oneof = "condition::ConditionOneOf", tags = "1, 2, 3, 4, 5")] pub condition_one_of: ::core::option::Option, } /// Nested message and enum types in `Condition`. @@ -2051,6 +1954,8 @@ pub mod condition { HasId(super::HasIdCondition), #[prost(message, tag = "4")] Filter(super::Filter), + #[prost(message, tag = "5")] + IsNull(super::IsNullCondition), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -2061,6 +1966,12 @@ pub struct IsEmptyCondition { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct IsNullCondition { + #[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, @@ -2076,7 +1987,7 @@ pub struct FieldCondition { /// Check if points value lies in a given range #[prost(message, optional, tag = "3")] pub range: ::core::option::Option, - /// Check if points geo location lies in a given area + /// Check if points geolocation lies in a given area #[prost(message, optional, tag = "4")] pub geo_bounding_box: ::core::option::Option, /// Check if geo point is within a given radius @@ -2177,9 +2088,7 @@ pub struct ValuesCount { #[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 points_selector_one_of: ::core::option::Option, } /// Nested message and enum types in `PointsSelector`. pub mod points_selector { @@ -2349,8 +2258,8 @@ impl UpdateStatus { /// Generated client implementations. pub mod points_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct PointsClient { inner: tonic::client::Grpc, @@ -2394,9 +2303,8 @@ pub mod points_client { >::ResponseBody, >, >, - , - >>::Error: Into + Send + Sync, + >>::Error: + Into + Send + Sync, { PointsClient::new(InterceptedService::new(inner, interceptor)) } @@ -2416,20 +2324,17 @@ pub mod points_client { self } /// - /// Perform insert + updates on points. If point with given ID already exists - it will be overwritten. + /// Perform insert + updates on points. If a point with a given ID already exists - it will be overwritten. pub async fn upsert( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2440,15 +2345,12 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2459,15 +2361,12 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2478,15 +2377,12 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2497,19 +2393,14 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Points/OverwritePayload"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -2518,19 +2409,14 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Points/DeletePayload"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -2539,19 +2425,14 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Points/ClearPayload"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -2560,19 +2441,14 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Points/CreateFieldIndex"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -2581,19 +2457,14 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Points/DeleteFieldIndex"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -2602,15 +2473,12 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2621,19 +2489,14 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Points/SearchBatch"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -2642,15 +2505,12 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2661,15 +2521,12 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2680,19 +2537,14 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Points/RecommendBatch"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -2701,15 +2553,12 @@ pub mod points_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -2724,7 +2573,7 @@ pub mod points_server { #[async_trait] pub trait Points: Send + Sync + 'static { /// - /// Perform insert + updates on points. If point with given ID already exists - it will be overwritten. + /// Perform insert + updates on points. If a point with a given ID already exists - it will be overwritten. async fn upsert( &self, request: tonic::Request, @@ -2833,10 +2682,7 @@ pub mod points_server { send_compression_encodings: Default::default(), } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -2864,10 +2710,7 @@ pub mod points_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -2876,13 +2719,9 @@ pub mod points_server { "/qdrant.Points/Upsert" => { #[allow(non_camel_case_types)] struct UpsertSvc(pub Arc); - impl tonic::server::UnaryService - for UpsertSvc { + impl tonic::server::UnaryService for UpsertSvc { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -2899,11 +2738,10 @@ pub mod points_server { 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 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) }; @@ -2912,13 +2750,9 @@ pub mod points_server { "/qdrant.Points/Delete" => { #[allow(non_camel_case_types)] struct DeleteSvc(pub Arc); - impl tonic::server::UnaryService - for DeleteSvc { + impl tonic::server::UnaryService for DeleteSvc { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -2935,11 +2769,10 @@ pub mod points_server { 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 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) }; @@ -2948,13 +2781,9 @@ pub mod points_server { "/qdrant.Points/Get" => { #[allow(non_camel_case_types)] struct GetSvc(pub Arc); - impl tonic::server::UnaryService - for GetSvc { + impl tonic::server::UnaryService for GetSvc { type Response = super::GetResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -2971,11 +2800,10 @@ pub mod points_server { 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 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) }; @@ -2984,13 +2812,9 @@ pub mod points_server { "/qdrant.Points/SetPayload" => { #[allow(non_camel_case_types)] struct SetPayloadSvc(pub Arc); - impl tonic::server::UnaryService - for SetPayloadSvc { + impl tonic::server::UnaryService for SetPayloadSvc { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3007,11 +2831,10 @@ pub mod points_server { 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 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) }; @@ -3020,21 +2843,15 @@ pub mod points_server { "/qdrant.Points/OverwritePayload" => { #[allow(non_camel_case_types)] struct OverwritePayloadSvc(pub Arc); - impl tonic::server::UnaryService - for OverwritePayloadSvc { + impl tonic::server::UnaryService for OverwritePayloadSvc { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).overwrite_payload(request).await - }; + let fut = async move { (*inner).overwrite_payload(request).await }; Box::pin(fut) } } @@ -3045,11 +2862,10 @@ pub mod points_server { 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 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) }; @@ -3058,23 +2874,15 @@ pub mod points_server { "/qdrant.Points/DeletePayload" => { #[allow(non_camel_case_types)] struct DeletePayloadSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for DeletePayloadSvc { + impl tonic::server::UnaryService for DeletePayloadSvc { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).delete_payload(request).await - }; + let fut = async move { (*inner).delete_payload(request).await }; Box::pin(fut) } } @@ -3085,11 +2893,10 @@ pub mod points_server { 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 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) }; @@ -3098,23 +2905,15 @@ pub mod points_server { "/qdrant.Points/ClearPayload" => { #[allow(non_camel_case_types)] struct ClearPayloadSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for ClearPayloadSvc { + impl tonic::server::UnaryService for ClearPayloadSvc { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).clear_payload(request).await - }; + let fut = async move { (*inner).clear_payload(request).await }; Box::pin(fut) } } @@ -3125,11 +2924,10 @@ pub mod points_server { 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 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) }; @@ -3138,23 +2936,17 @@ pub mod points_server { "/qdrant.Points/CreateFieldIndex" => { #[allow(non_camel_case_types)] struct CreateFieldIndexSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for CreateFieldIndexSvc { + impl tonic::server::UnaryService + for CreateFieldIndexSvc + { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).create_field_index(request).await - }; + let fut = async move { (*inner).create_field_index(request).await }; Box::pin(fut) } } @@ -3165,11 +2957,10 @@ pub mod points_server { 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 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) }; @@ -3178,23 +2969,17 @@ pub mod points_server { "/qdrant.Points/DeleteFieldIndex" => { #[allow(non_camel_case_types)] struct DeleteFieldIndexSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for DeleteFieldIndexSvc { + impl tonic::server::UnaryService + for DeleteFieldIndexSvc + { type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).delete_field_index(request).await - }; + let fut = async move { (*inner).delete_field_index(request).await }; Box::pin(fut) } } @@ -3205,11 +2990,10 @@ pub mod points_server { 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 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) }; @@ -3218,13 +3002,9 @@ pub mod points_server { "/qdrant.Points/Search" => { #[allow(non_camel_case_types)] struct SearchSvc(pub Arc); - impl tonic::server::UnaryService - for SearchSvc { + impl tonic::server::UnaryService for SearchSvc { type Response = super::SearchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3241,11 +3021,10 @@ pub mod points_server { 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 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) }; @@ -3254,21 +3033,15 @@ pub mod points_server { "/qdrant.Points/SearchBatch" => { #[allow(non_camel_case_types)] struct SearchBatchSvc(pub Arc); - impl tonic::server::UnaryService - for SearchBatchSvc { + impl tonic::server::UnaryService for SearchBatchSvc { type Response = super::SearchBatchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).search_batch(request).await - }; + let fut = async move { (*inner).search_batch(request).await }; Box::pin(fut) } } @@ -3279,11 +3052,10 @@ pub mod points_server { 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 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) }; @@ -3292,13 +3064,9 @@ pub mod points_server { "/qdrant.Points/Scroll" => { #[allow(non_camel_case_types)] struct ScrollSvc(pub Arc); - impl tonic::server::UnaryService - for ScrollSvc { + impl tonic::server::UnaryService for ScrollSvc { type Response = super::ScrollResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3315,11 +3083,10 @@ pub mod points_server { 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 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) }; @@ -3328,13 +3095,9 @@ pub mod points_server { "/qdrant.Points/Recommend" => { #[allow(non_camel_case_types)] struct RecommendSvc(pub Arc); - impl tonic::server::UnaryService - for RecommendSvc { + impl tonic::server::UnaryService for RecommendSvc { type Response = super::RecommendResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3351,11 +3114,10 @@ pub mod points_server { 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 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) }; @@ -3364,23 +3126,15 @@ pub mod points_server { "/qdrant.Points/RecommendBatch" => { #[allow(non_camel_case_types)] struct RecommendBatchSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for RecommendBatchSvc { + impl tonic::server::UnaryService for RecommendBatchSvc { type Response = super::RecommendBatchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).recommend_batch(request).await - }; + let fut = async move { (*inner).recommend_batch(request).await }; Box::pin(fut) } } @@ -3391,11 +3145,10 @@ pub mod points_server { 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 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) }; @@ -3404,13 +3157,9 @@ pub mod points_server { "/qdrant.Points/Count" => { #[allow(non_camel_case_types)] struct CountSvc(pub Arc); - impl tonic::server::UnaryService - for CountSvc { + impl tonic::server::UnaryService for CountSvc { type Response = super::CountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3427,28 +3176,23 @@ pub mod points_server { 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 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(), - ) - }) - } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), } } } @@ -3554,8 +3298,8 @@ pub struct DeleteSnapshotResponse { /// Generated client implementations. pub mod snapshots_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct SnapshotsClient { inner: tonic::client::Grpc, @@ -3599,9 +3343,8 @@ pub mod snapshots_client { >::ResponseBody, >, >, - , - >>::Error: Into + Send + Sync, + >>::Error: + Into + Send + Sync, { SnapshotsClient::new(InterceptedService::new(inner, interceptor)) } @@ -3626,15 +3369,12 @@ pub mod snapshots_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -3645,15 +3385,12 @@ pub mod snapshots_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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 @@ -3664,15 +3401,12 @@ pub mod snapshots_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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/Delete"); self.inner.unary(request.into_request(), path, codec).await @@ -3683,19 +3417,14 @@ pub mod snapshots_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Snapshots/CreateFull"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -3704,19 +3433,14 @@ pub mod snapshots_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Snapshots/ListFull"); self.inner.unary(request.into_request(), path, codec).await } /// @@ -3725,19 +3449,14 @@ pub mod snapshots_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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/DeleteFull", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Snapshots/DeleteFull"); self.inner.unary(request.into_request(), path, codec).await } } @@ -3805,10 +3524,7 @@ pub mod snapshots_server { send_compression_encodings: Default::default(), } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -3836,10 +3552,7 @@ pub mod snapshots_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -3848,15 +3561,9 @@ pub mod snapshots_server { "/qdrant.Snapshots/Create" => { #[allow(non_camel_case_types)] struct CreateSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for CreateSvc { + impl tonic::server::UnaryService for CreateSvc { type Response = super::CreateSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3873,11 +3580,10 @@ pub mod snapshots_server { 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 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) }; @@ -3886,15 +3592,9 @@ pub mod snapshots_server { "/qdrant.Snapshots/List" => { #[allow(non_camel_case_types)] struct ListSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for ListSvc { + impl tonic::server::UnaryService for ListSvc { type Response = super::ListSnapshotsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3911,11 +3611,10 @@ pub mod snapshots_server { 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 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) }; @@ -3924,15 +3623,9 @@ pub mod snapshots_server { "/qdrant.Snapshots/Delete" => { #[allow(non_camel_case_types)] struct DeleteSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for DeleteSvc { + impl tonic::server::UnaryService for DeleteSvc { type Response = super::DeleteSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3949,11 +3642,10 @@ pub mod snapshots_server { 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 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) }; @@ -3962,15 +3654,11 @@ pub mod snapshots_server { "/qdrant.Snapshots/CreateFull" => { #[allow(non_camel_case_types)] struct CreateFullSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for CreateFullSvc { + impl tonic::server::UnaryService + for CreateFullSvc + { type Response = super::CreateSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -3987,11 +3675,10 @@ pub mod snapshots_server { 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 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) }; @@ -4000,15 +3687,9 @@ pub mod snapshots_server { "/qdrant.Snapshots/ListFull" => { #[allow(non_camel_case_types)] struct ListFullSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for ListFullSvc { + impl tonic::server::UnaryService for ListFullSvc { type Response = super::ListSnapshotsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -4025,11 +3706,10 @@ pub mod snapshots_server { 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 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) }; @@ -4038,15 +3718,11 @@ pub mod snapshots_server { "/qdrant.Snapshots/DeleteFull" => { #[allow(non_camel_case_types)] struct DeleteFullSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for DeleteFullSvc { + impl tonic::server::UnaryService + for DeleteFullSvc + { type Response = super::DeleteSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, @@ -4063,28 +3739,23 @@ pub mod snapshots_server { let inner = inner.0; let method = DeleteFullSvc(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 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(), - ) - }) - } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), } } } @@ -4126,8 +3797,8 @@ pub struct HealthCheckReply { /// Generated client implementations. pub mod qdrant_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct QdrantClient { inner: tonic::client::Grpc, @@ -4171,9 +3842,8 @@ pub mod qdrant_client { >::ResponseBody, >, >, - , - >>::Error: Into + Send + Sync, + >>::Error: + Into + Send + Sync, { QdrantClient::new(InterceptedService::new(inner, interceptor)) } @@ -4196,19 +3866,14 @@ pub mod qdrant_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + 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", - ); + let path = http::uri::PathAndQuery::from_static("/qdrant.Qdrant/HealthCheck"); self.inner.unary(request.into_request(), path, codec).await } } @@ -4244,10 +3909,7 @@ pub mod qdrant_server { send_compression_encodings: Default::default(), } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -4275,10 +3937,7 @@ pub mod qdrant_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -4287,23 +3946,15 @@ pub mod qdrant_server { "/qdrant.Qdrant/HealthCheck" => { #[allow(non_camel_case_types)] struct HealthCheckSvc(pub Arc); - impl< - T: Qdrant, - > tonic::server::UnaryService - for HealthCheckSvc { + impl tonic::server::UnaryService for HealthCheckSvc { type Response = super::HealthCheckReply; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); - let fut = async move { - (*inner).health_check(request).await - }; + let fut = async move { (*inner).health_check(request).await }; Box::pin(fut) } } @@ -4314,28 +3965,23 @@ pub mod qdrant_server { 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 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(), - ) - }) - } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), } } } From 73a7bd036ea2d57b82775b0ec5789424cdefc446 Mon Sep 17 00:00:00 2001 From: Arnaud Gourlay Date: Tue, 11 Apr 2023 14:59:26 +0200 Subject: [PATCH 3/4] bump Docker version --- tests/integration-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration-tests.sh b/tests/integration-tests.sh index beb17deb..a1decd38 100755 --- a/tests/integration-tests.sh +++ b/tests/integration-tests.sh @@ -11,7 +11,7 @@ function stop_docker() # Ensure current path is project root cd "$(dirname "$0")/../" -QDRANT_VERSION='v1.1.0' +QDRANT_VERSION='v1.1.1' QDRANT_HOST='localhost:6333' From 356efc67de546bfa5dac0d1ac88c07bf96c9c405 Mon Sep 17 00:00:00 2001 From: Arnaud Gourlay Date: Tue, 11 Apr 2023 15:05:23 +0200 Subject: [PATCH 4/4] bump crate version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 17558692..de2d63e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "qdrant-client" -version = "1.1.0" +version = "1.1.1" edition = "2021" authors = ["Qdrant Team "] description = "Rust client for Qdrant Vector Search Engine"