diff --git a/.gitignore b/.gitignore index 9d724a1..26f1e02 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,6 @@ crates/target # qdrant .qdrant-initialized storage -snapshots \ No newline at end of file +snapshots + +.DS_Store \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 76eeaf9..8c9dad0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5669 +3,303 @@ version = 3 [[package]] -name = "actix-codec" -version = "0.5.1" +name = "aho-corasick" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-sink", "memchr", - "pin-project-lite", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "actix-cors" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b340e9cfa5b08690aae90fb61beb44e9b06f44fe3d0f93781aaa58cfba86245e" -dependencies = [ - "actix-utils", - "actix-web", - "derive_more", - "futures-util", - "log", - "once_cell", - "smallvec", -] - -[[package]] -name = "actix-files" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d832782fac6ca7369a70c9ee9a20554623c5e51c76e190ad151780ebea1cf689" -dependencies = [ - "actix-http", - "actix-service", - "actix-utils", - "actix-web", - "askama_escape", - "bitflags 1.3.2", - "bytes", - "derive_more", - "futures-core", - "http-range", - "log", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", -] - -[[package]] -name = "actix-http" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92ef85799cba03f76e4f7c10f533e66d87c9a7e7055f3391f09000ad8351bc9" -dependencies = [ - "actix-codec", - "actix-rt", - "actix-service", - "actix-tls", - "actix-utils", - "ahash 0.8.3", - "base64 0.21.3", - "bitflags 2.4.0", - "brotli", - "bytes", - "bytestring", - "derive_more", - "encoding_rs", - "flate2", - "futures-core", - "h2", - "http", - "httparse", - "httpdate", - "itoa", - "language-tags", - "local-channel", - "mime", - "percent-encoding", - "pin-project-lite", - "rand 0.8.5", - "sha1", - "smallvec", - "tokio", - "tokio-util", - "tracing", - "zstd 0.12.4", -] - -[[package]] -name = "actix-macros" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" -dependencies = [ - "quote", - "syn 2.0.29", ] [[package]] -name = "actix-multipart" -version = "0.6.1" +name = "bstr" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b960e2aea75f49c8f069108063d12a48d329fc8b60b786dfc7552a9d5918d2d" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" dependencies = [ - "actix-multipart-derive", - "actix-utils", - "actix-web", - "bytes", - "derive_more", - "futures-core", - "futures-util", - "httparse", - "local-waker", - "log", "memchr", - "mime", - "serde", - "serde_json", - "serde_plain", - "tempfile", - "tokio", -] - -[[package]] -name = "actix-multipart-derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0a77f836d869f700e5b47ac7c3c8b9c8bc82e4aec861954c6198abee3ebd4d" -dependencies = [ - "darling", - "parse-size", - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "actix-router" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" -dependencies = [ - "bytestring", - "http", - "regex", "serde", - "tracing", -] - -[[package]] -name = "actix-rt" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" -dependencies = [ - "futures-core", - "tokio", ] [[package]] -name = "actix-server" -version = "2.3.0" +name = "cc" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb13e7eef0423ea6eab0e59f6c72e7cb46d33691ad56a726b3cd07ddec2c2d4" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "actix-rt", - "actix-service", - "actix-utils", - "futures-core", - "futures-util", - "mio", - "socket2 0.5.3", - "tokio", - "tracing", + "libc", ] [[package]] -name = "actix-service" -version = "2.0.2" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" -dependencies = [ - "futures-core", - "paste", - "pin-project-lite", -] +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "actix-tls" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72616e7fbec0aa99c6f3164677fa48ff5a60036d0799c98cab894a44f3e0efc3" +name = "codeindex" +version = "0.1.0" dependencies = [ - "actix-rt", - "actix-service", - "actix-utils", - "futures-core", - "impl-more", - "pin-project-lite", - "rustls 0.21.7", - "rustls-webpki 0.101.4", - "tokio", - "tokio-rustls 0.23.4", - "tokio-util", - "tracing", - "webpki-roots 0.22.6", + "ignore", + "tree-sitter", + "tree-sitter-javascript", + "tree-sitter-python", + "tree-sitter-rust", + "tree-sitter-typescript", ] [[package]] -name = "actix-utils" -version = "3.0.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" -dependencies = [ - "local-waker", - "pin-project-lite", -] +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "actix-web" -version = "4.4.0" +name = "globset" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4a5b5e29603ca8c94a77c65cf874718ceb60292c5a5c3e5f4ace041af462b9" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ - "actix-codec", - "actix-http", - "actix-macros", - "actix-router", - "actix-rt", - "actix-server", - "actix-service", - "actix-tls", - "actix-utils", - "actix-web-codegen", - "ahash 0.8.3", - "bytes", - "bytestring", - "cfg-if", - "cookie", - "derive_more", - "encoding_rs", - "futures-core", - "futures-util", - "itoa", - "language-tags", + "aho-corasick", + "bstr", + "fnv", "log", - "mime", - "once_cell", - "pin-project-lite", "regex", - "serde", - "serde_json", - "serde_urlencoded", - "smallvec", - "socket2 0.5.3", - "time 0.3.28", - "url", -] - -[[package]] -name = "actix-web-codegen" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5" -dependencies = [ - "actix-router", - "proc-macro2", - "quote", - "syn 2.0.29", ] [[package]] -name = "actix-web-validator" -version = "5.0.1" +name = "ignore" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ee5ed4e266dad8d980f964c5ddd746f1f4f85b7f3b54f7099ab861ec6d746" +checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" dependencies = [ - "actix-http", - "actix-router", - "actix-web", - "bytes", - "futures", - "futures-util", + "globset", + "lazy_static", "log", - "mime", - "serde", - "serde_json", - "serde_qs", - "serde_urlencoded", - "thiserror", - "validator", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aes" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.10", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "getrandom 0.2.10", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" -dependencies = [ "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", ] [[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "anes" -version = "0.1.6" +name = "libc" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] -name = "anstream" -version = "0.5.0" +name = "log" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] -name = "anstyle" -version = "1.0.2" +name = "memchr" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] -name = "anstyle-parse" -version = "0.2.1" +name = "once_cell" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "anstyle-query" -version = "1.0.0" +name = "proc-macro2" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ - "windows-sys 0.48.0", + "unicode-ident", ] [[package]] -name = "anstyle-wincon" -version = "2.1.0" +name = "quote" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "anstyle", - "windows-sys 0.48.0", + "proc-macro2", ] [[package]] -name = "anyhow" -version = "1.0.75" +name = "regex" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[package]] -name = "api" -version = "1.4.1" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ - "chrono", - "env_logger", - "log", - "parking_lot", - "prost", - "prost-build", - "prost-types", - "rand 0.8.5", - "schemars", - "segment", - "serde", - "serde_json", - "thiserror", - "tokio", - "tonic", - "tonic-build", - "tower", - "uuid", - "validator", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "approx" -version = "0.5.1" +name = "regex-automata" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ - "num-traits", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "arc-swap" -version = "1.6.0" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] -name = "arrayvec" -version = "0.4.12" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "nodrop", + "winapi-util", ] [[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "askama_escape" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" - -[[package]] -name = "async-stream" -version = "0.3.5" +name = "serde" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", + "serde_derive", ] [[package]] -name = "async-stream-impl" -version = "0.3.5" +name = "serde_derive" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn", ] [[package]] -name = "async-trait" -version = "0.1.73" +name = "syn" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "unicode-ident", ] [[package]] -name = "atomic-polyfill" -version = "0.1.11" +name = "thread_local" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "critical-section", + "cfg-if", + "once_cell", ] [[package]] -name = "atomic_refcell" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112ef6b3f6cb3cb6fc5b6b494ef7a848492cff1ab0ef4de10b0f7d572861c905" - -[[package]] -name = "atomicwrites" -version = "0.4.1" +name = "tree-sitter" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1163d9d7c51de51a2b79d6df5e8888d11e9df17c752ce4a285fb6ca1580734e" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" dependencies = [ - "rustix 0.37.23", - "tempfile", - "windows-sys 0.48.0", + "cc", + "regex", ] [[package]] -name = "atty" -version = "0.2.14" +name = "tree-sitter-javascript" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "edbc663376bdd294bd1f0a6daf859aedb9aa5bdb72217d7ad8ba2d5314102cf7" dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "cc", + "tree-sitter", ] [[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "axum" -version = "0.6.20" +name = "tree-sitter-python" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "e6c93b1b1fbd0d399db3445f51fd3058e43d0b4dcff62ddbdb46e66550978aa5" dependencies = [ - "async-trait", - "axum-core", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-layer", - "tower-service", + "cc", + "tree-sitter", ] [[package]] -name = "axum-core" -version = "0.3.4" +name = "tree-sitter-rust" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "b0832309b0b2b6d33760ce5c0e818cb47e1d72b468516bfe4134408926fa7594" dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", + "cc", + "tree-sitter", ] [[package]] -name = "backtrace" -version = "0.3.69" +name = "tree-sitter-typescript" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "a75049f0aafabb2aac205d7bb24da162b53dcd0cfb326785f25a2f32efa8071a" dependencies = [ - "addr2line", "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "tree-sitter", ] [[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.3" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "base64ct" -version = "1.6.0" +name = "walkdir" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] -name = "bincode" -version = "1.3.3" +name = "winapi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "serde", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] -name = "bindgen" -version = "0.65.1" +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" -dependencies = [ - "bitflags 1.3.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "prettyplease 0.2.12", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.29", -] +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] -name = "bit-set" -version = "0.5.3" +name = "winapi-util" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2-rfc" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" -dependencies = [ - "arrayvec 0.4.12", - "constant_time_eq 0.1.5", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "brotli" -version = "3.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "bytemuck" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" - -[[package]] -name = "bytestring" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" -dependencies = [ - "bytes", -] - -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cedarwood" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d910bedd62c24733263d0bed247460853c9d22e8956bd4cd964302095e04e90" -dependencies = [ - "smallvec", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cgroups-rs" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb3af90c8d48ad5f432d8afb521b5b40c2a2fce46dd60e05912de51c47fba64" -dependencies = [ - "libc", - "log", - "nix 0.25.1", - "regex", - "thiserror", -] - -[[package]] -name = "charabia" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "098219a776307414866165a03a9cc68c1578764fe3616fe979e1c280790ddd73" -dependencies = [ - "aho-corasick", - "cow-utils", - "csv", - "deunicode", - "either", - "fst", - "irg-kvariants", - "jieba-rs", - "lindera-core", - "lindera-dictionary", - "lindera-tokenizer", - "once_cell", - "pinyin", - "serde", - "slice-group-by", - "unicode-normalization", - "whatlang", -] - -[[package]] -name = "chrono" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56b4c72906975ca04becb8a30e102dfecddd0c06181e3e95ddc444be28881f8" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "time 0.1.45", - "wasm-bindgen", - "windows-targets 0.48.5", -] - -[[package]] -name = "ciborium" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" - -[[package]] -name = "ciborium-ll" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "clang-sys" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "4.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c8d502cbaec4595d2e7d5f61e318f05417bd2b66fdc3809498f0d3fdf0bea27" -dependencies = [ - "clap_builder", - "clap_derive", - "once_cell", -] - -[[package]] -name = "clap_builder" -version = "4.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5891c7bc0edb3e1c2204fc5e94009affabeb1821c9e5fdc3959536c5c0bb984d" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "clap_lex" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" - -[[package]] -name = "codeindex" -version = "0.1.0" -dependencies = [ - "axum", - "cc", - "codeindex_common", - "colored", - "log", - "qdrant", - "redis", - "serde", - "serde_json", - "tokio", - "tree-sitter", - "tree-sitter-javascript", - "tree-sitter-python", - "tree-sitter-rust", - "tree-sitter-typescript", -] - -[[package]] -name = "codeindex_common" -version = "0.1.0" -dependencies = [ - "atty", - "git2", -] - -[[package]] -name = "collection" -version = "0.4.2" -dependencies = [ - "actix-web-validator", - "api", - "arc-swap", - "async-trait", - "atomicwrites", - "chrono", - "common", - "criterion", - "env_logger", - "fs_extra", - "futures", - "hashring", - "indicatif", - "itertools 0.11.0", - "log", - "merge", - "num_cpus", - "ordered-float 3.9.1", - "parking_lot", - "pprof", - "rand 0.8.5", - "rmp-serde", - "rstest", - "schemars", - "segment", - "semver", - "serde", - "serde_cbor", - "serde_json", - "tar", - "tempfile", - "thiserror", - "tinyvec", - "tokio", - "tonic", - "tower", - "url", - "uuid", - "validator", - "wal", -] - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "colored" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" -dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "combine" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" -dependencies = [ - "bytes", - "futures-core", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util", -] - -[[package]] -name = "common" -version = "0.1.0" -dependencies = [ - "serde", -] - -[[package]] -name = "config" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" -dependencies = [ - "async-trait", - "json5", - "lazy_static", - "nom", - "pathdiff", - "ron", - "rust-ini", - "serde", - "serde_json", - "toml", - "yaml-rust", -] - -[[package]] -name = "console" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.45.0", -] - -[[package]] -name = "console-api" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" -dependencies = [ - "prost", - "prost-types", - "tonic", - "tracing-core", -] - -[[package]] -name = "console-subscriber" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" -dependencies = [ - "console-api", - "crossbeam-channel", - "crossbeam-utils", - "futures", - "hdrhistogram", - "humantime", - "parking_lot", - "prost-types", - "serde", - "serde_json", - "thread_local", - "tokio", - "tokio-stream", - "tonic", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "cookie" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" -dependencies = [ - "percent-encoding", - "time 0.3.28", - "version_check", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "cow-utils" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79bb3adfaf5f75d24b01aee375f7555907840fa2800e5ec8fa3b9e2031830173" - -[[package]] -name = "cpp_demangle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "cpufeatures" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" - -[[package]] -name = "crc16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools 0.10.5", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] - -[[package]] -name = "critical-section" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "csv" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - -[[package]] -name = "darling" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.29", -] - -[[package]] -name = "darling_macro" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "debugid" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" -dependencies = [ - "uuid", -] - -[[package]] -name = "deranged" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.109", -] - -[[package]] -name = "deunicode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1bba4f227a4a53d12b653f50ca7bf10c9119ae2aba56aff9e0338b5c98f36a" - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "dlv-list" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" - -[[package]] -name = "docopt" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f3f119846c823f9eafcf953a8f6ffb6ed69bf6240883261a7f13b634579a51f" -dependencies = [ - "lazy_static", - "regex", - "serde", - "strsim", -] - -[[package]] -name = "dyn-clone" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" - -[[package]] -name = "earcutr" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0812b44697951d35fde8fcb0da81c9de7e809e825a66bbf1ecb79d9829d4ca3d" -dependencies = [ - "itertools 0.10.5", - "num-traits", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" -dependencies = [ - "encoding-index-japanese", - "encoding-index-korean", - "encoding-index-simpchinese", - "encoding-index-singlebyte", - "encoding-index-tradchinese", -] - -[[package]] -name = "encoding-index-japanese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-korean" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-simpchinese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-singlebyte" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-tradchinese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding_index_tests" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "encoding_rs_io" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cc3c5651fb62ab8aa3103998dade57efdd028544bd300516baa31840c252a83" -dependencies = [ - "encoding_rs", -] - -[[package]] -name = "env_logger" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - -[[package]] -name = "filetime" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", -] - -[[package]] -name = "findshlibs" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" -dependencies = [ - "cc", - "lazy_static", - "libc", - "winapi", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "float_next_after" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs4" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" -dependencies = [ - "rustix 0.38.10", - "windows-sys 0.48.0", -] - -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - -[[package]] -name = "fst" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "futures-task" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generator" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" -dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "windows", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "geo" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1645cf1d7fea7dac1a66f7357f3df2677ada708b8d9db8e9b043878930095a96" -dependencies = [ - "earcutr", - "float_next_after", - "geo-types", - "geographiclib-rs", - "log", - "num-traits", - "robust", - "rstar", -] - -[[package]] -name = "geo-types" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9705398c5c7b26132e74513f4ee7c1d7dafd786004991b375c172be2be0eecaa" -dependencies = [ - "approx", - "num-traits", - "rstar", - "serde", -] - -[[package]] -name = "geographiclib-rs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea804e7bd3c6a4ca6a01edfa35231557a8a81d4d3f3e1e2b650d028c42592be" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "geohash" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18b809b13fa4f1c9ccfd94179cc429021a3517856b5160422c3d810c1e8546" -dependencies = [ - "geo-types", - "libm", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - -[[package]] -name = "git2" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ef350ba88a33b4d524b1d1c79096c9ade5ef8c59395df0e60d1e1889414c0e" -dependencies = [ - "bitflags 2.4.0", - "libc", - "libgit2-sys", - "log", - "openssl-probe", - "openssl-sys", - "url", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "h2" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 1.9.3", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - -[[package]] -name = "hashring" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c499ff70b6f65833dd5961abe0464eb295ec69993ba3ab0066f42be4fbb98b85" -dependencies = [ - "siphasher", -] - -[[package]] -name = "hdrhistogram" -version = "7.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" -dependencies = [ - "base64 0.13.1", - "byteorder", - "flate2", - "nom", - "num-traits", -] - -[[package]] -name = "heapless" -version = "0.7.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" -dependencies = [ - "atomic-polyfill", - "hash32", - "rustc_version", - "spin 0.9.8", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "http" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "http-range" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.4.9", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls 0.21.7", - "tokio", - "tokio-rustls 0.24.1", -] - -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "if_chain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" - -[[package]] -name = "impl-more" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "indicatif" -version = "0.17.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - -[[package]] -name = "inferno" -version = "0.11.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c0fefcb6d409a6587c07515951495d482006f89a21daa0f2f783aa4fd5e027" -dependencies = [ - "ahash 0.8.3", - "indexmap 2.0.0", - "is-terminal", - "itoa", - "log", - "num-format", - "once_cell", - "quick-xml", - "rgb", - "str_stack", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.2", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "io-uring" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141a0f4546a50b2ed637c7a6df0d7dff45c9f41523254996764461c8ae0d9424" -dependencies = [ - "bitflags 1.3.2", - "libc", -] - -[[package]] -name = "ipnet" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" - -[[package]] -name = "irg-kvariants" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c73214298363629cf9dbfc93b426808865ee3c121029778cb31b1284104fdf78" -dependencies = [ - "csv", - "once_cell", - "serde", -] - -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.10", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "jieba-rs" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f0c1347cd3ac8d7c6e3a2dc33ac496d365cf09fc0831aa61111e1a6738983e" -dependencies = [ - "cedarwood", - "fxhash", - "hashbrown 0.14.0", - "lazy_static", - "phf", - "phf_codegen", - "regex", -] - -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json5" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" -dependencies = [ - "pest", - "pest_derive", - "serde", -] - -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "libgit2-sys" -version = "0.16.1+1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" -dependencies = [ - "cc", - "libc", - "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -] - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - -[[package]] -name = "librocksdb-sys" -version = "0.11.0+8.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" -dependencies = [ - "bindgen", - "bzip2-sys", - "cc", - "glob", - "libc", - "libz-sys", -] - -[[package]] -name = "libssh2-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "libz-sys" -version = "1.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "lindera-cc-cedict-builder" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2e8f2ca97ddf952fe340642511b9c14b373cb2eef711d526bb8ef2ca0969b8" -dependencies = [ - "anyhow", - "bincode", - "byteorder", - "csv", - "encoding", - "env_logger", - "glob", - "lindera-core", - "lindera-decompress", - "log", - "yada", -] - -[[package]] -name = "lindera-compress" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f3e553d55ebe9881fa5e5de588b0a153456e93564d17dfbef498912caf63a2" -dependencies = [ - "anyhow", - "flate2", - "lindera-decompress", -] - -[[package]] -name = "lindera-core" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f586eb8a9393c32d5525e0e9336a3727bd1329674740097126f3b0bff8a1a1ea" -dependencies = [ - "anyhow", - "bincode", - "byteorder", - "encoding_rs", - "log", - "once_cell", - "serde", - "thiserror", - "yada", -] - -[[package]] -name = "lindera-decompress" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e077a410e61c962cb526f71b7effd62ffc607488a8f61869c937582d2ccb529b" -dependencies = [ - "anyhow", - "flate2", - "serde", -] - -[[package]] -name = "lindera-dictionary" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7be7410b1da7017a8948986b87af67082f605e9a716f0989790d795d677f0c" -dependencies = [ - "anyhow", - "bincode", - "byteorder", - "lindera-cc-cedict-builder", - "lindera-core", - "lindera-ipadic-builder", - "lindera-ipadic-neologd-builder", - "lindera-ko-dic", - "lindera-ko-dic-builder", - "lindera-unidic", - "lindera-unidic-builder", - "serde", -] - -[[package]] -name = "lindera-ipadic-builder" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705d07f8a45d04fd95149f7ad41a26d1f9e56c9c00402be6f9dd05e3d88b99c6" -dependencies = [ - "anyhow", - "bincode", - "byteorder", - "csv", - "encoding_rs", - "encoding_rs_io", - "env_logger", - "glob", - "lindera-core", - "lindera-decompress", - "log", - "serde", - "yada", -] - -[[package]] -name = "lindera-ipadic-neologd-builder" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633a93983ba13fba42328311a501091bd4a7aff0c94ae9eaa9d4733dd2b0468a" -dependencies = [ - "anyhow", - "bincode", - "byteorder", - "csv", - "encoding_rs", - "encoding_rs_io", - "env_logger", - "glob", - "lindera-core", - "lindera-decompress", - "log", - "serde", - "yada", -] - -[[package]] -name = "lindera-ko-dic" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a428e0d316b6c86f51bd919479692bc41ad840dba266ebc044663970f431ea18" -dependencies = [ - "bincode", - "byteorder", - "encoding", - "flate2", - "lindera-core", - "lindera-decompress", - "lindera-ko-dic-builder", - "once_cell", - "tar", -] - -[[package]] -name = "lindera-ko-dic-builder" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5288704c6b8a069c0a1705c38758e836497698b50453373ab3d56c6f9a7ef8" -dependencies = [ - "anyhow", - "bincode", - "byteorder", - "csv", - "encoding", - "env_logger", - "glob", - "lindera-compress", - "lindera-core", - "lindera-decompress", - "log", - "yada", -] - -[[package]] -name = "lindera-tokenizer" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106ba439b2e87529d9bbedbb88d69f635baba1195c26502b308f55a85885fc81" -dependencies = [ - "bincode", - "byteorder", - "lindera-core", - "lindera-dictionary", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "lindera-unidic" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3399b6dcfe1701333451d184ff3c677f433b320153427b146360c9e4bd8cb816" -dependencies = [ - "bincode", - "byteorder", - "encoding", - "lindera-core", - "lindera-decompress", - "lindera-unidic-builder", - "once_cell", - "ureq", - "zip", -] - -[[package]] -name = "lindera-unidic-builder" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b698227fdaeac32289173ab389b990d4eb00a40cbc9912020f69a0c491dabf55" -dependencies = [ - "anyhow", - "bincode", - "byteorder", - "csv", - "encoding", - "env_logger", - "glob", - "lindera-compress", - "lindera-core", - "lindera-decompress", - "log", - "yada", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" - -[[package]] -name = "local-channel" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" -dependencies = [ - "futures-core", - "futures-sink", - "futures-util", - "local-waker", -] - -[[package]] -name = "local-waker" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" - -[[package]] -name = "lock_api" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", - "serde", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "loom" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matchit" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" - -[[package]] -name = "memchr" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f478948fd84d9f8e86967bf432640e46adfb5a4bd4f14ef7e864ab38220534ae" - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "merge" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10bbef93abb1da61525bbc45eeaff6473a41907d19f8f9aa5168d214e10693e9" -dependencies = [ - "merge_derive", - "num-traits", -] - -[[package]] -name = "merge_derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209d075476da2e63b4b29e72a2ef627b840589588e71400a25e3565c4f849d07" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "nix" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", -] - -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "ntapi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" -dependencies = [ - "winapi", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "num-format" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" -dependencies = [ - "arrayvec 0.7.4", - "itoa", -] - -[[package]] -name = "num-traits" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.2", - "libc", -] - -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - -[[package]] -name = "object" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "ordered-float" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" -dependencies = [ - "num-traits", -] - -[[package]] -name = "ordered-float" -version = "3.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a54938017eacd63036332b4ae5c8a49fc8c0c1d6d629893057e4f13609edd06" -dependencies = [ - "num-traits", -] - -[[package]] -name = "ordered-multimap" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" -dependencies = [ - "dlv-list", - "hashbrown 0.12.3", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" -dependencies = [ - "backtrace", - "cfg-if", - "libc", - "petgraph", - "redox_syscall 0.3.5", - "smallvec", - "thread-id", - "windows-targets 0.48.5", -] - -[[package]] -name = "parse-size" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "944553dd59c802559559161f9816429058b869003836120e262e8caec061b7ae" - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "permutation_iterator" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55405179fe06e4e3820ddaf9f9b51cdff9e7496af9554acdb2b1921a86ca9cb" -dependencies = [ - "blake2-rfc", - "rand 0.7.3", -] - -[[package]] -name = "pest" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "pest_meta" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.0.0", -] - -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared", - "rand 0.8.5", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pinyin" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd12336e3afa34152e002f57df37a7056778daa59ea542b3473b87f5fb260c4" - -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "plotters" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" - -[[package]] -name = "plotters-svg" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "portable-atomic" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" - -[[package]] -name = "pprof" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978385d59daf9269189d052ca8a84c1acfd0715c0599a5d5188d4acc078ca46a" -dependencies = [ - "backtrace", - "cfg-if", - "findshlibs", - "inferno", - "libc", - "log", - "nix 0.26.4", - "once_cell", - "parking_lot", - "prost", - "prost-build", - "prost-derive", - "sha2", - "smallvec", - "symbolic-demangle", - "tempfile", - "thiserror", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" -dependencies = [ - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "prettyplease" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" -dependencies = [ - "proc-macro2", - "syn 2.0.29", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "procfs" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "hex", - "lazy_static", - "rustix 0.36.15", -] - -[[package]] -name = "prometheus" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" -dependencies = [ - "cfg-if", - "fnv", - "lazy_static", - "memchr", - "parking_lot", - "thiserror", -] - -[[package]] -name = "proptest" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" -dependencies = [ - "bit-set", - "bitflags 1.3.2", - "byteorder", - "lazy_static", - "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax 0.6.29", - "rusty-fork", - "tempfile", - "unarray", -] - -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" -dependencies = [ - "bytes", - "heck", - "itertools 0.10.5", - "lazy_static", - "log", - "multimap", - "petgraph", - "prettyplease 0.1.25", - "prost", - "prost-types", - "pulldown-cmark", - "pulldown-cmark-to-cmark", - "regex", - "syn 1.0.109", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost", -] - -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - -[[package]] -name = "protobuf-build" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df9942df2981178a930a72d442de47e2f0df18ad68e50a30f816f1848215ad0" -dependencies = [ - "bitflags 1.3.2", - "proc-macro2", - "prost-build", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "pulldown-cmark" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" -dependencies = [ - "bitflags 1.3.2", - "memchr", - "unicase", -] - -[[package]] -name = "pulldown-cmark-to-cmark" -version = "10.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0194e6e1966c23cc5fd988714f85b18d548d773e81965413555d96569931833d" -dependencies = [ - "pulldown-cmark", -] - -[[package]] -name = "qdrant" -version = "1.4.1" -dependencies = [ - "actix-cors", - "actix-files", - "actix-multipart", - "actix-web", - "actix-web-validator", - "anyhow", - "api", - "chrono", - "clap", - "collection", - "colored", - "config", - "console-subscriber", - "constant_time_eq 0.3.0", - "env_logger", - "futures", - "futures-util", - "itertools 0.11.0", - "log", - "num-traits", - "num_cpus", - "parking_lot", - "prometheus", - "prost", - "raft", - "raft-proto", - "reqwest", - "rustls 0.20.9", - "rustls-pemfile", - "schemars", - "sealed_test", - "segment", - "serde", - "serde_cbor", - "serde_json", - "serde_urlencoded", - "slog", - "slog-stdlog", - "storage", - "sys-info", - "tar", - "tempfile", - "thiserror", - "tikv-jemallocator", - "tokio", - "tonic", - "tower", - "tower-layer", - "tracing", - "tracing-subscriber", - "tracing-tracy", - "uuid", - "validator", - "wal", -] - -[[package]] -name = "quantization" -version = "0.1.0" -source = "git+https://github.com/qdrant/quantization.git#f0ea16536e5cc799a51156856c3a90b344bfe92b" -dependencies = [ - "cc", - "permutation_iterator", - "rand 0.8.5", - "rayon", - "serde", - "serde_json", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-xml" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "raft" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12688b23a649902762d4c11d854d73c49c9b93138f2de16403ef9f571ad5bae" -dependencies = [ - "fxhash", - "getset", - "protobuf", - "raft-proto", - "rand 0.8.5", - "slog", - "thiserror", -] - -[[package]] -name = "raft-proto" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb6884896294f553e8d5cfbdb55080b9f5f2f43394afff59c9f077e0f4b46d6b" -dependencies = [ - "lazy_static", - "prost", - "protobuf", - "protobuf-build", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.10", -] - -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "redis" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffd6543a7bc6428396845f6854ccf3d1ae8823816592e2cbe74f20f50f209d02" -dependencies = [ - "async-trait", - "bytes", - "combine", - "crc16", - "futures", - "futures-util", - "itoa", - "log", - "percent-encoding", - "pin-project-lite", - "rand 0.8.5", - "ryu", - "sha1_smol", - "socket2 0.4.9", - "tokio", - "tokio-util", - "url", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.3.7", - "regex-syntax 0.7.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.5", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "relative-path" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" - -[[package]] -name = "reqwest" -version = "0.11.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" -dependencies = [ - "base64 0.21.3", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.7", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-rustls 0.24.1", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots 0.25.2", - "winreg", -] - -[[package]] -name = "rgb" -version = "0.8.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted", - "web-sys", - "winapi", -] - -[[package]] -name = "rmp" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" -dependencies = [ - "byteorder", - "num-traits", - "paste", -] - -[[package]] -name = "rmp-serde" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" -dependencies = [ - "byteorder", - "rmp", - "serde", -] - -[[package]] -name = "robust" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf4a6aa5f6d6888f39e980649f3ad6b666acdce1d78e95b8a2cb076e687ae30" - -[[package]] -name = "rocksdb" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" -dependencies = [ - "libc", - "librocksdb-sys", -] - -[[package]] -name = "ron" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "serde", -] - -[[package]] -name = "rstar" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73111312eb7a2287d229f06c00ff35b51ddee180f017ab6dec1f69d62ac098d6" -dependencies = [ - "heapless", - "num-traits", - "smallvec", -] - -[[package]] -name = "rstest" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97eeab2f3c0a199bc4be135c36c924b6590b88c377d416494288c14f2db30199" -dependencies = [ - "futures", - "futures-timer", - "rstest_macros", - "rustc_version", -] - -[[package]] -name = "rstest_macros" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605" -dependencies = [ - "cfg-if", - "glob", - "proc-macro2", - "quote", - "regex", - "relative-path", - "rustc_version", - "syn 2.0.29", - "unicode-ident", -] - -[[package]] -name = "rust-ini" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" -dependencies = [ - "cfg-if", - "ordered-multimap", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.36.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6248e1caa625eb708e266e06159f135e8c26f2bb7ceb72dc4b2766d0340964" -dependencies = [ - "bitflags 2.4.0", - "errno", - "libc", - "linux-raw-sys 0.4.5", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.4", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64 0.21.3", -] - -[[package]] -name = "rustls-webpki" -version = "0.100.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "rusty-forkfork" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce85af4dfa2fb0c0143121ab5e424c71ea693867357c9159b8777b59984c218" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schemars" -version = "0.8.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" -dependencies = [ - "chrono", - "dyn-clone", - "indexmap 1.9.3", - "schemars_derive", - "serde", - "serde_json", - "url", - "uuid", -] - -[[package]] -name = "schemars_derive" -version = "0.8.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 1.0.109", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "sealed_test" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a608d94641cc17fe203b102db2ae86d47a236630192f0244ddbbbb0044c0272" -dependencies = [ - "fs_extra", - "rusty-forkfork", - "sealed_test_derive", - "tempfile", -] - -[[package]] -name = "sealed_test_derive" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b672e005ae58fef5da619d90b9f1c5b44b061890f4a371b3c96257a8a15e697" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "segment" -version = "0.6.0" -dependencies = [ - "atomic_refcell", - "atomicwrites", - "bincode", - "bitvec", - "cgroups-rs", - "charabia", - "chrono", - "common", - "criterion", - "fs_extra", - "futures", - "geo", - "geohash", - "io-uring", - "itertools 0.11.0", - "log", - "memmap2 0.7.1", - "num-derive", - "num-traits", - "num_cpus", - "ordered-float 3.9.1", - "parking_lot", - "pprof", - "procfs", - "quantization", - "rand 0.8.5", - "rand_distr", - "rayon", - "rmp-serde", - "rocksdb", - "rstest", - "schemars", - "seahash", - "semver", - "serde", - "serde-value", - "serde_cbor", - "serde_json", - "smol_str", - "sysinfo", - "tar", - "tempfile", - "thiserror", - "tinyvec", - "uuid", - "validator", - "walkdir", -] - -[[package]] -name = "semver" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" - -[[package]] -name = "serde" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-value" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" -dependencies = [ - "ordered-float 2.10.0", - "serde", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "serde_derive_internals" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "serde_json" -version = "1.0.105" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_plain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1fc6db65a611022b23a0dec6975d63fb80a302cb3388835ff02c097258d50" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_qs" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cac3f1e2ca2fe333923a1ae72caca910b98ed0630bb35ef6f8c8517d6e81afa" -dependencies = [ - "actix-web", - "futures", - "percent-encoding", - "serde", - "thiserror", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - -[[package]] -name = "sha2" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - -[[package]] -name = "slog" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" - -[[package]] -name = "slog-scope" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786" -dependencies = [ - "arc-swap", - "lazy_static", - "slog", -] - -[[package]] -name = "slog-stdlog" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6706b2ace5bbae7291d3f8d2473e2bfab073ccd7d03670946197aec98471fa3e" -dependencies = [ - "log", - "slog", - "slog-scope", -] - -[[package]] -name = "smallvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" - -[[package]] -name = "smol_str" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" -dependencies = [ - "serde", -] - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "storage" -version = "0.2.0" -dependencies = [ - "anyhow", - "api", - "async-trait", - "atomicwrites", - "chrono", - "collection", - "env_logger", - "futures", - "http", - "itertools 0.11.0", - "log", - "num_cpus", - "parking_lot", - "proptest", - "prost", - "protobuf", - "raft", - "rand 0.8.5", - "reqwest", - "schemars", - "segment", - "serde", - "serde_cbor", - "serde_json", - "tar", - "tempfile", - "thiserror", - "tokio", - "tonic", - "url", - "uuid", - "validator", - "wal", -] - -[[package]] -name = "str_stack" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091b6114800a5f2141aee1d1b9d6ca3592ac062dc5decb3764ec5895a47b4eb" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "symbolic-common" -version = "12.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167a4ffd7c35c143fd1030aa3c2caf76ba42220bd5a6b5f4781896434723b8c3" -dependencies = [ - "debugid", - "memmap2 0.5.10", - "stable_deref_trait", - "uuid", -] - -[[package]] -name = "symbolic-demangle" -version = "12.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e378c50e80686c1c5c205674e1f86a2858bec3d2a7dfdd690331a8a19330f293" -dependencies = [ - "cpp_demangle", - "rustc-demangle", - "symbolic-common", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sys-info" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b3a0d0aba8bf96a0e1ddfdc352fc53b3df7f39318c71854910c3c4b024ae52c" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "sysinfo" -version = "0.29.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d0e9cc2273cc8d31377bdd638d72e3ac3e5607b18621062b169d02787f1bab" -dependencies = [ - "cfg-if", - "core-foundation-sys", - "libc", - "ntapi", - "once_cell", - "rayon", - "winapi", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tar" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "tempfile" -version = "3.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix 0.38.10", - "windows-sys 0.48.0", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "thread-id" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79474f573561cdc4871a0de34a51c92f7f5a56039113fbb5b9c9f96bdb756669" -dependencies = [ - "libc", - "redox_syscall 0.2.16", - "winapi", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tikv-jemalloc-sys" -version = "0.5.4+5.3.0-patched" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "tikv-jemallocator" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca" -dependencies = [ - "libc", - "tikv-jemalloc-sys", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" -dependencies = [ - "deranged", - "itoa", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" - -[[package]] -name = "time-macros" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" -dependencies = [ - "time-core", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" -dependencies = [ - "autocfg", - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2 0.4.9", - "tokio-macros", - "tracing", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.7", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "tonic" -version = "0.9.2" -source = "git+https://github.com/qdrant/tonic?branch=v0.9.2-patched#060ab88c87955adc59d46a44b4e3b72cb4cc1522" -dependencies = [ - "async-stream", - "async-trait", - "axum", - "base64 0.21.3", - "bytes", - "flate2", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "rustls-pemfile", - "tokio", - "tokio-rustls 0.24.1", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tonic-build" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" -dependencies = [ - "prettyplease 0.1.25", - "proc-macro2", - "prost-build", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand 0.8.5", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "tracing-core" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "parking_lot", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "tracing-tracy" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3edd27f53bc0e55aefa9223f68eb44354060103d3e34635f6e27627fe0227f" -dependencies = [ - "tracing-core", - "tracing-subscriber", - "tracy-client", -] - -[[package]] -name = "tracy-client" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c78458aa3759647e0399e959a06f9f6dc61450a1caaa4f1632a3df8e8c55af7" -dependencies = [ - "loom", - "once_cell", - "tracy-client-sys", -] - -[[package]] -name = "tracy-client-sys" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e764693ea5a090fb9b0a33fe9d32aa52656ae7ccd9f820719d2d998677c2eb" -dependencies = [ - "cc", -] - -[[package]] -name = "tree-sitter" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" -dependencies = [ - "cc", - "regex", -] - -[[package]] -name = "tree-sitter-javascript" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbc663376bdd294bd1f0a6daf859aedb9aa5bdb72217d7ad8ba2d5314102cf7" -dependencies = [ - "cc", - "tree-sitter", -] - -[[package]] -name = "tree-sitter-python" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c93b1b1fbd0d399db3445f51fd3058e43d0b4dcff62ddbdb46e66550978aa5" -dependencies = [ - "cc", - "tree-sitter", -] - -[[package]] -name = "tree-sitter-rust" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0832309b0b2b6d33760ce5c0e818cb47e1d72b468516bfe4134408926fa7594" -dependencies = [ - "cc", - "tree-sitter", -] - -[[package]] -name = "tree-sitter-typescript" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079c695c32d39ad089101c66393aeaca30e967fba3486a91f573d2f0e12d290a" -dependencies = [ - "cc", - "tree-sitter", -] - -[[package]] -name = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - -[[package]] -name = "unicode-ident" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "ureq" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" -dependencies = [ - "base64 0.21.3", - "log", - "once_cell", - "rustls 0.21.7", - "rustls-webpki 0.100.2", - "url", - "webpki-roots 0.23.1", -] - -[[package]] -name = "url" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "uuid" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" -dependencies = [ - "getrandom 0.2.10", - "serde", -] - -[[package]] -name = "validator" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd" -dependencies = [ - "idna", - "lazy_static", - "regex", - "serde", - "serde_derive", - "serde_json", - "url", - "validator_derive", -] - -[[package]] -name = "validator_derive" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc44ca3088bb3ba384d9aecf40c6a23a676ce23e09bdaca2073d99c207f864af" -dependencies = [ - "if_chain", - "lazy_static", - "proc-macro-error", - "proc-macro2", - "quote", - "regex", - "syn 1.0.109", - "validator_types", -] - -[[package]] -name = "validator_types" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "111abfe30072511849c5910134e8baf8dc05de4c0e5903d681cbd5c9c4d611e3" -dependencies = [ - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "wal" -version = "0.1.2" -source = "git+https://github.com/qdrant/wal.git?rev=a32f6a38acf7ffd761df83b0790eaefeb107cd60#a32f6a38acf7ffd761df83b0790eaefeb107cd60" -dependencies = [ - "byteorder", - "crc", - "crossbeam-channel", - "docopt", - "env_logger", - "fs4", - "log", - "memmap2 0.7.1", - "rand 0.8.5", - "rand_distr", - "rustix 0.38.10", - "serde", -] - -[[package]] -name = "walkdir" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.29", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "wasm-streams" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - -[[package]] -name = "webpki-roots" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.2", -] - -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "whatlang" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcdcd0195a5b871e50926da8e881277f36a4621b3220d85092e7b91cc85f6bd9" -dependencies = [ - "hashbrown 0.12.3", - "once_cell", -] - -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", + "winapi", ] [[package]] @@ -5673,256 +307,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "xattr" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" -dependencies = [ - "libc", -] - -[[package]] -name = "yada" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d12cb7a57bbf2ab670ed9545bae3648048547f9039279a89ce000208e585c1" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq 0.1.5", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2", - "sha1", - "time 0.3.28", - "zstd 0.11.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" -dependencies = [ - "zstd-safe 6.0.6", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-safe" -version = "6.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" -dependencies = [ - "cc", - "libc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml index 1e25b15..e710d27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,12 @@ [workspace] resolver = "2" -members = ["crates/codeindex", "crates/codeindex_common", "crates/qdrant"] - -[patch.crates-io] -# Temporary patch until is merged -tonic = { git = 'https://github.com/qdrant/tonic', branch = "v0.9.2-patched" } +members = ["crates/codeindex"] [profile.release] -lto = "fat" +strip = true +opt-level = "z" # Optimize for size. +lto = true # Enable Link Time Optimization (LTO) +codegen-units = 1 # Inherit from release, because we are not rebuilding often, # and we don't want the huge binary sizes from debug builds. diff --git a/TODO b/TODO deleted file mode 100644 index b8e583f..0000000 --- a/TODO +++ /dev/null @@ -1,3 +0,0 @@ -1. extract web server into seperate modules and be joined `codeindex_restful_apis` -2. codeindex_grpc_apis -3. codeindex_webui: monaco-editor & Askcodebase AI \ No newline at end of file diff --git a/crates/codeindex/Cargo.toml b/crates/codeindex/Cargo.toml index e16a3aa..47aa631 100644 --- a/crates/codeindex/Cargo.toml +++ b/crates/codeindex/Cargo.toml @@ -4,21 +4,10 @@ version = "0.1.0" edition = "2021" default-run = "codeindex" -[build-dependencies] -cc = "*" - [dependencies] -qdrant = { path = "../qdrant" } -codeindex_common = { path = "../codeindex_common" } -colored = "2.0.4" -tokio = { version = "~1.29", features = ["full"] } -axum = "0.6.20" -serde = { version = "1.0.188", features = ["derive"] } -serde_json = "1.0.105" -redis = { version = "0.23.2", features = ["cluster-async", "tokio-comp"] } +ignore = "0.4.20" tree-sitter = "0.20.10" tree-sitter-rust = "0.20.4" tree-sitter-python = "0.20.4" tree-sitter-typescript = "0.20.2" tree-sitter-javascript = "0.20.1" -log = "0.4" \ No newline at end of file diff --git a/crates/codeindex/src/handlers/javascript.rs b/crates/codeindex/src/handlers/javascript.rs new file mode 100644 index 0000000..5b5a343 --- /dev/null +++ b/crates/codeindex/src/handlers/javascript.rs @@ -0,0 +1,42 @@ +use std::collections::HashMap; + +use tree_sitter::TreeCursor; + +// Handler for JavaScript function_declaration +fn handle_js_function(cursor: &mut TreeCursor, source_code: &str) -> String { + let mut function_signature = String::new(); + if cursor.goto_first_child() { + loop { + let node = cursor.node(); + match node.kind() { + "identifier" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let child_name = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("function {}", child_name)); + } + "formal_parameters" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let parameters = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("{}", parameters)); + } + // JavaScript doesn't have explicit return types, so we don't handle that here + _ => {} + } + + if !cursor.goto_next_sibling() { + break; + } + } + cursor.goto_parent(); + } + function_signature +} + +pub fn get_handlers() -> HashMap<&'static str, fn(&mut TreeCursor, &str) -> String> { + let mut handlers: HashMap<&str, fn(&mut TreeCursor, &str) -> String> = HashMap::new(); + handlers.insert("function_declaration", handle_js_function); + // Insert more handlers as needed + handlers +} diff --git a/crates/codeindex/src/handlers/mod.rs b/crates/codeindex/src/handlers/mod.rs new file mode 100644 index 0000000..8b1bdad --- /dev/null +++ b/crates/codeindex/src/handlers/mod.rs @@ -0,0 +1,18 @@ +mod javascript; +mod python; +mod rust; +mod typescript; + +use std::collections::HashMap; + +use tree_sitter::TreeCursor; + +pub fn get_handlers(extension: &str) -> HashMap<&'static str, fn(&mut TreeCursor, &str) -> String> { + match extension { + "js" | "jsx" => javascript::get_handlers(), + "ts" | "tsx" => typescript::get_handlers(), + "rs" => rust::get_handlers(), + "py" => python::get_handlers(), + _ => HashMap::new(), + } +} diff --git a/crates/codeindex/src/handlers/python.rs b/crates/codeindex/src/handlers/python.rs new file mode 100644 index 0000000..4d80ee8 --- /dev/null +++ b/crates/codeindex/src/handlers/python.rs @@ -0,0 +1,66 @@ +use std::collections::HashMap; + +use tree_sitter::TreeCursor; + +// Handler for Python function_definition +fn handle_py_function(cursor: &mut TreeCursor, source_code: &str) -> String { + let mut function_signature = String::new(); + if cursor.goto_first_child() { + loop { + let node = cursor.node(); + match node.kind() { + "identifier" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let child_name = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("def {}", child_name)); + } + "parameters" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let parameters = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("{}", parameters)); + } + // Python doesn't have explicit return types, so we don't handle that here + _ => {} + } + + if !cursor.goto_next_sibling() { + break; + } + } + cursor.goto_parent(); + } + function_signature +} + +// Handler for Python class_definition +fn handle_py_class(cursor: &mut TreeCursor, source_code: &str) -> String { + let mut class_signature = String::new(); + if cursor.goto_first_child() { + loop { + let node = cursor.node(); + if node.kind() == "identifier" { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let child_name = &source_code[start_byte..end_byte]; + class_signature.push_str(&format!("class {}:", child_name)); + } + // You may want to handle fields, methods, etc. here... + + if !cursor.goto_next_sibling() { + break; + } + } + cursor.goto_parent(); + } + class_signature +} + +pub fn get_handlers() -> HashMap<&'static str, fn(&mut TreeCursor, &str) -> String> { + let mut handlers: HashMap<&str, fn(&mut TreeCursor, &str) -> String> = HashMap::new(); + handlers.insert("function_definition", handle_py_function); + handlers.insert("class_definition", handle_py_class); + // Insert more handlers as needed + handlers +} diff --git a/crates/codeindex/src/handlers/rust.rs b/crates/codeindex/src/handlers/rust.rs new file mode 100644 index 0000000..82b4f6f --- /dev/null +++ b/crates/codeindex/src/handlers/rust.rs @@ -0,0 +1,72 @@ +use std::collections::HashMap; + +use tree_sitter::TreeCursor; + +// Handler for Rust function_item +fn handle_rs_function(cursor: &mut TreeCursor, source_code: &str) -> String { + let mut function_signature = String::new(); + if cursor.goto_first_child() { + loop { + let node = cursor.node(); + match node.kind() { + "identifier" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let child_name = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("fn {}", child_name)); + } + "parameters" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let parameters = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("{}", parameters)); + } + "type_identifier" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let return_type = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!(" -> {}", return_type)); + } + _ => {} + } + + if !cursor.goto_next_sibling() { + break; + } + } + cursor.goto_parent(); + } + function_signature +} + +// Handler for Rust struct_item +fn handle_rs_struct(cursor: &mut TreeCursor, source_code: &str) -> String { + let mut struct_signature = String::new(); + if cursor.goto_first_child() { + loop { + let node = cursor.node(); + if node.kind() == "identifier" { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let child_name = &source_code[start_byte..end_byte]; + struct_signature.push_str(&format!("struct {} {{", child_name)); + } + // You may want to handle fields here... + + if !cursor.goto_next_sibling() { + break; + } + } + cursor.goto_parent(); + } + struct_signature.push_str("}"); + struct_signature +} + +pub fn get_handlers() -> HashMap<&'static str, fn(&mut TreeCursor, &str) -> String> { + let mut handlers: HashMap<&str, fn(&mut TreeCursor, &str) -> String> = HashMap::new(); + handlers.insert("function_item", handle_rs_function); + handlers.insert("struct_item", handle_rs_struct); + // Insert more handlers as needed + handlers +} diff --git a/crates/codeindex/src/handlers/typescript.rs b/crates/codeindex/src/handlers/typescript.rs new file mode 100644 index 0000000..aefc05d --- /dev/null +++ b/crates/codeindex/src/handlers/typescript.rs @@ -0,0 +1,80 @@ +use std::collections::HashMap; + +use tree_sitter::TreeCursor; + +// Handler for TypeScript function_declaration +fn handle_ts_function(cursor: &mut tree_sitter::TreeCursor, source_code: &str) -> String { + let mut function_signature = String::new(); + if cursor.goto_first_child() { + loop { + let node = cursor.node(); + match node.kind() { + "identifier" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let child_name = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("function {}", child_name)); + } + "formal_parameters" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let parameters = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!("{}", parameters)); + } + "type_annotation" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let return_type = &source_code[start_byte..end_byte]; + function_signature.push_str(&format!(": {}", return_type)); + } + _ => {} + } + + if !cursor.goto_next_sibling() { + break; + } + } + cursor.goto_parent(); + } + function_signature +} + +// Handler for TypeScript class_declaration +fn handle_ts_class(cursor: &mut TreeCursor, source_code: &str) -> String { + let mut class_signature = String::new(); + if cursor.goto_first_child() { + loop { + let node = cursor.node(); + match node.kind() { + "class" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let keyword = &source_code[start_byte..end_byte]; + class_signature.push_str(keyword); + class_signature.push(' '); + } + "type_identifier" => { + let start_byte = node.start_byte(); + let end_byte = node.end_byte(); + let child_name = &source_code[start_byte..end_byte]; + class_signature.push_str(child_name); + } + _ => {} + } + + if !cursor.goto_next_sibling() { + break; + } + } + cursor.goto_parent(); + } + class_signature +} + +pub fn get_handlers() -> HashMap<&'static str, fn(&mut TreeCursor, &str) -> String> { + let mut handlers: HashMap<&str, fn(&mut TreeCursor, &str) -> String> = HashMap::new(); + handlers.insert("function_declaration", handle_ts_function); + handlers.insert("class_declaration", handle_ts_class); + // Insert more handlers as needed + handlers +} diff --git a/crates/codeindex/src/languages.rs b/crates/codeindex/src/languages.rs new file mode 100644 index 0000000..c60bc3a --- /dev/null +++ b/crates/codeindex/src/languages.rs @@ -0,0 +1,16 @@ +use tree_sitter::Language; +use { + tree_sitter_javascript as ts_js, tree_sitter_python as ts_python, tree_sitter_rust as ts_rust, + tree_sitter_typescript as ts_ts, +}; + +pub fn get_language(extension: Option<&str>) -> Option { + match extension { + Some("rs") => Some(ts_rust::language()), + Some("js") | Some("jsx") => Some(ts_js::language()), + Some("ts") => Some(ts_ts::language_typescript()), + Some("tsx") => Some(ts_ts::language_tsx()), + Some("py") => Some(ts_python::language()), + _ => None, + } +} diff --git a/crates/codeindex/src/main.rs b/crates/codeindex/src/main.rs index 55b7b94..c35954a 100644 --- a/crates/codeindex/src/main.rs +++ b/crates/codeindex/src/main.rs @@ -1,16 +1,11 @@ -mod welcome; - -use qdrant::start_qdrant; -use welcome::welcome; - -/// CodeIndex is a local-first high performance codebase index engine designed for AI. -/// It helps your LLM understand the structure and semantics of a codebase and grab code -/// context when needed. -/// -/// This CLI starts a CodeIndex peer/server. -fn main() { - welcome(); - - let _ = start_qdrant(); - log::info!("CodeIndex server stopped"); -} +mod walker; +mod handlers; +mod languages; +mod outline; + +use std::error::Error; +use walker::process_entries; + +fn main() -> Result<(), Box> { + process_entries() +} diff --git a/crates/codeindex/src/outline.rs b/crates/codeindex/src/outline.rs new file mode 100644 index 0000000..7734533 --- /dev/null +++ b/crates/codeindex/src/outline.rs @@ -0,0 +1,35 @@ +use tree_sitter::Node; + +use crate::handlers; + +pub fn get_outline(node: Node, source_code: &str, extension: Option<&str>) -> Vec { + let mut cursor = node.walk(); + let mut signatures = Vec::new(); + + // Get the handlers for this language + let handlers = handlers::get_handlers(extension.unwrap_or("")); + + if cursor.goto_first_child() { + loop { + let child_node = cursor.node(); + let child_kind = child_node.kind(); + + // Lookup the handler for this kind of node + if let Some(handler) = handlers.get(child_kind) { + let signature = handler(&mut cursor, source_code); + signatures.push(signature); + } + + // If the node has no children or we're done processing the children, + // we move on to the next sibling. + if !cursor.goto_first_child() { + while !cursor.goto_next_sibling() { + if !cursor.goto_parent() { + return signatures; + } + } + } + } + } + signatures +} diff --git a/crates/codeindex/src/repo.rs b/crates/codeindex/src/repo.rs deleted file mode 100644 index ea6f9ce..0000000 --- a/crates/codeindex/src/repo.rs +++ /dev/null @@ -1,27 +0,0 @@ -use std::path::Path; - -use codeindex_common::git2::{Cred, Repository}; - -fn clone_repo(url: &str) -> Result<(), git2::Error> { - let creds = Cred::default(); - let repos_path = Path::new("repos"); - - let repo_name = url - .split('/') - .last() - .expect("Failed to parse repo name from URL"); - - let repo_path = repos_path.join(repo_name); - - if repo_path.exists() { - return Ok(()); // Repo already cloned - } - - println!("Cloning {} to {}", url, repo_path.display()); - - let repo = Repository::clone(url, &repo_path, Some(&creds))?; - - println!("Cloned {} successfully", repo.path().display()); - - Ok(()) -} diff --git a/crates/codeindex/src/walker.rs b/crates/codeindex/src/walker.rs new file mode 100644 index 0000000..1a74ad9 --- /dev/null +++ b/crates/codeindex/src/walker.rs @@ -0,0 +1,67 @@ +use std::error::Error; +use std::fs; +use std::io::ErrorKind::InvalidData; + +use ignore::overrides::OverrideBuilder; +use ignore::WalkBuilder; +use tree_sitter::Parser; + +use crate::languages::get_language; +use crate::outline::get_outline; + +pub fn process_entries() -> Result<(), Box> { + let mut overrides = OverrideBuilder::new("."); + overrides.add("!.git")?; // ignore .git directory + + for result in WalkBuilder::new("./") + .overrides(overrides.build()?) + .hidden(false) + .build() + { + match result { + Ok(entry) => process_entry(entry)?, + Err(err) => eprintln!("Error: {}", err), + } + } + Ok(()) +} + +fn process_entry(entry: ignore::DirEntry) -> Result<(), Box> { + // Skip the root directory + if entry.depth() == 0 { + return Ok(()); + } + + // Strip the './' prefix and print the path + let path = entry.path().strip_prefix("./").unwrap_or(entry.path()); + println!("{}", path.display()); + + // Check if path is a file + if path.is_file() { + match fs::read_to_string(path) { + Ok(code) => { + let mut parser = Parser::new(); + let language = get_language(path.extension().and_then(std::ffi::OsStr::to_str)); + + if let Some(language) = language { + parser.set_language(language).unwrap(); + } else { + return Ok(()); // Ignore other file types + } + + let extension = path.extension().and_then(std::ffi::OsStr::to_str); + let tree = parser.parse(&code, None).unwrap(); + let root_node = tree.root_node(); + let outline = get_outline(root_node, &code, extension); + for signature in outline { + println!(" {}", signature); + } + } + Err(e) if e.kind() == InvalidData => { + // Skip binary files + } + Err(e) => return Err(e.into()), + } + } + Ok(()) +} diff --git a/crates/codeindex/src/welcome.rs b/crates/codeindex/src/welcome.rs deleted file mode 100644 index 7ab54da..0000000 --- a/crates/codeindex/src/welcome.rs +++ /dev/null @@ -1,47 +0,0 @@ -use std::env; - -use codeindex_common::atty::{self, Stream}; -use colored::{Color, ColoredString, Colorize}; - -fn paint(text: &str, true_color: bool) -> ColoredString { - if true_color { - text.bold().truecolor(70, 144, 239) - } else { - text.bold().color(Color::Blue) - } -} - -/// Prints welcome message -#[rustfmt::skip] -pub fn welcome() { - if !atty::is(Stream::Stdout) { - colored::control::set_override(false); - } - - let mut true_color = true; - let package_version = env!("CARGO_PKG_VERSION"); - - match env::var("COLORTERM") { - Ok(val) => if val != "24bit" && val != "truecolor" { - true_color = false; - }, - Err(_) => true_color = false, - } - - println!("{}", paint(r#"_________ _________ ________ _________ "#, true_color)); - println!("{}", paint(r#"__ ____/___________ /________ _/____________ /________ __"#, true_color)); - println!("{}", paint(r#"_ / _ __ \ __ /_ _ \__ / __ __ \ __ /_ _ \_ |/_/"#, true_color)); - println!("{}", paint(r#"/ /___ / /_/ / /_/ / / __/_/ / _ / / / /_/ / / __/_> < "#, true_color)); - println!("{}", paint(&format!(r#"\____/ \____/\__,_/ \___//___/ /_/ /_/\__,_/ \___//_/|_| v{}"#, package_version), true_color)); - println!(); -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_welcome() { - welcome(); - } -} diff --git a/crates/codeindex_common/Cargo.toml b/crates/codeindex_common/Cargo.toml deleted file mode 100644 index 0c1082b..0000000 --- a/crates/codeindex_common/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "codeindex_common" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] - -atty = "0.2" -git2 = "0.18.0" \ No newline at end of file diff --git a/crates/codeindex_common/src/lib.rs b/crates/codeindex_common/src/lib.rs deleted file mode 100644 index 52b60de..0000000 --- a/crates/codeindex_common/src/lib.rs +++ /dev/null @@ -1,4 +0,0 @@ -/// codeindex_common is a library that contains common code -/// for crates of codeindex project. -pub extern crate atty; -pub extern crate git2; \ No newline at end of file diff --git a/crates/qdrant/Cargo.toml b/crates/qdrant/Cargo.toml deleted file mode 100644 index 060a12f..0000000 --- a/crates/qdrant/Cargo.toml +++ /dev/null @@ -1,109 +0,0 @@ -[package] -name = "qdrant" -version = "1.4.1" -authors = [ - "Andrey Vasnetsov ", - "Qdrant Team ", -] -readme = "README.md" -homepage = "https://qdrant.tech/" -repository = "https://github.com/qdrant/qdrant" -license = "Apache-2.0" -edition = "2021" - -[features] -default = ["web", "parking_lot"] -web = ["actix-web"] -multiling-chinese = ["segment/multiling-chinese"] -multiling-japanese = ["segment/multiling-japanese"] -multiling-korean = ["segment/multiling-korean"] -service_debug = ["parking_lot", "parking_lot/deadlock_detection"] -tracing-log = ["tracing", "tracing/log"] -console = ["console-subscriber"] -console-subscriber = ["tracing", "tracing-subscriber", "dep:console-subscriber"] -tracy = ["tracing-tracy"] -tracing-tracy = ["tracing", "tracing-subscriber", "dep:tracing-tracy"] -tokio-tracing = ["tokio/tracing"] - -[dev-dependencies] -serde_urlencoded = "0.7" -sealed_test = "1.0.0" - -tempfile = "3.7.1" - -[dependencies] - -parking_lot = { version = "0.12.1", features=["deadlock_detection"], optional = true } - -num_cpus = "1.16" -thiserror = "1.0" -log = "0.4" -env_logger = "0.10.0" -colored = "2" -serde = { version = "~1.0", features = ["derive"] } -serde_json = "~1.0" -chrono = { version = "~0.4", features = ["serde"] } -schemars = { version = "0.8.12", features = ["uuid1", "preserve_order", "chrono"] } -itertools = "0.11" -anyhow = "1.0.72" -futures = "0.3.28" -futures-util = "0.3.27" -clap = { version = "4.3.21", features = ["derive"] } -serde_cbor = { version = "0.11.2"} -uuid = { version = "1.4", features = ["v4", "serde"] } -sys-info = "0.9.1" -wal = { git = "https://github.com/qdrant/wal.git", rev = "a32f6a38acf7ffd761df83b0790eaefeb107cd60" } - -config = "~0.13.3" - -tokio = { version = "~1.29", features = ["full"] } - -actix-web = { version = "4.3.1", optional = true, features = ["rustls", "actix-tls"] } -actix-cors = "0.6.4" -actix-files = "0.6.2" -tonic = { version = "0.9.2", features = ["gzip", "tls"] } -tower = "0.4.13" -tower-layer = "0.3.2" -num-traits = "0.2.16" -tar = "0.4.40" -reqwest = { version = "0.11", default-features = false, features = ["stream", "rustls-tls", "blocking"] } -rustls = "0.20.7" -rustls-pemfile = "1.0.3" -prometheus = { version = "0.13.3", default-features = false } -validator = { version = "0.16", features = ["derive"] } -actix-web-validator = "5.0.1" - -# Consensus related crates -raft = { version = "0.7.0", features = ["prost-codec"], default-features = false } -slog = "2.7.0" -slog-stdlog = "4.1.1" -prost = "0.11.9" -raft-proto = { version = "0.7.0", features = ["prost-codec"], default-features = false} - -segment = { path = "lib/segment" } -collection = { path = "lib/collection" } -storage = { path = "lib/storage" } -api = { path = "lib/api" } -actix-multipart = "0.6.0" -constant_time_eq = "0.3.0" - -# Profiling -tracing = { version = "0.1", features = ["async-await"], optional = true } -tracing-subscriber = { version = "0.3", default-features = false, features = ["registry", "std"], optional = true } -console-subscriber = { version = "0.1", default-features = false, features = ["parking_lot"], optional = true } -tracing-tracy = { version = "0.10.2", features = ["ondemand"], optional = true } - -[target.'cfg(not(target_env = "msvc"))'.dependencies] -tikv-jemallocator = "0.5" - -[[bin]] -name = "schema_generator" -path = "src/schema_generator.rs" -test = false -bench = false - -[[bin]] -name = "wal_inspector" -path = "src/wal_inspector.rs" -test = false -bench = false \ No newline at end of file diff --git a/crates/qdrant/LICENSE b/crates/qdrant/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/crates/qdrant/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/crates/qdrant/README.md b/crates/qdrant/README.md deleted file mode 100644 index 1026fcd..0000000 --- a/crates/qdrant/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Qdrant Integration into CodeIndex - -**Qdrant** (read: quadrant) is a vector similarity search engine and vector database. It provides a production-ready service with a convenient API to store, search, and manage points—vectors with an additional payload Qdrant is tailored to extended filtering support. It makes it useful for all sorts of neural-network or semantic-based matching, faceted search, and other applications. - - -> [!IMPORTANT] -> We respect qdrant's [Apache License 2.0](./LICENSE) and strictly follow its rules. If you're looking for a Vector Database solution, please check [Qdrant Website](https://qdrant.tech/). - -We've directly integrated Qdrant into CodeIndex project to achieve: - -1. **Performance Improvement:** Direct library function calls within the same process are faster than network requests, even on the same machine. This reduces latency and optimizes application speed. - -2. **Direct API Calls:** This allows greater flexibility with direct access to all Qdrant functionalities without network interface restrictions. It simplifies our codebase, promotes safer code with Rust's static typing, and eliminates the need for network communication code for Qdrant interaction. \ No newline at end of file diff --git a/crates/qdrant/config/config.yaml b/crates/qdrant/config/config.yaml deleted file mode 100644 index 28c6b77..0000000 --- a/crates/qdrant/config/config.yaml +++ /dev/null @@ -1,206 +0,0 @@ -debug: false -log_level: INFO - -storage: - # Where to store all the data - storage_path: ./storage - - # Where to store snapshots - snapshots_path: ./snapshots - - # Where to store temporary files - # If null, temporary snapshot are stored in: storage/snapshots_temp/ - temp_path: null - - # If true - point's payload will not be stored in memory. - # It will be read from the disk every time it is requested. - # This setting saves RAM by (slightly) increasing the response time. - # Note: those payload values that are involved in filtering and are indexed - remain in RAM. - on_disk_payload: true - - # Write-ahead-log related configuration - wal: - # Size of a single WAL segment - wal_capacity_mb: 32 - - # Number of WAL segments to create ahead of actual data requirement - wal_segments_ahead: 0 - - # Normal node - receives all updates and answers all queries - node_type: "Normal" - - # Listener node - receives all updates, but does not answer search/read queries - # Useful for setting up a dedicated backup node - # node_type: "Listener" - - performance: - # Number of parallel threads used for search operations. If 0 - auto selection. - max_search_threads: 0 - # Max total number of threads, which can be used for running optimization processes across all collections. - # Note: Each optimization thread will also use `max_indexing_threads` for index building. - # So total number of threads used for optimization will be `max_optimization_threads * max_indexing_threads` - max_optimization_threads: 1 - - optimizers: - # The minimal fraction of deleted vectors in a segment, required to perform segment optimization - deleted_threshold: 0.2 - - # The minimal number of vectors in a segment, required to perform segment optimization - vacuum_min_vector_number: 1000 - - # Target amount of segments 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, - # so that each segment would be handled evenly by one of the threads. - # If `default_segment_number = 0`, will be automatically selected by the number of available CPUs - default_segment_number: 0 - - # Do not create segments larger this size (in KiloBytes). - # 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 search speed is more important - make this parameter higher. - # Note: 1Kb = 1 vector of size 256 - # If not set, will be automatically selected considering the number of available CPUs. - max_segment_size_kb: null - - # 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. - # To enable memmap storage, lower the threshold - # Note: 1Kb = 1 vector of size 256 - # To explicitly disable mmap optimization, set to `0`. - # If not set, will be disabled by default. - memmap_threshold_kb: null - - # Maximum size (in KiloBytes) of vectors allowed for plain index. - # Default value based on https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md - # Note: 1Kb = 1 vector of size 256 - # To explicitly disable vector indexing, set to `0`. - # If not set, the default value will be used. - indexing_threshold_kb: 20000 - - # Interval between forced flushes. - flush_interval_sec: 5 - - # Max number of threads, which can be used for optimization per collection. - # Note: Each optimization thread will also use `max_indexing_threads` for index building. - # So total number of threads used for optimization will be `max_optimization_threads * max_indexing_threads` - # If `max_optimization_threads = 0`, optimization will be disabled. - max_optimization_threads: 1 - - # Default parameters of HNSW Index. Could be overridden for each collection or named vector individually - hnsw_index: - # Number of edges per node in the index graph. Larger the value - more accurate the search, more space required. - m: 16 - # Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index. - ef_construct: 100 - # Minimal size (in KiloBytes) of vectors for additional payload-based indexing. - # If payload chunk is smaller than `full_scan_threshold_kb` 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 - full_scan_threshold_kb: 10000 - # Number of parallel threads used for background index building. If 0 - auto selection. - max_indexing_threads: 0 - # Store HNSW index on disk. If set to false, index will be stored in RAM. Default: false - on_disk: false - # Custom M param for hnsw graph built for payload index. If not set, default M will be used. - payload_m: null - -service: - - # Maximum size of POST data in a single request in megabytes - max_request_size_mb: 32 - - # Number of parallel workers used for serving the api. If 0 - equal to the number of available cores. - # If missing - Same as storage.max_search_threads - max_workers: 0 - - # Host to bind the service on - host: 0.0.0.0 - - # HTTP(S) port to bind the service on - http_port: 6333 - - # gRPC port to bind the service on. - # If `null` - gRPC is disabled. Default: null - # Comment to disable gRPC: - grpc_port: 6334 - - # Enable CORS headers in REST API. - # If enabled, browsers would be allowed to query REST endpoints regardless of query origin. - # More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS - # Default: true - enable_cors: true - - # Enable HTTPS for the REST and gRPC API - enable_tls: false - - # Check user HTTPS client certificate against CA file specified in tls config - verify_https_client_certificate: false - - # Set an api-key. - # If set, all requests must include a header with the api-key. - # example header: `api-key: ` - # - # If you enable this you should also enable TLS. - # (Either above or via an external service like nginx.) - # Sending an api-key over an unencrypted channel is insecure. - # - # Uncomment to enable. - # api_key: your_secret_api_key_here - -cluster: - # Use `enabled: true` to run Qdrant in distributed deployment mode - enabled: false - - # Configuration of the inter-cluster communication - p2p: - # Port for internal communication between peers - port: 6335 - - # Use TLS for communication between peers - enable_tls: false - - # Configuration related to distributed consensus algorithm - consensus: - # How frequently peers should ping each other. - # Setting this parameter to lower value will allow consensus - # to detect disconnected nodes earlier, but too frequent - # tick period may create significant network and CPU overhead. - # We encourage you NOT to change this parameter unless you know what you are doing. - tick_period_ms: 100 - - -# Set to true to prevent service from sending usage statistics to the developers. -# Read more: https://qdrant.tech/documentation/guides/telemetry -telemetry_disabled: false - - -# TLS configuration. -# Required if either service.enable_tls or cluster.p2p.enable_tls is true. -tls: - # Server certificate chain file - cert: ./tls/cert.pem - - # Server private key file - key: ./tls/key.pem - - # Certificate authority certificate file. - # This certificate will be used to validate the certificates - # presented by other nodes during inter-cluster communication. - # - # If verify_https_client_certificate is true, it will verify - # HTTPS client certificate - # - # Required if cluster.p2p.enable_tls is true. - ca_cert: ./tls/cacert.pem - - # TTL in seconds to reload certificate from disk, useful for certificate rotations. - # Only works for HTTPS endpoints. Does not support gRPC (and intra-cluster communication). - # If `null` - TTL is disabled. - cert_ttl: 3600 - diff --git a/crates/qdrant/config/development.yaml b/crates/qdrant/config/development.yaml deleted file mode 100644 index 7795e40..0000000 --- a/crates/qdrant/config/development.yaml +++ /dev/null @@ -1,25 +0,0 @@ -debug: true -log_level: DEBUG - -service: - host: 127.0.0.1 - http_port: 6333 - # Uncomment to enable gRPC: - #grpc_port: 6334 - #api_key: your_secret_api_key_here - - -storage: - performance: - # Number of parallel threads used for search operations. If 0 - auto selection. - max_search_threads: 4 - - optimizers: - # Minimum interval between forced flushes. - flush_interval_sec: 5 - - # Do not create too much segments in dev - default_segment_number: 2 - - handle_collection_load_errors: true - diff --git a/crates/qdrant/config/production.yaml b/crates/qdrant/config/production.yaml deleted file mode 100644 index e62b4ef..0000000 --- a/crates/qdrant/config/production.yaml +++ /dev/null @@ -1,9 +0,0 @@ - -debug: false -log_level: INFO - -service: - host: 0.0.0.0 - http_port: 6333 - # Uncomment to enable gRPC: - #grpc_port: 6334 diff --git a/crates/qdrant/lib/api/Cargo.toml b/crates/qdrant/lib/api/Cargo.toml deleted file mode 100644 index c99571f..0000000 --- a/crates/qdrant/lib/api/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "api" -version = "1.4.1" -authors = [ - "Andrey Vasnetsov ", - "Qdrant Team ", -] -license = "Apache-2.0" -edition = "2021" - -[dependencies] -log = "0.4" -env_logger = "0.10.0" -tonic = { version = "0.9.2", features = ["gzip", "tls"] } -prost = "0.11.9" -prost-types = "0.11.9" -serde = { version = "~1.0", features = ["derive"] } -serde_json = "~1.0" -schemars = { version = "0.8.12", features = ["uuid1", "preserve_order", "chrono"] } -uuid = { version = "1.4", features = ["v4", "serde"] } -tower = "0.4.13" -tokio = "1.29.1" -rand = "0.8.5" -chrono = { version = "~0.4", features = ["serde"] } -thiserror = "1.0" -parking_lot = "0.12" -validator = { version = "0.16", features = ["derive"] } - -segment = {path = "../segment"} - -[build-dependencies] -tonic-build = { version = "0.9.2", features = ["prost"] } -prost-build = { version = "0.11.8", features = ["cleanup-markdown"] } - -[dev-dependencies] -tokio = { version = "~1.29", features = ["full"] } diff --git a/crates/qdrant/lib/api/build.rs b/crates/qdrant/lib/api/build.rs deleted file mode 100644 index cce29f6..0000000 --- a/crates/qdrant/lib/api/build.rs +++ /dev/null @@ -1,237 +0,0 @@ -use tonic_build::Builder; - -fn main() -> std::io::Result<()> { - // Build gRPC bits from proto file - tonic_build::configure() - // Because we want to attach all validation rules to the generated gRPC types, we must do - // so by extending the builder. This is ugly, but better than manually implementing - // `Validation` for all these types and seems to be the best approach. The line below - // configures all attributes. - .extern_path(".google.protobuf.Empty", "()") - .compile_well_known_types(true) - .configure_validation() - .out_dir("src/grpc/") // saves generated structures at this location - .compile( - &["src/grpc/proto/qdrant.proto"], // proto entry point - &["src/grpc/proto"], // specify the root location to search proto dependencies - )?; - - // Append trait extension imports to generated gRPC output - append_to_file("src/grpc/qdrant.rs", "use super::validate::ValidateExt;"); - - Ok(()) -} - -/// Extension to [`Builder`] to configure validation attributes. -trait BuilderExt { - fn configure_validation(self) -> Self; - fn validates(self, fields: &[(&str, &str)], extra_derives: &[&str]) -> Self; - fn derive_validate(self, path: &str) -> Self; - fn derive_validates(self, paths: &[&str]) -> Self; - fn field_validate(self, path: &str, constraint: &str) -> Self; - fn field_validates(self, paths: &[(&str, &str)]) -> Self; -} - -impl BuilderExt for Builder { - fn configure_validation(self) -> Self { - configure_validation(self) - } - - fn validates(self, fields: &[(&str, &str)], extra_derives: &[&str]) -> Self { - // Build list of structs to derive validation on, guess these from list of fields - let mut derives = fields - .iter() - .map(|(field, _)| field.split_once('.').unwrap().0) - .collect::>(); - derives.extend(extra_derives); - derives.sort_unstable(); - derives.dedup(); - - self.derive_validates(&derives).field_validates(fields) - } - - fn derive_validate(self, path: &str) -> Self { - self.type_attribute(path, "#[derive(validator::Validate)]") - } - - fn derive_validates(self, paths: &[&str]) -> Self { - paths.iter().fold(self, |c, path| c.derive_validate(path)) - } - - fn field_validate(self, path: &str, constraint: &str) -> Self { - if constraint.is_empty() { - self.field_attribute(path, "#[validate]") - } else { - self.field_attribute(path, format!("#[validate({constraint})]")) - } - } - - fn field_validates(self, fields: &[(&str, &str)]) -> Self { - fields.iter().fold(self, |c, (path, constraint)| { - c.field_validate(path, constraint) - }) - } -} - -/// Configure additional attributes required for validation on generated gRPC types. -/// -/// These are grouped by service file. -#[rustfmt::skip] -fn configure_validation(builder: Builder) -> Builder { - builder - // Service: collections.proto - .validates(&[ - ("GetCollectionInfoRequest.collection_name", "length(min = 1, max = 255)"), - ("CreateCollection.collection_name", "length(min = 1, max = 255), custom = \"crate::grpc::validate::validate_collection_name\""), - ("CreateCollection.hnsw_config", ""), - ("CreateCollection.wal_config", ""), - ("CreateCollection.optimizers_config", ""), - ("CreateCollection.vectors_config", ""), - ("CreateCollection.quantization_config", ""), - ("UpdateCollection.collection_name", "length(min = 1, max = 255)"), - ("UpdateCollection.optimizers_config", ""), - ("UpdateCollection.params", ""), - ("UpdateCollection.timeout", "custom = \"crate::grpc::validate::validate_u64_range_min_1\""), - ("UpdateCollection.hnsw_config", ""), - ("UpdateCollection.vectors_config", ""), - ("UpdateCollection.quantization_config", ""), - ("DeleteCollection.collection_name", "length(min = 1, max = 255)"), - ("DeleteCollection.timeout", "custom = \"crate::grpc::validate::validate_u64_range_min_1\""), - ("CollectionConfig.params", ""), - ("CollectionConfig.hnsw_config", ""), - ("CollectionConfig.optimizers_config", ""), - ("CollectionConfig.quantization_config", ""), - ("CollectionParams.vectors_config", ""), - ("ChangeAliases.timeout", "custom = \"crate::grpc::validate::validate_u64_range_min_1\""), - ("ListCollectionAliasesRequest.collection_name", "length(min = 1, max = 255)"), - ("HnswConfigDiff.ef_construct", "custom = \"crate::grpc::validate::validate_u64_range_min_4\""), - ("WalConfigDiff.wal_capacity_mb", "custom = \"crate::grpc::validate::validate_u64_range_min_1\""), - ("OptimizersConfigDiff.deleted_threshold", "custom = \"crate::grpc::validate::validate_f64_range_1\""), - ("OptimizersConfigDiff.vacuum_min_vector_number", "custom = \"crate::grpc::validate::validate_u64_range_min_100\""), - ("VectorsConfig.config", ""), - ("VectorsConfigDiff.config", ""), - ("VectorParams.size", "range(min = 1)"), - ("VectorParams.hnsw_config", ""), - ("VectorParams.quantization_config", ""), - ("VectorParamsMap.map", ""), - ("VectorParamsDiff.hnsw_config", ""), - ("VectorParamsDiff.quantization_config", ""), - ("VectorParamsDiffMap.map", ""), - ("QuantizationConfig.quantization", ""), - ("QuantizationConfigDiff.quantization", ""), - ("ScalarQuantization.quantile", "custom = \"crate::grpc::validate::validate_f32_range_min_0_5_max_1\""), - ], &[ - "ListCollectionsRequest", - "CollectionParamsDiff", - "ListAliasesRequest", - "CollectionClusterInfoRequest", - "UpdateCollectionClusterSetupRequest", - "ProductQuantization", - "Disabled", - "QuantizationConfigDiff", - "quantization_config_diff::Quantization" - ]) - // Service: collections_internal.proto - .validates(&[ - ("GetCollectionInfoRequestInternal.get_collection_info_request", ""), - ("InitiateShardTransferRequest.collection_name", "length(min = 1, max = 255)"), - ], &[]) - // Service: points.proto - .validates(&[ - ("UpsertPoints.collection_name", "length(min = 1, max = 255)"), - ("DeletePoints.collection_name", "length(min = 1, max = 255)"), - ("UpdatePointVectors.collection_name", "length(min = 1, max = 255)"), - ("UpdatePointVectors.vectors", "custom(function = \"crate::grpc::validate::validate_named_vectors_not_empty\", message = \"must specify vectors to update\")"), - ("DeletePointVectors.collection_name", "length(min = 1, max = 255)"), - ("DeletePointVectors.vector_names", "length(min = 1, message = \"must specify vector names to delete\")"), - ("GetPoints.collection_name", "length(min = 1, max = 255)"), - ("SetPayloadPoints.collection_name", "length(min = 1, max = 255)"), - ("DeletePayloadPoints.collection_name", "length(min = 1, max = 255)"), - ("ClearPayloadPoints.collection_name", "length(min = 1, max = 255)"), - ("UpdateBatchPoints.collection_name", "length(min = 1, max = 255)"), - ("UpdateBatchPoints.operations", "length(min = 1)"), - ("CreateFieldIndexCollection.collection_name", "length(min = 1, max = 255)"), - ("CreateFieldIndexCollection.field_name", "length(min = 1)"), - ("DeleteFieldIndexCollection.collection_name", "length(min = 1, max = 255)"), - ("DeleteFieldIndexCollection.field_name", "length(min = 1)"), - ("SearchPoints.collection_name", "length(min = 1, max = 255)"), - ("SearchPoints.limit", "range(min = 1)"), - ("SearchPoints.params", ""), - ("SearchPoints.vector_name", "custom = \"crate::grpc::validate::validate_not_empty\""), - ("SearchBatchPoints.collection_name", "length(min = 1, max = 255)"), - ("SearchBatchPoints.search_points", ""), - ("SearchPointGroups.collection_name", "length(min = 1, max = 255)"), - ("SearchPointGroups.group_by", "length(min = 1)"), - ("SearchPointGroups.params", ""), - ("SearchPointGroups.vector_name", "custom = \"crate::grpc::validate::validate_not_empty\""), - ("SearchPointGroups.group_size", "range(min = 1)"), - ("SearchPointGroups.limit", "range(min = 1)"), - ("SearchParams.quantization", ""), - ("QuantizationSearchParams.oversampling", "custom = \"crate::grpc::validate::validate_f64_range_min_1\""), - ("ScrollPoints.collection_name", "length(min = 1, max = 255)"), - ("ScrollPoints.limit", "custom = \"crate::grpc::validate::validate_u32_range_min_1\""), - ("RecommendPoints.collection_name", "length(min = 1, max = 255)"), - ("RecommendPoints.params", ""), - ("RecommendBatchPoints.collection_name", "length(min = 1, max = 255)"), - ("RecommendBatchPoints.recommend_points", ""), - ("RecommendPointGroups.collection_name", "length(min = 1, max = 255)"), - ("RecommendPointGroups.group_by", "length(min = 1)"), - ("RecommendPointGroups.group_size", "range(min = 1)"), - ("RecommendPointGroups.limit", "range(min = 1)"), - ("RecommendPointGroups.params", ""), - ("CountPoints.collection_name", "length(min = 1, max = 255)"), - ("GeoPolygon.points", "custom = \"crate::grpc::validate::validate_geo_polygon\""), - ], &[]) - .type_attribute(".", "#[derive(serde::Serialize)]") - // Service: points_internal_service.proto - .validates(&[ - ("UpsertPointsInternal.upsert_points", ""), - ("DeletePointsInternal.delete_points", ""), - ("UpdateVectorsInternal.update_vectors", ""), - ("DeleteVectorsInternal.delete_vectors", ""), - ("SetPayloadPointsInternal.set_payload_points", ""), - ("DeletePayloadPointsInternal.delete_payload_points", ""), - ("ClearPayloadPointsInternal.clear_payload_points", ""), - ("CreateFieldIndexCollectionInternal.create_field_index_collection", ""), - ("DeleteFieldIndexCollectionInternal.delete_field_index_collection", ""), - ("SearchPointsInternal.search_points", ""), - ("SearchBatchPointsInternal.collection_name", "length(min = 1, max = 255)"), - ("SearchBatchPointsInternal.search_points", ""), - ("RecommendPointsInternal.recommend_points", ""), - ("ScrollPointsInternal.scroll_points", ""), - ("GetPointsInternal.get_points", ""), - ("CountPointsInternal.count_points", ""), - ("SyncPointsInternal.sync_points", ""), - ("SyncPoints.collection_name", "length(min = 1, max = 255)"), - ], &[]) - // Service: raft_service.proto - .validates(&[ - ("AddPeerToKnownMessage.uri", "custom = \"crate::grpc::validate::validate_not_empty\""), - ("AddPeerToKnownMessage.port", "custom = \"crate::grpc::validate::validate_u32_range_min_1\""), - ], &[]) - // Service: snapshot_service.proto - .validates(&[ - ("CreateSnapshotRequest.collection_name", "length(min = 1, max = 255)"), - ("ListSnapshotsRequest.collection_name", "length(min = 1, max = 255)"), - ("DeleteSnapshotRequest.collection_name", "length(min = 1, max = 255)"), - ("DeleteSnapshotRequest.snapshot_name", "length(min = 1)"), - ("DeleteFullSnapshotRequest.snapshot_name", "length(min = 1)"), - ], &[ - "CreateFullSnapshotRequest", - "ListFullSnapshotsRequest", - ]) -} - -fn append_to_file(path: &str, line: &str) { - use std::fs::OpenOptions; - use std::io::prelude::*; - writeln!( - OpenOptions::new() - .write(true) - .append(true) - .open(path) - .unwrap(), - "{line}", - ) - .unwrap() -} diff --git a/crates/qdrant/lib/api/src/grpc/conversions.rs b/crates/qdrant/lib/api/src/grpc/conversions.rs deleted file mode 100644 index 535fe6d..0000000 --- a/crates/qdrant/lib/api/src/grpc/conversions.rs +++ /dev/null @@ -1,1100 +0,0 @@ -use std::collections::{HashMap, HashSet}; -use std::time::Instant; - -use chrono::{NaiveDateTime, Timelike}; -use segment::data_types::text_index::TextIndexType; -use segment::data_types::vectors::VectorElementType; -use segment::types::{default_quantization_ignore_value, default_quantization_rescore_value}; -use tonic::Status; -use uuid::Uuid; - -use super::protobuf; -use super::qdrant::{CompressionRatio, GroupId}; -use crate::grpc::models::{CollectionsResponse, VersionInfo}; -use crate::grpc::qdrant::condition::ConditionOneOf; -use crate::grpc::qdrant::payload_index_params::IndexParams; -use crate::grpc::qdrant::point_id::PointIdOptions; -use crate::grpc::qdrant::r#match::MatchValue; -use crate::grpc::qdrant::value::Kind; -use crate::grpc::qdrant::vectors::VectorsOptions; -use crate::grpc::qdrant::with_payload_selector::SelectorOptions; -use crate::grpc::qdrant::{ - with_vectors_selector, CollectionDescription, CollectionOperationResponse, Condition, Distance, - FieldCondition, Filter, GeoBoundingBox, GeoPoint, GeoPolygon, GeoRadius, HasIdCondition, - HealthCheckReply, HnswConfigDiff, IsEmptyCondition, IsNullCondition, ListCollectionsResponse, - ListValue, Match, NamedVectors, NestedCondition, PayloadExcludeSelector, - PayloadIncludeSelector, PayloadIndexParams, PayloadSchemaInfo, PayloadSchemaType, PointId, - ProductQuantization, QuantizationConfig, QuantizationSearchParams, QuantizationType, Range, - RepeatedIntegers, RepeatedStrings, ScalarQuantization, ScoredPoint, SearchParams, Struct, - TextIndexParams, TokenizerType, Value, ValuesCount, Vector, Vectors, VectorsSelector, - WithPayloadSelector, WithVectorsSelector, -}; - -pub fn payload_to_proto(payload: segment::types::Payload) -> HashMap { - payload - .into_iter() - .map(|(k, v)| (k, json_to_proto(v))) - .collect() -} - -fn json_to_proto(json_value: serde_json::Value) -> Value { - match json_value { - serde_json::Value::Null => Value { - kind: Some(Kind::NullValue(0)), - }, - serde_json::Value::Bool(v) => Value { - kind: Some(Kind::BoolValue(v)), - }, - serde_json::Value::Number(n) => Value { - kind: if let Some(int) = n.as_i64() { - Some(Kind::IntegerValue(int)) - } else { - Some(Kind::DoubleValue(n.as_f64().unwrap())) - }, - }, - serde_json::Value::String(s) => Value { - kind: Some(Kind::StringValue(s)), - }, - serde_json::Value::Array(v) => { - let list = v.into_iter().map(json_to_proto).collect(); - Value { - kind: Some(Kind::ListValue(ListValue { values: list })), - } - } - serde_json::Value::Object(m) => { - let map = m.into_iter().map(|(k, v)| (k, json_to_proto(v))).collect(); - Value { - kind: Some(Kind::StructValue(Struct { fields: map })), - } - } - } -} - -pub fn proto_to_payloads(proto: HashMap) -> Result { - let mut map: serde_json::Map = serde_json::Map::new(); - for (k, v) in proto.into_iter() { - map.insert(k, proto_to_json(v)?); - } - Ok(map.into()) -} - -fn proto_to_json(proto: Value) -> Result { - match proto.kind { - None => Ok(serde_json::Value::default()), - Some(kind) => match kind { - Kind::NullValue(_) => Ok(serde_json::Value::Null), - Kind::DoubleValue(n) => { - let v = match serde_json::Number::from_f64(n) { - Some(f) => f, - None => return Err(Status::invalid_argument("cannot convert to json number")), - }; - Ok(serde_json::Value::Number(v)) - } - Kind::IntegerValue(i) => Ok(serde_json::Value::Number(i.into())), - Kind::StringValue(s) => Ok(serde_json::Value::String(s)), - Kind::BoolValue(b) => Ok(serde_json::Value::Bool(b)), - Kind::StructValue(s) => { - let mut map = serde_json::Map::new(); - for (k, v) in s.fields.into_iter() { - map.insert(k, proto_to_json(v)?); - } - Ok(serde_json::Value::Object(map)) - } - Kind::ListValue(l) => { - let mut list = Vec::new(); - for v in l.values.into_iter() { - list.push(proto_to_json(v)?); - } - Ok(serde_json::Value::Array(list)) - } - }, - } -} - -impl From for HealthCheckReply { - fn from(info: VersionInfo) -> Self { - HealthCheckReply { - title: info.title, - version: info.version, - } - } -} - -impl From<(Instant, CollectionsResponse)> for ListCollectionsResponse { - fn from(value: (Instant, CollectionsResponse)) -> Self { - let (timing, response) = value; - let collections = response - .collections - .into_iter() - .map(|desc| CollectionDescription { name: desc.name }) - .collect::>(); - Self { - collections, - time: timing.elapsed().as_secs_f64(), - } - } -} - -impl From for TokenizerType { - fn from(tokenizer_type: segment::data_types::text_index::TokenizerType) -> Self { - match tokenizer_type { - segment::data_types::text_index::TokenizerType::Prefix => TokenizerType::Prefix, - segment::data_types::text_index::TokenizerType::Whitespace => TokenizerType::Whitespace, - segment::data_types::text_index::TokenizerType::Multilingual => { - TokenizerType::Multilingual - } - segment::data_types::text_index::TokenizerType::Word => TokenizerType::Word, - } - } -} - -impl From for PayloadIndexParams { - fn from(params: segment::data_types::text_index::TextIndexParams) -> Self { - let tokenizer = TokenizerType::from(params.tokenizer); - PayloadIndexParams { - index_params: Some(IndexParams::TextIndexParams(TextIndexParams { - tokenizer: tokenizer as i32, - lowercase: params.lowercase, - min_token_len: params.min_token_len.map(|x| x as u64), - max_token_len: params.max_token_len.map(|x| x as u64), - })), - } - } -} - -impl From for PayloadSchemaInfo { - fn from(schema: segment::types::PayloadIndexInfo) -> Self { - PayloadSchemaInfo { - data_type: match schema.data_type { - segment::types::PayloadSchemaType::Keyword => PayloadSchemaType::Keyword, - segment::types::PayloadSchemaType::Integer => PayloadSchemaType::Integer, - segment::types::PayloadSchemaType::Float => PayloadSchemaType::Float, - segment::types::PayloadSchemaType::Geo => PayloadSchemaType::Geo, - segment::types::PayloadSchemaType::Text => PayloadSchemaType::Text, - segment::types::PayloadSchemaType::Bool => PayloadSchemaType::Bool, - } - .into(), - params: schema.params.map(|params| match params { - segment::types::PayloadSchemaParams::Text(text_index_params) => { - text_index_params.into() - } - }), - points: Some(schema.points as u64), - } - } -} - -impl TryFrom for segment::data_types::text_index::TokenizerType { - type Error = Status; - fn try_from(tokenizer_type: TokenizerType) -> Result { - match tokenizer_type { - TokenizerType::Unknown => Err(Status::invalid_argument("unknown tokenizer type")), - TokenizerType::Prefix => Ok(segment::data_types::text_index::TokenizerType::Prefix), - TokenizerType::Multilingual => { - Ok(segment::data_types::text_index::TokenizerType::Multilingual) - } - TokenizerType::Whitespace => { - Ok(segment::data_types::text_index::TokenizerType::Whitespace) - } - TokenizerType::Word => Ok(segment::data_types::text_index::TokenizerType::Word), - } - } -} - -impl TryFrom for segment::data_types::text_index::TextIndexParams { - type Error = Status; - fn try_from(params: TextIndexParams) -> Result { - Ok(segment::data_types::text_index::TextIndexParams { - r#type: TextIndexType::Text, - tokenizer: TokenizerType::from_i32(params.tokenizer) - .map(|x| x.try_into()) - .unwrap_or_else(|| Err(Status::invalid_argument("unknown tokenizer type")))?, - lowercase: params.lowercase, - min_token_len: params.min_token_len.map(|x| x as usize), - max_token_len: params.max_token_len.map(|x| x as usize), - }) - } -} - -impl TryFrom for segment::data_types::text_index::TextIndexParams { - type Error = Status; - fn try_from(params: PayloadIndexParams) -> Result { - match params.index_params { - None => Ok(Default::default()), - Some(IndexParams::TextIndexParams(text_index_params)) => { - Ok(text_index_params.try_into()?) - } - } - } -} - -impl TryFrom for segment::types::PayloadSchemaParams { - type Error = Status; - - fn try_from(value: IndexParams) -> Result { - match value { - IndexParams::TextIndexParams(text_index_params) => Ok( - segment::types::PayloadSchemaParams::Text(text_index_params.try_into()?), - ), - } - } -} - -impl TryFrom for segment::types::PayloadIndexInfo { - type Error = Status; - - fn try_from(schema: PayloadSchemaInfo) -> Result { - let data_type = match PayloadSchemaType::from_i32(schema.data_type) { - None => { - return Err(Status::invalid_argument( - "Malformed payload schema".to_string(), - )) - } - Some(data_type) => match data_type { - PayloadSchemaType::Keyword => segment::types::PayloadSchemaType::Keyword, - PayloadSchemaType::Integer => segment::types::PayloadSchemaType::Integer, - PayloadSchemaType::Float => segment::types::PayloadSchemaType::Float, - PayloadSchemaType::Geo => segment::types::PayloadSchemaType::Geo, - PayloadSchemaType::Text => segment::types::PayloadSchemaType::Text, - PayloadSchemaType::Bool => segment::types::PayloadSchemaType::Bool, - PayloadSchemaType::UnknownType => { - return Err(Status::invalid_argument( - "Malformed payload schema".to_string(), - )) - } - }, - }; - let params = match schema.params { - None => None, - Some(PayloadIndexParams { index_params: None }) => None, - Some(PayloadIndexParams { - index_params: Some(index_params), - }) => Some(index_params.try_into()?), - }; - - Ok(segment::types::PayloadIndexInfo { - data_type, - params, - points: schema.points.unwrap_or(0) as usize, - }) - } -} - -impl From<(Instant, bool)> for CollectionOperationResponse { - fn from(value: (Instant, bool)) -> Self { - let (timing, result) = value; - CollectionOperationResponse { - result, - time: timing.elapsed().as_secs_f64(), - } - } -} - -impl From for GeoPoint { - fn from(geo: segment::types::GeoPoint) -> Self { - Self { - lon: geo.lon, - lat: geo.lat, - } - } -} - -impl TryFrom for segment::types::WithPayloadInterface { - type Error = Status; - - fn try_from(value: WithPayloadSelector) -> Result { - match value.selector_options { - Some(options) => Ok(match options { - SelectorOptions::Enable(flag) => segment::types::WithPayloadInterface::Bool(flag), - SelectorOptions::Exclude(s) => { - segment::types::PayloadSelectorExclude::new(s.fields).into() - } - SelectorOptions::Include(s) => { - segment::types::PayloadSelectorInclude::new(s.fields).into() - } - }), - _ => Err(Status::invalid_argument("No PayloadSelector".to_string())), - } - } -} - -impl From for WithPayloadSelector { - fn from(value: segment::types::WithPayloadInterface) -> Self { - let selector_options = match value { - segment::types::WithPayloadInterface::Bool(flag) => SelectorOptions::Enable(flag), - segment::types::WithPayloadInterface::Fields(fields) => { - SelectorOptions::Include(PayloadIncludeSelector { fields }) - } - segment::types::WithPayloadInterface::Selector(selector) => match selector { - segment::types::PayloadSelector::Include(s) => { - SelectorOptions::Include(PayloadIncludeSelector { fields: s.include }) - } - segment::types::PayloadSelector::Exclude(s) => { - SelectorOptions::Exclude(PayloadExcludeSelector { fields: s.exclude }) - } - }, - }; - WithPayloadSelector { - selector_options: Some(selector_options), - } - } -} - -impl From for segment::types::QuantizationSearchParams { - fn from(params: QuantizationSearchParams) -> Self { - Self { - ignore: params.ignore.unwrap_or(default_quantization_ignore_value()), - rescore: params - .rescore - .unwrap_or(default_quantization_rescore_value()), - oversampling: params.oversampling, - } - } -} - -impl From for QuantizationSearchParams { - fn from(params: segment::types::QuantizationSearchParams) -> Self { - Self { - ignore: Some(params.ignore), - rescore: Some(params.rescore), - oversampling: params.oversampling, - } - } -} - -impl From for segment::types::SearchParams { - fn from(params: SearchParams) -> Self { - Self { - hnsw_ef: params.hnsw_ef.map(|x| x as usize), - exact: params.exact.unwrap_or(false), - quantization: params.quantization.map(|q| q.into()), - } - } -} - -impl From for SearchParams { - fn from(params: segment::types::SearchParams) -> Self { - Self { - hnsw_ef: params.hnsw_ef.map(|x| x as u64), - exact: Some(params.exact), - quantization: params.quantization.map(|q| q.into()), - } - } -} - -impl From for PointId { - fn from(point_id: segment::types::PointIdType) -> Self { - PointId { - point_id_options: Some(match point_id { - segment::types::PointIdType::NumId(num) => PointIdOptions::Num(num), - segment::types::PointIdType::Uuid(uuid) => PointIdOptions::Uuid(uuid.to_string()), - }), - } - } -} - -impl From for Vector { - fn from(vector: segment::data_types::vectors::VectorType) -> Self { - Self { data: vector } - } -} - -impl From>> for NamedVectors { - fn from(vectors: HashMap>) -> Self { - Self { - vectors: vectors - .into_iter() - .map(|(name, vector)| (name, vector.into())) - .collect(), - } - } -} - -impl From for Vectors { - fn from(vector_struct: segment::data_types::vectors::VectorStruct) -> Self { - match vector_struct { - segment::data_types::vectors::VectorStruct::Single(vector) => Self { - vectors_options: Some(VectorsOptions::Vector(vector.into())), - }, - segment::data_types::vectors::VectorStruct::Multi(vectors) => Self { - vectors_options: Some(VectorsOptions::Vectors(vectors.into())), - }, - } - } -} - -impl From for ScoredPoint { - fn from(point: segment::types::ScoredPoint) -> Self { - Self { - id: Some(point.id.into()), - payload: point.payload.map(payload_to_proto).unwrap_or_default(), - score: point.score, - version: point.version, - vectors: point.vector.map(|v| v.into()), - } - } -} - -impl From for GroupId { - fn from(key: segment::data_types::groups::GroupId) -> Self { - match key { - segment::data_types::groups::GroupId::String(str) => Self { - kind: Some(crate::grpc::qdrant::group_id::Kind::StringValue(str)), - }, - segment::data_types::groups::GroupId::NumberU64(n) => Self { - kind: Some(crate::grpc::qdrant::group_id::Kind::UnsignedValue(n)), - }, - segment::data_types::groups::GroupId::NumberI64(n) => Self { - kind: Some(crate::grpc::qdrant::group_id::Kind::IntegerValue(n)), - }, - } - } -} - -impl From for HashMap> { - fn from(vectors: NamedVectors) -> Self { - vectors - .vectors - .into_iter() - .map(|(name, vector)| (name, vector.data)) - .collect() - } -} - -impl TryFrom for segment::data_types::vectors::VectorStruct { - type Error = Status; - - fn try_from(vectors: Vectors) -> Result { - match vectors.vectors_options { - Some(vectors_options) => Ok(match vectors_options { - VectorsOptions::Vector(vector) => { - segment::data_types::vectors::VectorStruct::Single(vector.data) - } - VectorsOptions::Vectors(vectors) => { - segment::data_types::vectors::VectorStruct::Multi(vectors.into()) - } - }), - None => Err(Status::invalid_argument("No Provided")), - } - } -} - -impl From for WithVectorsSelector { - fn from(with_vectors: segment::types::WithVector) -> Self { - let selector_options = match with_vectors { - segment::types::WithVector::Bool(enabled) => { - with_vectors_selector::SelectorOptions::Enable(enabled) - } - segment::types::WithVector::Selector(include) => { - with_vectors_selector::SelectorOptions::Include(VectorsSelector { names: include }) - } - }; - Self { - selector_options: Some(selector_options), - } - } -} - -impl From for segment::types::WithVector { - fn from(with_vectors_selector: WithVectorsSelector) -> Self { - match with_vectors_selector.selector_options { - None => Self::default(), - Some(with_vectors_selector::SelectorOptions::Enable(enabled)) => Self::Bool(enabled), - Some(with_vectors_selector::SelectorOptions::Include(include)) => { - Self::Selector(include.names) - } - } - } -} - -impl TryFrom for segment::types::PointIdType { - type Error = Status; - - fn try_from(value: PointId) -> Result { - match value.point_id_options { - Some(PointIdOptions::Num(num_id)) => Ok(segment::types::PointIdType::NumId(num_id)), - Some(PointIdOptions::Uuid(uui_str)) => Uuid::parse_str(&uui_str) - .map(segment::types::PointIdType::Uuid) - .map_err(|_err| { - Status::invalid_argument(format!("Unable to parse UUID: {uui_str}")) - }), - _ => Err(Status::invalid_argument( - "No ID options provided".to_string(), - )), - } - } -} - -impl From for ScalarQuantization { - fn from(value: segment::types::ScalarQuantization) -> Self { - let config = value.scalar; - ScalarQuantization { - r#type: match config.r#type { - segment::types::ScalarType::Int8 => { - crate::grpc::qdrant::QuantizationType::Int8 as i32 - } - }, - quantile: config.quantile, - always_ram: config.always_ram, - } - } -} - -impl TryFrom for segment::types::ScalarQuantization { - type Error = Status; - - fn try_from(value: ScalarQuantization) -> Result { - Ok(segment::types::ScalarQuantization { - scalar: segment::types::ScalarQuantizationConfig { - r#type: match QuantizationType::from_i32(value.r#type) { - Some(QuantizationType::Int8) => segment::types::ScalarType::Int8, - Some(QuantizationType::UnknownQuantization) | None => { - return Err(Status::invalid_argument("Unknown quantization type")) - } - }, - quantile: value.quantile, - always_ram: value.always_ram, - }, - }) - } -} - -impl From for ProductQuantization { - fn from(value: segment::types::ProductQuantization) -> Self { - let config = value.product; - ProductQuantization { - compression: match config.compression { - segment::types::CompressionRatio::X4 => CompressionRatio::X4 as i32, - segment::types::CompressionRatio::X8 => CompressionRatio::X8 as i32, - segment::types::CompressionRatio::X16 => CompressionRatio::X16 as i32, - segment::types::CompressionRatio::X32 => CompressionRatio::X32 as i32, - segment::types::CompressionRatio::X64 => CompressionRatio::X64 as i32, - }, - always_ram: config.always_ram, - } - } -} - -impl TryFrom for segment::types::ProductQuantization { - type Error = Status; - - fn try_from(value: ProductQuantization) -> Result { - Ok(segment::types::ProductQuantization { - product: segment::types::ProductQuantizationConfig { - compression: match CompressionRatio::from_i32(value.compression) { - None => { - return Err(Status::invalid_argument( - "Unknown compression ratio".to_string(), - )) - } - Some(CompressionRatio::X4) => segment::types::CompressionRatio::X4, - Some(CompressionRatio::X8) => segment::types::CompressionRatio::X8, - Some(CompressionRatio::X16) => segment::types::CompressionRatio::X16, - Some(CompressionRatio::X32) => segment::types::CompressionRatio::X32, - Some(CompressionRatio::X64) => segment::types::CompressionRatio::X64, - }, - always_ram: value.always_ram, - }, - }) - } -} - -impl From for QuantizationConfig { - fn from(value: segment::types::QuantizationConfig) -> Self { - match value { - segment::types::QuantizationConfig::Scalar(scalar) => Self { - quantization: Some(super::qdrant::quantization_config::Quantization::Scalar( - scalar.into(), - )), - }, - segment::types::QuantizationConfig::Product(product) => Self { - quantization: Some(super::qdrant::quantization_config::Quantization::Product( - product.into(), - )), - }, - } - } -} - -impl TryFrom for segment::types::QuantizationConfig { - type Error = Status; - - fn try_from(value: QuantizationConfig) -> Result { - let value = value - .quantization - .ok_or_else(|| Status::invalid_argument("Unable to convert quantization config"))?; - match value { - super::qdrant::quantization_config::Quantization::Scalar(config) => Ok( - segment::types::QuantizationConfig::Scalar(config.try_into()?), - ), - super::qdrant::quantization_config::Quantization::Product(config) => Ok( - segment::types::QuantizationConfig::Product(config.try_into()?), - ), - } - } -} - -fn conditions_helper_from_grpc( - conditions: Vec, -) -> Result>, tonic::Status> { - if conditions.is_empty() { - Ok(None) - } else { - let vec = conditions - .into_iter() - .map(|c| c.try_into()) - .collect::>()?; - Ok(Some(vec)) - } -} - -fn conditions_helper_to_grpc(conditions: Option>) -> Vec { - match conditions { - None => vec![], - Some(conditions) => { - if conditions.is_empty() { - vec![] - } else { - conditions.into_iter().map(|c| c.into()).collect() - } - } - } -} - -impl TryFrom for segment::types::Filter { - type Error = Status; - - fn try_from(value: Filter) -> Result { - Ok(Self { - should: conditions_helper_from_grpc(value.should)?, - must: conditions_helper_from_grpc(value.must)?, - must_not: conditions_helper_from_grpc(value.must_not)?, - }) - } -} - -impl From for Filter { - fn from(value: segment::types::Filter) -> Self { - Self { - should: conditions_helper_to_grpc(value.should), - must: conditions_helper_to_grpc(value.must), - must_not: conditions_helper_to_grpc(value.must_not), - } - } -} - -impl TryFrom for segment::types::Condition { - type Error = Status; - - fn try_from(value: Condition) -> Result { - if let Some(condition) = value.condition_one_of { - return match condition { - ConditionOneOf::Field(field) => { - Ok(segment::types::Condition::Field(field.try_into()?)) - } - ConditionOneOf::HasId(has_id) => { - Ok(segment::types::Condition::HasId(has_id.try_into()?)) - } - ConditionOneOf::Filter(filter) => { - Ok(segment::types::Condition::Filter(filter.try_into()?)) - } - ConditionOneOf::IsEmpty(is_empty) => { - Ok(segment::types::Condition::IsEmpty(is_empty.into())) - } - ConditionOneOf::IsNull(is_null) => { - Ok(segment::types::Condition::IsNull(is_null.into())) - } - ConditionOneOf::Nested(nested) => Ok(segment::types::Condition::Nested( - segment::types::NestedCondition::new(nested.try_into()?), - )), - }; - } - Err(Status::invalid_argument("Malformed Condition type")) - } -} - -impl From for Condition { - fn from(value: segment::types::Condition) -> Self { - let condition_one_of = match value { - segment::types::Condition::Field(field) => ConditionOneOf::Field(field.into()), - segment::types::Condition::IsEmpty(is_empty) => { - ConditionOneOf::IsEmpty(is_empty.into()) - } - segment::types::Condition::IsNull(is_null) => ConditionOneOf::IsNull(is_null.into()), - segment::types::Condition::HasId(has_id) => ConditionOneOf::HasId(has_id.into()), - segment::types::Condition::Filter(filter) => ConditionOneOf::Filter(filter.into()), - segment::types::Condition::Nested(nested) => { - ConditionOneOf::Nested(nested.nested.into()) - } - }; - - Self { - condition_one_of: Some(condition_one_of), - } - } -} - -impl TryFrom for segment::types::Nested { - type Error = Status; - - fn try_from(value: NestedCondition) -> Result { - match value.filter { - None => Err(Status::invalid_argument( - "Nested condition must have a filter", - )), - Some(filter) => Ok(Self { - key: value.key, - filter: filter.try_into()?, - }), - } - } -} - -impl From for NestedCondition { - fn from(value: segment::types::Nested) -> Self { - Self { - key: value.key, - filter: Some(value.filter.into()), - } - } -} - -impl From for segment::types::IsEmptyCondition { - fn from(value: IsEmptyCondition) -> Self { - segment::types::IsEmptyCondition { - is_empty: segment::types::PayloadField { key: value.key }, - } - } -} - -impl From for IsEmptyCondition { - fn from(value: segment::types::IsEmptyCondition) -> Self { - Self { - key: value.is_empty.key, - } - } -} - -impl From for segment::types::IsNullCondition { - fn from(value: IsNullCondition) -> Self { - segment::types::IsNullCondition { - is_null: segment::types::PayloadField { key: value.key }, - } - } -} - -impl From for IsNullCondition { - fn from(value: segment::types::IsNullCondition) -> Self { - Self { - key: value.is_null.key, - } - } -} - -impl TryFrom for segment::types::HasIdCondition { - type Error = Status; - - fn try_from(value: HasIdCondition) -> Result { - let set: HashSet = value - .has_id - .into_iter() - .map(|p| p.try_into()) - .collect::>()?; - Ok(Self { has_id: set }) - } -} - -impl From for HasIdCondition { - fn from(value: segment::types::HasIdCondition) -> Self { - let set: Vec = value.has_id.into_iter().map(|p| p.into()).collect(); - Self { has_id: set } - } -} - -impl TryFrom for segment::types::FieldCondition { - type Error = Status; - - fn try_from(value: FieldCondition) -> Result { - let FieldCondition { - key, - r#match, - range, - geo_bounding_box, - geo_radius, - values_count, - // geo_polygon, - } = value; - - let geo_bounding_box = - geo_bounding_box.map_or_else(|| Ok(None), |g| g.try_into().map(Some))?; - let geo_radius = geo_radius.map_or_else(|| Ok(None), |g| g.try_into().map(Some))?; - let geo_polygon = None; // geo_polygon.map_or_else(|| Ok(None), |g| g.try_into().map(Some))?; - Ok(Self { - key, - r#match: r#match.map_or_else(|| Ok(None), |m| m.try_into().map(Some))?, - range: range.map(Into::into), - geo_bounding_box, - geo_radius, - geo_polygon, - values_count: values_count.map(Into::into), - }) - } -} - -impl From for FieldCondition { - fn from(value: segment::types::FieldCondition) -> Self { - let segment::types::FieldCondition { - key, - r#match, - range, - geo_bounding_box, - geo_radius, - geo_polygon: _geo_polygon, - values_count, - } = value; - - let geo_bounding_box = geo_bounding_box.map(Into::into); - let geo_radius = geo_radius.map(Into::into); - Self { - key, - r#match: r#match.map(Into::into), - range: range.map(Into::into), - geo_bounding_box, - geo_radius, - // geo_polygon: geo_polygon.map(Into::into), - values_count: values_count.map(Into::into), - } - } -} - -impl TryFrom for segment::types::GeoBoundingBox { - type Error = Status; - - fn try_from(value: GeoBoundingBox) -> Result { - match value { - GeoBoundingBox { - top_left: Some(t), - bottom_right: Some(b), - } => Ok(Self { - top_left: t.into(), - bottom_right: b.into(), - }), - _ => Err(Status::invalid_argument("Malformed GeoBoundingBox type")), - } - } -} - -impl From for GeoBoundingBox { - fn from(value: segment::types::GeoBoundingBox) -> Self { - Self { - top_left: Some(value.top_left.into()), - bottom_right: Some(value.bottom_right.into()), - } - } -} - -impl TryFrom for segment::types::GeoRadius { - type Error = Status; - - fn try_from(value: GeoRadius) -> Result { - match value { - GeoRadius { - center: Some(c), - radius, - } => Ok(Self { - center: c.into(), - radius: radius.into(), - }), - _ => Err(Status::invalid_argument("Malformed GeoRadius type")), - } - } -} - -impl From for GeoRadius { - fn from(value: segment::types::GeoRadius) -> Self { - Self { - center: Some(value.center.into()), - radius: value.radius as f32, // TODO lossy ok? - } - } -} - -impl TryFrom for segment::types::GeoPolygon { - type Error = Status; - - fn try_from(value: GeoPolygon) -> Result { - if value.points.is_empty() { - return Err(Status::invalid_argument("Empty GeoPolygon")); - } - - let points: Vec = - value.points.into_iter().map(Into::into).collect(); - - Ok(Self { points }) - } -} - -impl From for GeoPolygon { - fn from(value: segment::types::GeoPolygon) -> Self { - Self { - points: value.points.into_iter().map(Into::into).collect(), - } - } -} - -impl From for segment::types::GeoPoint { - fn from(value: GeoPoint) -> Self { - Self { - lon: value.lon, - lat: value.lat, - } - } -} - -impl From for segment::types::Range { - fn from(value: Range) -> Self { - Self { - lt: value.lt, - gt: value.gt, - gte: value.gte, - lte: value.lte, - } - } -} - -impl From for Range { - fn from(value: segment::types::Range) -> Self { - Self { - lt: value.lt, - gt: value.gt, - gte: value.gte, - lte: value.lte, - } - } -} - -impl From for segment::types::ValuesCount { - fn from(value: ValuesCount) -> Self { - Self { - lt: value.lt.map(|x| x as usize), - gt: value.gt.map(|x| x as usize), - gte: value.gte.map(|x| x as usize), - lte: value.lte.map(|x| x as usize), - } - } -} - -impl From for ValuesCount { - fn from(value: segment::types::ValuesCount) -> Self { - Self { - lt: value.lt.map(|x| x as u64), - gt: value.gt.map(|x| x as u64), - gte: value.gte.map(|x| x as u64), - lte: value.lte.map(|x| x as u64), - } - } -} - -impl TryFrom for segment::types::Match { - type Error = Status; - - fn try_from(value: Match) -> Result { - match value.match_value { - Some(mv) => Ok(match mv { - MatchValue::Keyword(kw) => kw.into(), - MatchValue::Integer(int) => int.into(), - MatchValue::Boolean(flag) => flag.into(), - MatchValue::Text(text) => segment::types::Match::Text(text.into()), - MatchValue::Keywords(kwds) => kwds.strings.into(), - MatchValue::Integers(ints) => ints.integers.into(), - MatchValue::ExceptIntegers(kwds) => { - segment::types::Match::Except(kwds.integers.into()) - } - MatchValue::ExceptKeywords(ints) => { - segment::types::Match::Except(ints.strings.into()) - } - }), - _ => Err(Status::invalid_argument("Malformed Match condition")), - } - } -} - -impl From for Match { - fn from(value: segment::types::Match) -> Self { - let match_value = match value { - segment::types::Match::Value(value) => match value.value { - segment::types::ValueVariants::Keyword(kw) => MatchValue::Keyword(kw), - segment::types::ValueVariants::Integer(int) => MatchValue::Integer(int), - segment::types::ValueVariants::Bool(flag) => MatchValue::Boolean(flag), - }, - segment::types::Match::Text(segment::types::MatchText { text }) => { - MatchValue::Text(text) - } - segment::types::Match::Any(any) => match any.any { - segment::types::AnyVariants::Keywords(strings) => { - MatchValue::Keywords(RepeatedStrings { strings }) - } - segment::types::AnyVariants::Integers(integers) => { - MatchValue::Integers(RepeatedIntegers { integers }) - } - }, - segment::types::Match::Except(except) => match except.except { - segment::types::AnyVariants::Keywords(strings) => { - MatchValue::ExceptKeywords(RepeatedStrings { strings }) - } - segment::types::AnyVariants::Integers(integers) => { - MatchValue::ExceptIntegers(RepeatedIntegers { integers }) - } - }, - }; - Self { - match_value: Some(match_value), - } - } -} - -impl From for segment::types::HnswConfig { - fn from(hnsw_config: HnswConfigDiff) -> Self { - Self { - m: hnsw_config.m.unwrap_or_default() as usize, - ef_construct: hnsw_config.ef_construct.unwrap_or_default() as usize, - full_scan_threshold: hnsw_config.full_scan_threshold.unwrap_or_default() as usize, - max_indexing_threads: hnsw_config.max_indexing_threads.unwrap_or_default() as usize, - on_disk: hnsw_config.on_disk, - payload_m: hnsw_config.payload_m.map(|x| x as usize), - } - } -} - -pub fn date_time_to_proto(date_time: NaiveDateTime) -> protobuf::Timestamp { - protobuf::Timestamp { - seconds: date_time.timestamp(), // number of non-leap seconds since the midnight on January 1, 1970. - nanos: date_time.nanosecond() as i32, - } -} - -impl TryFrom for segment::types::Distance { - type Error = Status; - - fn try_from(value: Distance) -> Result { - Ok(match value { - Distance::UnknownDistance => { - return Err(Status::invalid_argument( - "Malformed distance parameter: UnknownDistance", - )) - } - Distance::Cosine => segment::types::Distance::Cosine, - Distance::Euclid => segment::types::Distance::Euclid, - Distance::Dot => segment::types::Distance::Dot, - }) - } -} - -pub fn from_grpc_dist(dist: i32) -> Result { - match Distance::from_i32(dist) { - None => Err(Status::invalid_argument(format!( - "Malformed distance parameter, unexpected value: {dist}" - ))), - Some(grpc_distance) => Ok(grpc_distance.try_into()?), - } -} diff --git a/crates/qdrant/lib/api/src/grpc/dynamic_channel_pool.rs b/crates/qdrant/lib/api/src/grpc/dynamic_channel_pool.rs deleted file mode 100644 index 8f903f7..0000000 --- a/crates/qdrant/lib/api/src/grpc/dynamic_channel_pool.rs +++ /dev/null @@ -1,88 +0,0 @@ -use std::time::{Duration, Instant}; - -use parking_lot::Mutex; -use tonic::transport::{Channel, ClientTlsConfig, Error as TonicError, Uri}; - -use crate::grpc::dynamic_pool::{CountedItem, DynamicPool}; - -pub async fn make_grpc_channel( - timeout: Duration, - connection_timeout: Duration, - uri: Uri, - tls_config: Option, -) -> Result { - let mut endpoint = Channel::builder(uri) - .timeout(timeout) - .connect_timeout(connection_timeout); - if let Some(config) = tls_config { - endpoint = endpoint.tls_config(config)?; - } - // `connect` is using the `Reconnect` network service internally to handle dropped connections - endpoint.connect().await -} - -pub struct DynamicChannelPool { - pool: Mutex>, - init_at: Instant, - uri: Uri, - timeout: Duration, - connection_timeout: Duration, - tls_config: Option, -} - -impl DynamicChannelPool { - pub async fn new( - uri: Uri, - timeout: Duration, - connection_timeout: Duration, - tls_config: Option, - usage_per_channel: usize, - min_channels: usize, - ) -> Result { - let mut channels = Vec::with_capacity(min_channels); - for _ in 0..min_channels { - let channel = - make_grpc_channel(timeout, connection_timeout, uri.clone(), tls_config.clone()) - .await?; - channels.push(channel); - } - - let init_at = Instant::now(); - - let pool = DynamicPool::new(channels, usage_per_channel, min_channels); - Ok(Self { - pool: Mutex::new(pool), - init_at, - uri, - timeout, - connection_timeout, - tls_config, - }) - } - - pub fn init_at(&self) -> Instant { - self.init_at - } - - pub async fn choose(&self) -> Result, TonicError> { - let channel = self.pool.lock().choose(); - let channel = match channel { - None => { - let channel = make_grpc_channel( - self.timeout, - self.connection_timeout, - self.uri.clone(), - self.tls_config.clone(), - ) - .await?; - self.pool.lock().add(channel) - } - Some(channel) => channel, - }; - Ok(channel) - } - - pub fn drop_channel(&self, channel: CountedItem) { - self.pool.lock().drop_item(channel); - } -} diff --git a/crates/qdrant/lib/api/src/grpc/dynamic_pool.rs b/crates/qdrant/lib/api/src/grpc/dynamic_pool.rs deleted file mode 100644 index 5c72827..0000000 --- a/crates/qdrant/lib/api/src/grpc/dynamic_pool.rs +++ /dev/null @@ -1,246 +0,0 @@ -use std::collections::HashMap; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::Arc; -use std::time::{Duration, Instant}; - -use rand::Rng; - -#[derive(Debug)] -struct ItemWithStats { - pub item: T, - pub usage: AtomicUsize, - pub last_success: AtomicUsize, -} - -impl ItemWithStats { - fn new(item: T, last_used_since: usize) -> Self { - Self { - item, - usage: AtomicUsize::new(0), - last_success: AtomicUsize::new(last_used_since), - } - } -} - -pub struct DynamicPool { - items: HashMap>>, - /// How many times one item can be used - max_usage_per_item: usize, - /// Minimal number of items in the pool - min_items: usize, - /// Instant when the pool was created - init_at: Instant, -} - -pub struct CountedItem { - item: Arc>, - item_id: u64, - init_at: Instant, -} - -impl CountedItem { - fn new(item_id: u64, item: Arc>, init_at: Instant) -> Self { - item.usage.fetch_add(1, Ordering::Relaxed); - Self { - item, - item_id, - init_at, - } - } - - pub fn item(&self) -> &T { - &self.item.item - } - - pub fn report_success(&self) { - let time_since_init = Instant::now().duration_since(self.init_at).as_millis() as usize; - self.item - .last_success - .store(time_since_init, Ordering::Relaxed); - } - - pub fn last_success_age(&self) -> Duration { - let time_since_init = Instant::now().duration_since(self.init_at).as_millis() as usize; - let time_since_last_success = self.item.last_success.load(Ordering::Relaxed); - Duration::from_millis((time_since_init - time_since_last_success) as u64) - } -} - -impl Drop for CountedItem { - fn drop(&mut self) { - self.item.usage.fetch_sub(1, Ordering::Relaxed); - } -} - -impl DynamicPool { - fn random_idx() -> u64 { - rand::thread_rng().gen() - } - - pub fn new(items: Vec, max_usage_per_item: usize, min_items: usize) -> Self { - debug_assert!(max_usage_per_item > 0); - debug_assert!(items.len() >= min_items); - let init_at = Instant::now(); - let last_success_since = Instant::now().duration_since(init_at).as_millis() as usize; - let items = items - .into_iter() - .map(|item| { - let item = Arc::new(ItemWithStats::new(item, last_success_since)); - (Self::random_idx(), item) - }) - .collect(); - Self { - items, - max_usage_per_item, - min_items, - init_at, - } - } - - pub fn drop_item(&mut self, item: CountedItem) { - let item_id = item.item_id; - self.items.remove(&item_id); - } - - pub fn add(&mut self, item: T) -> CountedItem { - let item_with_stats = Arc::new(ItemWithStats::new( - item, - Instant::now().duration_since(self.init_at).as_millis() as usize, - )); - let item_id = Self::random_idx(); - self.items.insert(item_id, item_with_stats.clone()); - CountedItem::new(item_id, item_with_stats, self.init_at) - } - - // Returns None if current capacity is not enough - pub fn choose(&mut self) -> Option> { - if self.items.len() < self.min_items { - return None; - } - - // If all items are used too much, we cannot use any of them so we return None - let mut total_usage = 0; - let min_usage_idx = *self - .items - .iter() - .map(|(idx, item)| { - let usage = item.usage.load(Ordering::Relaxed); - total_usage += usage; - (idx, usage) - }) - .filter(|(_, min_usage)| *min_usage < self.max_usage_per_item) - .min_by_key(|(_, usage)| *usage)? - .0; - - let current_usage_capacity = self.items.len().saturating_mul(self.max_usage_per_item); - - if current_usage_capacity.saturating_sub(total_usage) - > self.max_usage_per_item.saturating_mul(2) - && self.items.len() > self.min_items - { - // We have too many items, and we have enough capacity to remove some of them - let item = self - .items - .remove(&min_usage_idx) - .expect("Item must exist, as we just found it"); - return Some(CountedItem::new(min_usage_idx, item, self.init_at)); - } - - Some(CountedItem::new( - min_usage_idx, - self.items - .get(&min_usage_idx) - .expect("Item must exist, as we just found it") - .clone(), - self.init_at, - )) - } -} - -#[cfg(test)] -mod tests { - use std::sync::atomic::{AtomicUsize, Ordering}; - - use super::*; - - async fn use_item(item: CountedItem>) { - item.item().fetch_add(1, Ordering::SeqCst); - // Sleep for 1-100 ms - tokio::time::sleep(std::time::Duration::from_millis( - rand::random::() % 100 + 1, - )) - .await; - item.item().fetch_sub(1, Ordering::SeqCst); - item.report_success(); - drop(item); - } - - #[test] - fn test_dynamic_pool() { - let items = vec![Arc::new(AtomicUsize::new(0)), Arc::new(AtomicUsize::new(0))]; - - let mut pool = DynamicPool::new(items, 5, 2); - - let mut items = vec![]; - - for _ in 0..17 { - let item = match pool.choose() { - None => pool.add(Arc::new(AtomicUsize::new(0))), - Some(it) => it, - }; - - item.item().fetch_add(1, Ordering::SeqCst); - items.push(item); - } - - assert_eq!(pool.items.len(), 4); - - for _ in 0..10 { - items.pop(); - } - - for (idx, item) in pool.items.iter() { - println!("{} -> {:?}", idx, item); - } - - assert!(pool.choose().is_some()); - - assert_eq!(pool.items.len(), 3); - } - - #[test] - fn test_dynamic_pool_with_runtime() { - let items = vec![Arc::new(AtomicUsize::new(0)), Arc::new(AtomicUsize::new(0))]; - - let runtime = tokio::runtime::Runtime::new().unwrap(); - - let mut pool = DynamicPool::new(items, 5, 2); - - let mut handles = vec![]; - for _ in 0..1000 { - let item = match pool.choose() { - None => pool.add(Arc::new(AtomicUsize::new(0))), - Some(it) => it, - }; - - let handle = runtime.spawn(async move { use_item(item).await }); - - handles.push(handle); - - // Sleep for 3 ms with std - std::thread::sleep(std::time::Duration::from_millis(2)); - } - runtime.block_on(async move { - for handle in handles { - handle.await.unwrap(); - } - }); - - pool.items.iter().for_each(|(_, item)| { - assert_eq!(item.item.load(Ordering::SeqCst), 0); - assert_eq!(item.usage.load(Ordering::SeqCst), 0); - }); - - assert!(pool.items.len() < 50); - } -} diff --git a/crates/qdrant/lib/api/src/grpc/google.protobuf.rs b/crates/qdrant/lib/api/src/grpc/google.protobuf.rs deleted file mode 100644 index 0e055ed..0000000 --- a/crates/qdrant/lib/api/src/grpc/google.protobuf.rs +++ /dev/null @@ -1,212 +0,0 @@ -/// `Struct` represents a structured data value, consisting of fields -/// which map to dynamically typed values. In some languages, `Struct` -/// might be supported by a native representation. For example, in -/// scripting languages like JS a struct is represented as an -/// object. The details of that representation are described together -/// with the proto support for the language. -/// -/// The JSON representation for `Struct` is JSON object. -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Struct { - /// Unordered map of dynamically typed values. - #[prost(map = "string, message", tag = "1")] - pub fields: ::std::collections::HashMap<::prost::alloc::string::String, Value>, -} -/// `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 these -/// variants. Absence of any variant indicates an error. -/// -/// The JSON representation for `Value` is JSON value. -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Value { - /// The kind of value. - #[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6")] - pub kind: ::core::option::Option, -} -/// Nested message and enum types in `Value`. -pub mod value { - /// The kind of value. - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Kind { - /// Represents a null value. - #[prost(enumeration = "super::NullValue", tag = "1")] - NullValue(i32), - /// Represents a double value. - #[prost(double, tag = "2")] - NumberValue(f64), - /// Represents a string value. - #[prost(string, tag = "3")] - StringValue(::prost::alloc::string::String), - /// Represents a boolean value. - #[prost(bool, tag = "4")] - BoolValue(bool), - /// Represents a structured value. - #[prost(message, tag = "5")] - StructValue(super::Struct), - /// Represents a repeated `Value`. - #[prost(message, tag = "6")] - ListValue(super::ListValue), - } -} -/// `ListValue` is a wrapper around a repeated field of values. -/// -/// The JSON representation for `ListValue` is JSON array. -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListValue { - /// Repeated field of dynamically typed values. - #[prost(message, repeated, tag = "1")] - pub values: ::prost::alloc::vec::Vec, -} -/// `NullValue` is a singleton enumeration to represent the null value for the -/// `Value` type union. -/// -/// The JSON representation for `NullValue` is JSON `null`. -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum NullValue { - /// Null value. - NullValue = 0, -} -impl NullValue { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - NullValue::NullValue => "NULL_VALUE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NULL_VALUE" => Some(Self::NullValue), - _ => None, - } - } -} -/// A Timestamp represents a point in time independent of any time zone or local -/// calendar, encoded as a count of seconds and fractions of seconds at -/// nanosecond resolution. The count is relative to an epoch at UTC midnight on -/// January 1, 1970, in the proleptic Gregorian calendar which extends the -/// Gregorian calendar backwards to year one. -/// -/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap -/// second table is needed for interpretation, using a [24-hour linear -/// smear](). -/// -/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By -/// restricting to that range, we ensure that we can convert to and from [RFC -/// 3339]() date strings. -/// -/// # Examples -/// -/// Example 1: Compute Timestamp from POSIX `time()`. -/// -/// ```text -/// Timestamp timestamp; -/// timestamp.set_seconds(time(NULL)); -/// timestamp.set_nanos(0); -/// ``` -/// -/// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -/// -/// ```text -/// struct timeval tv; -/// gettimeofday(&tv, NULL); -/// -/// Timestamp timestamp; -/// timestamp.set_seconds(tv.tv_sec); -/// timestamp.set_nanos(tv.tv_usec * 1000); -/// ``` -/// -/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -/// -/// ```text -/// FILETIME ft; -/// GetSystemTimeAsFileTime(&ft); -/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -/// -/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z -/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. -/// Timestamp timestamp; -/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); -/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -/// ``` -/// -/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -/// -/// ```text -/// long millis = System.currentTimeMillis(); -/// -/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) -/// .setNanos((int) ((millis % 1000) * 1000000)).build(); -/// ``` -/// -/// Example 5: Compute Timestamp from Java `Instant.now()`. -/// -/// ```text -/// Instant now = Instant.now(); -/// -/// Timestamp timestamp = -/// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) -/// .setNanos(now.getNano()).build(); -/// ``` -/// -/// Example 6: Compute Timestamp from current time in Python. -/// -/// ```text -/// timestamp = Timestamp() -/// timestamp.GetCurrentTime() -/// ``` -/// -/// # JSON Mapping -/// -/// In JSON format, the Timestamp type is encoded as a string in the -/// [RFC 3339]() format. That is, the -/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}\\[.{frac_sec}\\]Z" -/// where {year} is always expressed using four digits while {month}, {day}, -/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional -/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), -/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -/// is required. A proto3 JSON serializer should always use UTC (as indicated by -/// "Z") when printing the Timestamp type and a proto3 JSON parser should be -/// able to accept both UTC and other timezones (as indicated by an offset). -/// -/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past -/// 01:30 UTC on January 15, 2017. -/// -/// In JavaScript, one can convert a Date object to this format using the -/// standard -/// \[toISOString()\]() -/// method. In Python, a standard `datetime.datetime` object can be converted -/// to this format using -/// \[`strftime`\]() with -/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use -/// the Joda Time's \[`ISODateTimeFormat.dateTime()`\]()) to obtain a formatter capable of generating timestamps in this format. -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Timestamp { - /// Represents seconds of UTC time since Unix epoch - /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - /// 9999-12-31T23:59:59Z inclusive. - #[prost(int64, tag = "1")] - pub seconds: i64, - /// Non-negative fractions of a second at nanosecond resolution. Negative - /// second values with fractions must still have non-negative nanos values - /// that count forward in time. Must be from 0 to 999,999,999 - /// inclusive. - #[prost(int32, tag = "2")] - pub nanos: i32, -} diff --git a/crates/qdrant/lib/api/src/grpc/mod.rs b/crates/qdrant/lib/api/src/grpc/mod.rs deleted file mode 100644 index ac549c1..0000000 --- a/crates/qdrant/lib/api/src/grpc/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -pub mod conversions; -pub mod models; -#[allow(clippy::all)] -#[rustfmt::skip] // tonic uses `prettyplease` to format its output -pub mod qdrant; -pub mod dynamic_channel_pool; -pub mod dynamic_pool; -pub mod transport_channel_pool; -pub mod validate; - -// Include generated protobuf "well-known types". -#[path = "google.protobuf.rs"] -#[rustfmt::skip] -pub mod protobuf; - -// `prost`'s generated code expects these types -// under `google::protobuf`, so we do a little module path hack here -pub mod google { - pub use super::protobuf; -} - -pub const fn api_crate_version() -> &'static str { - env!("CARGO_PKG_VERSION") -} diff --git a/crates/qdrant/lib/api/src/grpc/models.rs b/crates/qdrant/lib/api/src/grpc/models.rs deleted file mode 100644 index 4e17dcf..0000000 --- a/crates/qdrant/lib/api/src/grpc/models.rs +++ /dev/null @@ -1,61 +0,0 @@ -use std::fmt::Debug; - -use schemars::JsonSchema; -use serde; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize)] -pub struct VersionInfo { - pub title: String, - pub version: String, -} - -impl Default for VersionInfo { - fn default() -> Self { - VersionInfo { - title: "qdrant - vector search engine".to_string(), - version: env!("CARGO_PKG_VERSION").to_string(), - } - } -} - -impl VersionInfo { - pub fn minor_version(&self) -> String { - let minor = self - .version - .split('.') - .take(2) - .collect::>() - .join("."); - format!("{}.x", minor) - } -} - -#[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub enum ApiStatus { - Ok, - Error(String), - Accepted, -} - -#[derive(Debug, Serialize, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub struct ApiResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub result: Option, - pub status: ApiStatus, - pub time: f64, -} - -#[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub struct CollectionDescription { - pub name: String, -} - -#[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub struct CollectionsResponse { - pub collections: Vec, -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/collections.proto b/crates/qdrant/lib/api/src/grpc/proto/collections.proto deleted file mode 100644 index 77becf3..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/collections.proto +++ /dev/null @@ -1,438 +0,0 @@ -syntax = "proto3"; -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 - optional bool on_disk = 5; // If true - serve vectors from disk. If set to false, the vectors will be loaded in RAM. -} - -message VectorParamsDiff { - optional HnswConfigDiff hnsw_config = 1; // Update params for HNSW index. If empty object - it will be unset - optional QuantizationConfigDiff quantization_config = 2; // Update quantization params. If none - it is left unchanged. - optional bool on_disk = 3; // If true - serve vectors from disk. If set to false, the vectors will be loaded in RAM. -} - -message VectorParamsMap { - map map = 1; -} - -message VectorParamsDiffMap { - map map = 1; -} - -message VectorsConfig { - oneof config { - VectorParams params = 1; - VectorParamsMap params_map = 2; - } -} - -message VectorsConfigDiff { - oneof config { - VectorParamsDiff params = 1; - VectorParamsDiffMap params_map = 2; - } -} - -message GetCollectionInfoRequest { - string collection_name = 1; // Name of the collection -} - -message ListCollectionsRequest { -} - -message CollectionDescription { - string name = 1; // Name of the collection -} - -message GetCollectionInfoResponse { - CollectionInfo result = 1; - double time = 2; // Time spent to process -} - -message ListCollectionsResponse { - repeated CollectionDescription collections = 1; - double time = 2; // Time spent to process -} - -enum Distance { - UnknownDistance = 0; - Cosine = 1; - Euclid = 2; - Dot = 3; -} - -enum CollectionStatus { - UnknownCollectionStatus = 0; - Green = 1; // All segments are ready - Yellow = 2; // Optimization in process - Red = 3; // Something went wrong -} - -enum PayloadSchemaType { - UnknownType = 0; - Keyword = 1; - Integer = 2; - Float = 3; - Geo = 4; - Text = 5; - Bool = 6; -} - -enum QuantizationType { - UnknownQuantization = 0; - Int8 = 1; -} - -enum CompressionRatio { - x4 = 0; - x8 = 1; - x16 = 2; - x32 = 3; - x64 = 4; -} - -message OptimizerStatus { - bool ok = 1; - string error = 2; -} - -message HnswConfigDiff { - /* - Number of edges per node in the index graph. Larger the value - more accurate the search, more space required. - */ - 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 the index. - */ - optional uint64 ef_construct = 2; - /* - Minimal size (in KiloBytes) of vectors for additional payload-based indexing. - 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: 1 Kb = 1 vector of size 256 - */ - optional uint64 full_scan_threshold = 3; - /* - Number of parallel threads used for background index building. If 0 - auto selection. - */ - optional uint64 max_indexing_threads = 4; - /* - Store HNSW index on disk. If set to false, the index will be stored in RAM. - */ - optional bool on_disk = 5; - /* - Number of additional payload-aware links per node in the index graph. If not set - regular M parameter will be used. - */ - optional uint64 payload_m = 6; -} - -message WalConfigDiff { - optional uint64 wal_capacity_mb = 1; // Size of a single WAL block file - optional uint64 wal_segments_ahead = 2; // Number of segments to create in advance -} - -message OptimizersConfigDiff { - /* - The minimal fraction of deleted vectors in a segment, required to perform segment optimization - */ - optional double deleted_threshold = 1; - /* - The minimal number of vectors in a segment, required to perform segment optimization - */ - optional uint64 vacuum_min_vector_number = 2; - /* - 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 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; - /* - Do not create segments larger this size (in kilobytes). - Large segments might require disproportionately long indexation times, - therefore it makes sense to limit the size of segments. - - If indexing speed is more important - make this parameter lower. - If search speed is more important - make this parameter higher. - Note: 1Kb = 1 vector of size 256 - If not set, will be automatically selected considering the number of available CPUs. - */ - 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. - - Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. - - To disable memmap storage, set this to `0`. - - Note: 1Kb = 1 vector of size 256 - */ - optional uint64 memmap_threshold = 5; - /* - Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing - - Default value is 20,000, based on . - - To disable vector indexing, set to `0`. - - Note: 1kB = 1 vector of size 256. - */ - optional uint64 indexing_threshold = 6; - /* - Interval between forced flushes. - */ - optional uint64 flush_interval_sec = 7; - /* - Max number of threads, which can be used for optimization. If 0 - `NUM_CPU - 1` will be used - */ - optional uint64 max_optimization_threads = 8; -} - -message ScalarQuantization { - QuantizationType type = 1; // Type of quantization - optional float quantile = 2; // Number of bits to use for quantization - optional bool always_ram = 3; // If true - quantized vectors always will be stored in RAM, ignoring the config of main storage -} - -message ProductQuantization { - CompressionRatio compression = 1; // Compression ratio - optional bool always_ram = 2; // If true - quantized vectors always will be stored in RAM, ignoring the config of main storage -} - -message QuantizationConfig { - oneof quantization { - ScalarQuantization scalar = 1; - ProductQuantization product = 2; - } -} - -message Disabled { - -} - -message QuantizationConfigDiff { - oneof quantization { - ScalarQuantization scalar = 1; - ProductQuantization product = 2; - Disabled disabled = 3; - } -} - -message CreateCollection { - string collection_name = 1; // Name of the collection - reserved 2; // Deprecated - reserved 3; // Deprecated - optional HnswConfigDiff hnsw_config = 4; // Configuration of vector index - optional WalConfigDiff wal_config = 5; // Configuration of the Write-Ahead-Log - optional OptimizersConfigDiff optimizers_config = 6; // Configuration of the optimizers - optional uint32 shard_number = 7; // Number of shards in the collection, default is 1 for standalone, otherwise equal to the number of nodes. Minimum is 1 - optional bool on_disk_payload = 8; // If true - point's payload will not be stored in memory - optional uint64 timeout = 9; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied - optional VectorsConfig vectors_config = 10; // Configuration for vectors - 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; // Quantization configuration of vector -} - -message UpdateCollection { - string collection_name = 1; // Name of the collection - optional OptimizersConfigDiff optimizers_config = 2; // New configuration parameters for the collection. This operation is blocking, it will only proceed once all current optimizations are complete - optional uint64 timeout = 3; // Wait timeout for operation commit in seconds if blocking, if not specified - default value will be supplied - optional CollectionParamsDiff params = 4; // New configuration parameters for the collection - optional HnswConfigDiff hnsw_config = 5; // New HNSW parameters for the collection index - optional VectorsConfigDiff vectors_config = 6; // New vector parameters - optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector -} - -message DeleteCollection { - string collection_name = 1; // Name of the collection - optional uint64 timeout = 2; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied -} - -message CollectionOperationResponse { - bool result = 1; // if operation made changes - double time = 2; // Time spent to process -} - -message CollectionParams { - reserved 1; // Deprecated - reserved 2; // Deprecated - uint32 shard_number = 3; // Number of shards in collection - bool on_disk_payload = 4; // If true - point's payload will not be stored in memory - optional VectorsConfig vectors_config = 5; // Configuration for vectors - optional uint32 replication_factor = 6; // Number of replicas of each shard that network tries to maintain - optional uint32 write_consistency_factor = 7; // How many replicas should apply the operation for us to consider it successful -} - -message CollectionParamsDiff { - optional uint32 replication_factor = 1; // Number of replicas of each shard that network tries to maintain - optional uint32 write_consistency_factor = 2; // How many replicas should apply the operation for us to consider it successful - optional bool on_disk_payload = 3; // If true - point's payload will not be stored in memory -} - -message CollectionConfig { - CollectionParams params = 1; // Collection parameters - HnswConfigDiff hnsw_config = 2; // Configuration of vector index - OptimizersConfigDiff optimizer_config = 3; // Configuration of the optimizers - WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log - optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization -} - -enum TokenizerType { - Unknown = 0; - Prefix = 1; - Whitespace = 2; - Word = 3; - Multilingual = 4; -} - -message TextIndexParams { - TokenizerType tokenizer = 1; // Tokenizer type - 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 -} - -message PayloadIndexParams { - oneof index_params { - TextIndexParams text_index_params = 1; // Parameters for text index - } -} - -message PayloadSchemaInfo { - PayloadSchemaType data_type = 1; // Field data type - optional PayloadIndexParams params = 2; // Field index parameters - optional uint64 points = 3; // Number of points indexed within this field indexed -} - -message CollectionInfo { - CollectionStatus status = 1; // operating condition of the collection - OptimizerStatus optimizer_status = 2; // status of collection optimizers - uint64 vectors_count = 3; // number of vectors in the collection - uint64 segments_count = 4; // Number of independent segments - reserved 5; // Deprecated - reserved 6; // Deprecated - CollectionConfig config = 7; // Configuration - map payload_schema = 8; // Collection data types - uint64 points_count = 9; // number of points in the collection - optional uint64 indexed_vectors_count = 10; // number of indexed vectors in the collection. -} - -message ChangeAliases { - repeated AliasOperations actions = 1; // List of actions - optional uint64 timeout = 2; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied -} - -message AliasOperations { - oneof action { - CreateAlias create_alias = 1; - RenameAlias rename_alias = 2; - DeleteAlias delete_alias = 3; - } -} - -message CreateAlias { - string collection_name = 1; // Name of the collection - string alias_name = 2; // New name of the alias -} - -message RenameAlias { - string old_alias_name = 1; // Name of the alias to rename - string new_alias_name = 2; // Name of the alias -} - -message DeleteAlias { - string alias_name = 1; // Name of the alias -} - -message ListAliasesRequest { -} - -message ListCollectionAliasesRequest { - string collection_name = 1; // Name of the collection -} - -message AliasDescription { - string alias_name = 1; // Name of the alias - string collection_name = 2; // Name of the collection -} - -message ListAliasesResponse { - repeated AliasDescription aliases = 1; - double time = 2; // Time spent to process -} - -message CollectionClusterInfoRequest { - string collection_name = 1; // Name of the collection -} - -enum ReplicaState { - Active = 0; // Active and sound - Dead = 1; // Failed for some reason - Partial = 2; // The shard is partially loaded and is currently receiving data from other shards - Initializing = 3; // Collection is being created - Listener = 4; // A shard which receives data, but is not used for search; Useful for backup shards -} - -message LocalShardInfo { - uint32 shard_id = 1; // Local shard id - uint64 points_count = 2; // Number of points in the shard - ReplicaState state = 3; // Is replica active -} - -message RemoteShardInfo { - uint32 shard_id = 1; // Local shard id - uint64 peer_id = 2; // Remote peer id - ReplicaState state = 3; // Is replica active -} - -message ShardTransferInfo { - uint32 shard_id = 1; // Local shard id - uint64 from = 2; - uint64 to = 3; - bool sync = 4; // If `true` transfer is a synchronization of a replicas; If `false` transfer is a moving of a shard from one peer to another -} - -message CollectionClusterInfoResponse { - uint64 peer_id = 1; // ID of this peer - uint64 shard_count = 2; // Total number of shards - repeated LocalShardInfo local_shards = 3; // Local shards - repeated RemoteShardInfo remote_shards = 4; // Remote shards - repeated ShardTransferInfo shard_transfers = 5; // Shard transfers -} - -message MoveShard { - uint32 shard_id = 1; // Local shard id - uint64 from_peer_id = 2; - uint64 to_peer_id = 3; -} - -message Replica { - uint32 shard_id = 1; - uint64 peer_id = 2; -} - -message UpdateCollectionClusterSetupRequest { - string collection_name = 1; // Name of the collection - oneof operation { - MoveShard move_shard = 2; - MoveShard replicate_shard = 3; - MoveShard abort_transfer = 4; - Replica drop_replica = 5; - } - optional uint64 timeout = 6; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied -} - -message UpdateCollectionClusterSetupResponse { - bool result = 1; -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/collections_internal_service.proto b/crates/qdrant/lib/api/src/grpc/proto/collections_internal_service.proto deleted file mode 100644 index 0f4bd26..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/collections_internal_service.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; - -import "collections.proto"; - -package qdrant; - -service CollectionsInternal { - /* - Get collection info - */ - rpc Get (GetCollectionInfoRequestInternal) returns (GetCollectionInfoResponse) {} - /* - Initiate shard transfer - */ - rpc Initiate (InitiateShardTransferRequest) returns (CollectionOperationResponse) {} -} - -message GetCollectionInfoRequestInternal { - GetCollectionInfoRequest get_collectionInfoRequest = 1; - uint32 shard_id = 2; -} - -message InitiateShardTransferRequest { - string collection_name = 1; // Name of the collection - uint32 shard_id = 2; // Id of the temporary shard -} \ No newline at end of file diff --git a/crates/qdrant/lib/api/src/grpc/proto/collections_service.proto b/crates/qdrant/lib/api/src/grpc/proto/collections_service.proto deleted file mode 100644 index 2297027..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/collections_service.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; - -import "collections.proto"; - -package qdrant; - -service Collections { - /* - Get detailed information about specified existing collection - */ - rpc Get (GetCollectionInfoRequest) returns (GetCollectionInfoResponse) {} - /* - Get list name of all existing collections - */ - rpc List (ListCollectionsRequest) returns (ListCollectionsResponse) {} - /* - Create new collection with given parameters - */ - rpc Create (CreateCollection) returns (CollectionOperationResponse) {} - /* - Update parameters of the existing collection - */ - rpc Update (UpdateCollection) returns (CollectionOperationResponse) {} - /* - Drop collection and all associated data - */ - rpc Delete (DeleteCollection) returns (CollectionOperationResponse) {} - /* - Update Aliases of the existing collection - */ - rpc UpdateAliases (ChangeAliases) returns (CollectionOperationResponse) {} - /* - Get list of all aliases for a collection - */ - rpc ListCollectionAliases (ListCollectionAliasesRequest) returns (ListAliasesResponse) {} - /* - Get list of all aliases for all existing collections - */ - rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse) {} - /* - Get cluster information for a collection - */ - rpc CollectionClusterInfo (CollectionClusterInfoRequest) returns (CollectionClusterInfoResponse) {} - /* - Update cluster setup for a collection - */ - rpc UpdateCollectionClusterSetup (UpdateCollectionClusterSetupRequest) returns (UpdateCollectionClusterSetupResponse) {} -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/json_with_int.proto b/crates/qdrant/lib/api/src/grpc/proto/json_with_int.proto deleted file mode 100644 index 3fc496e..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/json_with_int.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Fork of the google.protobuf.Value with explicit support for integer values - -syntax = "proto3"; - -package qdrant; - -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. -// -// The JSON representation for `Struct` is a JSON object. -message Struct { - // Unordered map of dynamically typed values. - map fields = 1; -} - -// `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 those -// variants, absence of any variant indicates an error. -// -// The JSON representation for `Value` is a JSON value. -message Value { - // The kind of value. - oneof kind { - // Represents a null value. - NullValue null_value = 1; - // Represents a double value. - double double_value = 2; - // Represents an integer value - int64 integer_value = 3; - // Represents a string value. - string string_value = 4; - // Represents a boolean value. - bool bool_value = 5; - // Represents a structured value. - Struct struct_value = 6; - // Represents a repeated `Value`. - ListValue list_value = 7; - } -} - -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. -// -// The JSON representation for `NullValue` is JSON `null`. -enum NullValue { - // Null value. - NULL_VALUE = 0; -} - -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is a JSON array. -message ListValue { - // Repeated field of dynamically typed values. - repeated Value values = 1; -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/points.proto b/crates/qdrant/lib/api/src/grpc/proto/points.proto deleted file mode 100644 index 4390db0..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/points.proto +++ /dev/null @@ -1,616 +0,0 @@ -syntax = "proto3"; - -package qdrant; - -import "json_with_int.proto"; -import "collections.proto"; - - -enum WriteOrderingType { - Weak = 0; // Write operations may be reordered, works faster, default - Medium = 1; // Write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change - Strong = 2; // Write operations go through the permanent leader, consistent, but may be unavailable if leader is down -} - -message WriteOrdering { - WriteOrderingType type = 1; // Write ordering guarantees -} - -enum ReadConsistencyType { - All = 0; // Send request to all nodes and return points which are present on all of them - Majority = 1; // Send requests to all nodes and return points which are present on majority of them - Quorum = 2; // Send requests to half + 1 nodes, return points which are present on all of them -} - -message ReadConsistency { - oneof value { - ReadConsistencyType type = 1; // Common read consistency configurations - uint64 factor = 2; // Send request to a specified number of nodes, and return points which are present on all of them - } -} - -// --------------------------------------------- -// ------------- Point Id Requests ------------- -// --------------------------------------------- - -message PointId { - oneof point_id_options { - uint64 num = 1; // Numerical ID of the point - string uuid = 2; // UUID - } -} - -message Vector { - repeated float data = 1; -} - -// --------------------------------------------- -// ---------------- RPC Requests --------------- -// --------------------------------------------- - -message UpsertPoints { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - repeated PointStruct points = 3; - optional WriteOrdering ordering = 4; // Write ordering guarantees -} - -message DeletePoints { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - PointsSelector points = 3; // Affected points - optional WriteOrdering ordering = 4; // Write ordering guarantees -} - -message GetPoints { - string collection_name = 1; // name of the collection - repeated PointId ids = 2; // List of points to retrieve - reserved 3; // deprecated "with_vector" field - WithPayloadSelector with_payload = 4; // Options for specifying which payload to include or not - optional WithVectorsSelector with_vectors = 5; // Options for specifying which vectors to include into response - optional ReadConsistency read_consistency = 6; // Options for specifying read consistency guarantees -} - -message UpdatePointVectors { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - repeated PointVectors points = 3; // List of points and vectors to update - optional WriteOrdering ordering = 4; // Write ordering guarantees -} - -message PointVectors { - PointId id = 1; // ID to update vectors for - Vectors vectors = 2; // Named vectors to update, leave others intact -} - -message DeletePointVectors { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - PointsSelector points_selector = 3; // Affected points - VectorsSelector vectors = 4; // List of vector names to delete - optional WriteOrdering ordering = 5; // Write ordering guarantees -} - -message SetPayloadPoints { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - map payload = 3; // New payload values - reserved 4; // List of point to modify, deprecated - optional PointsSelector points_selector = 5; // Affected points - optional WriteOrdering ordering = 6; // Write ordering guarantees -} - -message DeletePayloadPoints { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - repeated string keys = 3; // List of keys to delete - reserved 4; // Affected points, deprecated - optional PointsSelector points_selector = 5; // Affected points - optional WriteOrdering ordering = 6; // Write ordering guarantees -} - -message ClearPayloadPoints { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - PointsSelector points = 3; // Affected points - optional WriteOrdering ordering = 4; // Write ordering guarantees -} - -enum FieldType { - FieldTypeKeyword = 0; - FieldTypeInteger = 1; - FieldTypeFloat = 2; - FieldTypeGeo = 3; - FieldTypeText = 4; - FieldTypeBool = 5; -} - -message CreateFieldIndexCollection { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - string field_name = 3; // Field name to index - optional FieldType field_type = 4; // Field type. - optional PayloadIndexParams field_index_params = 5; // Payload index params. - optional WriteOrdering ordering = 6; // Write ordering guarantees -} - -message DeleteFieldIndexCollection { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - string field_name = 3; // Field name to delete - optional WriteOrdering ordering = 4; // Write ordering guarantees -} - -message PayloadIncludeSelector { - repeated string fields = 1; // List of payload keys to include into result -} - -message PayloadExcludeSelector { - repeated string fields = 1; // List of payload keys to exclude from the result -} - -message WithPayloadSelector { - oneof selector_options { - bool enable = 1; // If `true` - return all payload, if `false` - none - PayloadIncludeSelector include = 2; - PayloadExcludeSelector exclude = 3; - } -} - -message NamedVectors { - map vectors = 1; -} - -message Vectors { - oneof vectors_options { - Vector vector = 1; - NamedVectors vectors = 2; - } -} - -message VectorsSelector { - repeated string names = 1; // List of vectors to include into result -} - -message WithVectorsSelector { - oneof selector_options { - bool enable = 1; // If `true` - return all vectors, if `false` - none - VectorsSelector include = 2; // List of payload keys to include into result - } -} - -message QuantizationSearchParams { - /* - If set to true, search will ignore quantized vector data - */ - optional bool ignore = 1; - - /* - If true, use original vectors to re-score top-k results. Default is true. - */ - optional bool rescore = 2; - - /* - Oversampling factor for quantization. - - Defines how many extra vectors should be pre-selected using quantized index, - and then re-scored using original vectors. - - For example, if `oversampling` is 2.4 and `limit` is 100, then 240 vectors will be pre-selected using quantized index, - and then top-100 will be returned after re-scoring. - */ - optional double oversampling = 3; -} - -message SearchParams { - /* - Params relevant to HNSW index. Size of the beam in a beam-search. - Larger the value - more accurate the result, more time required for search. - */ - optional uint64 hnsw_ef = 1; - - /* - Search without approximation. If set to true, search may run long but with exact results. - */ - optional bool exact = 2; - - /* - If set to true, search will ignore quantized vector data - */ - optional QuantizationSearchParams quantization = 3; -} - -message SearchPoints { - string collection_name = 1; // name of the collection - repeated float vector = 2; // vector - Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions - uint64 limit = 4; // Max number of result - reserved 5; // deprecated "with_vector" field - WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not - SearchParams params = 7; // Search config - optional float score_threshold = 8; // If provided - cut off results with worse scores - optional uint64 offset = 9; // Offset of the result - optional string vector_name = 10; // Which vector to use for search, if not specified - use default vector - optional WithVectorsSelector with_vectors = 11; // Options for specifying which vectors to include into response - optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees -} - -message SearchBatchPoints { - string collection_name = 1; // Name of the collection - repeated SearchPoints search_points = 2; - optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees -} - -message WithLookup { - string collection = 1; // Name of the collection to use for points lookup - optional WithPayloadSelector with_payload = 2; // Options for specifying which payload to include (or not) - optional WithVectorsSelector with_vectors = 3; // Options for specifying which vectors to include (or not) -} - - -message SearchPointGroups { - string collection_name = 1; // Name of the collection - repeated float vector = 2; // Vector to compare against - Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions - uint32 limit = 4; // Max number of result - WithPayloadSelector with_payload = 5; // Options for specifying which payload to include or not - SearchParams params = 6; // Search config - optional float score_threshold = 7; // If provided - cut off results with worse scores - optional string vector_name = 8; // Which vector to use for search, if not specified - use default vector - optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response - string group_by = 10; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups. - uint32 group_size = 11; // Maximum amount of points to return per group - optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees - optional WithLookup with_lookup = 13; // Options for specifying how to use the group id to lookup points in another collection -} - -message ScrollPoints { - string collection_name = 1; - Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions - optional PointId offset = 3; // Start with this ID - optional uint32 limit = 4; // Max number of result - reserved 5; // deprecated "with_vector" field - WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not - optional WithVectorsSelector with_vectors = 7; // Options for specifying which vectors to include into response - optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees -} - -message LookupLocation { - string collection_name = 1; - optional string vector_name = 2; // Which vector to use for search, if not specified - use default vector -} - -message RecommendPoints { - string collection_name = 1; // name of the collection - repeated PointId positive = 2; // Look for vectors closest to those - repeated PointId negative = 3; // Try to avoid vectors like this - Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions - uint64 limit = 5; // Max number of result - reserved 6; // deprecated "with_vector" field - WithPayloadSelector with_payload = 7; // Options for specifying which payload to include or not - SearchParams params = 8; // Search config - optional float score_threshold = 9; // If provided - cut off results with worse scores - optional uint64 offset = 10; // Offset of the result - optional string using = 11; // Define which vector to use for recommendation, if not specified - default vector - optional WithVectorsSelector with_vectors = 12; // Options for specifying which vectors to include into response - optional LookupLocation lookup_from = 13; // Name of the collection to use for points lookup, if not specified - use current collection - optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees -} - -message RecommendBatchPoints { - string collection_name = 1; // Name of the collection - repeated RecommendPoints recommend_points = 2; - optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees -} - -message RecommendPointGroups { - string collection_name = 1; // Name of the collection - repeated PointId positive = 2; // Look for vectors closest to those - repeated PointId negative = 3; // Try to avoid vectors like this - Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions - uint32 limit = 5; // Max number of groups in result - WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not - SearchParams params = 7; // Search config - optional float score_threshold = 8; // If provided - cut off results with worse scores - optional string using = 9; // Define which vector to use for recommendation, if not specified - default vector - optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into response - optional LookupLocation lookup_from = 11; // Name of the collection to use for points lookup, if not specified - use current collection - string group_by = 12; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups. - uint32 group_size = 13; // Maximum amount of points to return per group - optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees - optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection -} - -message CountPoints { - string collection_name = 1; // name of the collection - Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions - optional bool exact = 3; // If `true` - return exact count, if `false` - return approximate count -} - -message PointsUpdateOperation { - message PointStructList { - repeated PointStruct points = 1; - } - message SetPayload { - map payload = 1; - optional PointsSelector points_selector = 2; // Affected points - } - message DeletePayload { - repeated string keys = 1; - optional PointsSelector points_selector = 2; // Affected points - } - message UpdateVectors { - repeated PointVectors points = 1; // List of points and vectors to update - } - message DeleteVectors { - PointsSelector points_selector = 1; // Affected points - VectorsSelector vectors = 2; // List of vector names to delete - } - - oneof operation { - PointStructList upsert = 1; - PointsSelector delete = 2; - SetPayload set_payload = 3; - SetPayload overwrite_payload = 4; - DeletePayload delete_payload = 5; - PointsSelector clear_payload = 6; - UpdateVectors update_vectors = 7; - DeleteVectors delete_vectors = 8; - } -} - -message UpdateBatchPoints { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - repeated PointsUpdateOperation operations = 3; - optional WriteOrdering ordering = 4; // Write ordering guarantees -} - -// --------------------------------------------- -// ---------------- RPC Response --------------- -// --------------------------------------------- - -message PointsOperationResponse { - UpdateResult result = 1; - double time = 2; // Time spent to process -} - -message UpdateResult { - uint64 operation_id = 1; // Number of operation - UpdateStatus status = 2; // Operation status -} - -enum UpdateStatus { - UnknownUpdateStatus = 0; - Acknowledged = 1; // Update is received, but not processed yet - Completed = 2; // Update is applied and ready for search -} - -message ScoredPoint { - PointId id = 1; // Point id - map payload = 2; // Payload - float score = 3; // Similarity score - reserved 4; // deprecated "vector" field - uint64 version = 5; // Last update operation applied to this point - optional Vectors vectors = 6; // Vectors to search -} - -message GroupId { - oneof kind { - // Represents a double value. - uint64 unsigned_value = 1; - // Represents an integer value - int64 integer_value = 2; - // Represents a string value. - string string_value = 3; - } -} - -message PointGroup { - GroupId id = 1; // Group id - repeated ScoredPoint hits = 2; // Points in the group - RetrievedPoint lookup = 3; // Point(s) from the lookup collection that matches the group id -} - -message GroupsResult { - repeated PointGroup groups = 1; // Groups -} - -message SearchResponse { - repeated ScoredPoint result = 1; - double time = 2; // Time spent to process -} - -message BatchResult { - repeated ScoredPoint result = 1; -} - -message SearchBatchResponse { - repeated BatchResult result = 1; - double time = 2; // Time spent to process -} - -message SearchGroupsResponse { - GroupsResult result = 1; - double time = 2; // Time spent to process -} - -message CountResponse { - CountResult result = 1; - double time = 2; // Time spent to process -} - -message ScrollResponse { - optional PointId next_page_offset = 1; // Use this offset for the next query - repeated RetrievedPoint result = 2; - double time = 3; // Time spent to process -} - -message CountResult { - uint64 count = 1; -} - -message RetrievedPoint { - PointId id = 1; - map payload = 2; - reserved 3; // deprecated "vector" field - optional Vectors vectors = 4; -} - -message GetResponse { - repeated RetrievedPoint result = 1; - double time = 2; // Time spent to process -} - -message RecommendResponse { - repeated ScoredPoint result = 1; - double time = 2; // Time spent to process -} - -message RecommendBatchResponse { - repeated BatchResult result = 1; - double time = 2; // Time spent to process -} - -message RecommendGroupsResponse { - GroupsResult result = 1; - double time = 2; // Time spent to process -} - -message UpdateBatchResponse { - repeated UpdateResult result = 1; - double time = 2; // Time spent to process -} - -// --------------------------------------------- -// ------------- Filter Conditions ------------- -// --------------------------------------------- - -message Filter { - repeated Condition should = 1; // At least one of those conditions should match - repeated Condition must = 2; // All conditions must match - repeated Condition must_not = 3; // All conditions must NOT match -} - -message Condition { - oneof condition_one_of { - FieldCondition field = 1; - IsEmptyCondition is_empty = 2; - HasIdCondition has_id = 3; - Filter filter = 4; - IsNullCondition is_null = 5; - NestedCondition nested = 6; - } -} - -message IsEmptyCondition { - string key = 1; -} - -message IsNullCondition { - string key = 1; -} - -message HasIdCondition { - repeated PointId has_id = 1; -} - -message NestedCondition { - string key = 1; // Path to nested object - Filter filter = 2; // Filter condition -} - -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 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 - // GeoPolygon geo_polygon = 7; // Check if geo point is within a given polygon -} - -message Match { - oneof match_value { - string keyword = 1; // Match string keyword - int64 integer = 2; // Match integer - bool boolean = 3; // Match boolean - string text = 4; // Match text - RepeatedStrings keywords = 5; // Match multiple keywords - RepeatedIntegers integers = 6; // Match multiple integers - RepeatedIntegers except_integers = 7; // Match any other value except those integers - RepeatedStrings except_keywords = 8; // Match any other value except those keywords - } -} - -message RepeatedStrings { - repeated string strings = 1; -} - -message RepeatedIntegers { - repeated int64 integers = 1; -} - -message Range { - optional double lt = 1; - optional double gt = 2; - optional double gte = 3; - optional double lte = 4; -} - -message GeoBoundingBox { - GeoPoint top_left = 1; // north-west corner - GeoPoint bottom_right = 2; // south-east corner -} - -message GeoRadius { - GeoPoint center = 1; // Center of the circle - float radius = 2; // In meters -} - -message GeoPolygon { - // Ordered list of coordinates representing the vertices of a polygon. - // The minimum size is 4, and the first coordinate and the last coordinate - // should be the same to form a closed polygon. - repeated GeoPoint points = 1; -} - -message ValuesCount { - optional uint64 lt = 1; - optional uint64 gt = 2; - optional uint64 gte = 3; - optional uint64 lte = 4; -} - -// --------------------------------------------- -// -------------- Points Selector -------------- -// --------------------------------------------- - -message PointsSelector { - oneof points_selector_one_of { - PointsIdsList points = 1; - Filter filter = 2; - } -} - -message PointsIdsList { - repeated PointId ids = 1; -} - -// --------------------------------------------- -// ------------------- Point ------------------- -// --------------------------------------------- - - -message PointStruct { - PointId id = 1; - reserved 2; // deprecated "vector" field - map payload = 3; - optional Vectors vectors = 4; -} - - -message GeoPoint { - double lon = 1; - double lat = 2; -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/points_internal_service.proto b/crates/qdrant/lib/api/src/grpc/proto/points_internal_service.proto deleted file mode 100644 index cbce163..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/points_internal_service.proto +++ /dev/null @@ -1,118 +0,0 @@ -syntax = "proto3"; - -import "points.proto"; - -package qdrant; - -import "google/protobuf/struct.proto"; - -service PointsInternal { - rpc Upsert (UpsertPointsInternal) returns (PointsOperationResponse) {} - rpc Sync (SyncPointsInternal) returns (PointsOperationResponse) {} - rpc Delete (DeletePointsInternal) returns (PointsOperationResponse) {} - rpc UpdateVectors (UpdateVectorsInternal) returns (PointsOperationResponse) {} - rpc DeleteVectors (DeleteVectorsInternal) returns (PointsOperationResponse) {} - rpc SetPayload (SetPayloadPointsInternal) returns (PointsOperationResponse) {} - rpc OverwritePayload (SetPayloadPointsInternal) returns (PointsOperationResponse) {} - rpc DeletePayload (DeletePayloadPointsInternal) returns (PointsOperationResponse) {} - rpc ClearPayload (ClearPayloadPointsInternal) returns (PointsOperationResponse) {} - rpc CreateFieldIndex (CreateFieldIndexCollectionInternal) returns (PointsOperationResponse) {} - rpc DeleteFieldIndex (DeleteFieldIndexCollectionInternal) returns (PointsOperationResponse) {} - rpc Search (SearchPointsInternal) returns (SearchResponse) {} - rpc SearchBatch (SearchBatchPointsInternal) returns (SearchBatchResponse) {} - rpc Scroll (ScrollPointsInternal) returns (ScrollResponse) {} - rpc Count (CountPointsInternal) returns (CountResponse) {} - rpc Recommend (RecommendPointsInternal) returns (RecommendResponse) {} - rpc Get (GetPointsInternal) returns (GetResponse) {} -} - - -message SyncPoints { - string collection_name = 1; // name of the collection - optional bool wait = 2; // Wait until the changes have been applied? - repeated PointStruct points = 3; - optional PointId from_id = 4; // Start of the sync range - optional PointId to_id = 5; // End of the sync range - optional WriteOrdering ordering = 6; -} - -message SyncPointsInternal { - SyncPoints sync_points = 1; - optional uint32 shard_id = 2; -} - -message UpsertPointsInternal { - UpsertPoints upsert_points = 1; - optional uint32 shard_id = 2; -} - -message DeletePointsInternal { - DeletePoints delete_points = 1; - optional uint32 shard_id = 2; -} - -message UpdateVectorsInternal { - UpdatePointVectors update_vectors = 1; - optional uint32 shard_id = 2; -} - -message DeleteVectorsInternal { - DeletePointVectors delete_vectors = 1; - optional uint32 shard_id = 2; -} - -message SetPayloadPointsInternal { - SetPayloadPoints set_payload_points = 1; - optional uint32 shard_id = 2; -} - -message DeletePayloadPointsInternal { - DeletePayloadPoints delete_payload_points = 1; - optional uint32 shard_id = 2; -} - -message ClearPayloadPointsInternal { - ClearPayloadPoints clear_payload_points = 1; - optional uint32 shard_id = 2; -} - -message CreateFieldIndexCollectionInternal { - CreateFieldIndexCollection create_field_index_collection = 1; - optional uint32 shard_id = 2; -} - -message DeleteFieldIndexCollectionInternal { - DeleteFieldIndexCollection delete_field_index_collection = 1; - optional uint32 shard_id = 2; -} - -message SearchPointsInternal { - SearchPoints search_points = 1; - optional uint32 shard_id = 2; -} - -message SearchBatchPointsInternal { - string collection_name = 1; - repeated SearchPoints search_points = 2; - optional uint32 shard_id = 3; -} - -message ScrollPointsInternal { - ScrollPoints scroll_points = 1; - optional uint32 shard_id = 2; -} - -message RecommendPointsInternal { - RecommendPoints recommend_points = 1; - optional uint32 shard_id = 2; -} - -message GetPointsInternal { - GetPoints get_points = 1; - optional uint32 shard_id = 2; -} - -message CountPointsInternal { - CountPoints count_points = 1; - optional uint32 shard_id = 2; -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/points_service.proto b/crates/qdrant/lib/api/src/grpc/proto/points_service.proto deleted file mode 100644 index 607e116..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/points_service.proto +++ /dev/null @@ -1,91 +0,0 @@ -syntax = "proto3"; - -import "points.proto"; - -package qdrant; - -import "google/protobuf/struct.proto"; - -service Points { - /* - Perform insert + updates on points. If a point with a given ID already exists - it will be overwritten. - */ - rpc Upsert (UpsertPoints) returns (PointsOperationResponse) {} - /* - Delete points - */ - rpc Delete (DeletePoints) returns (PointsOperationResponse) {} - /* - Retrieve points - */ - rpc Get (GetPoints) returns (GetResponse) {} - /* - Update named vectors for point - */ - rpc UpdateVectors (UpdatePointVectors) returns (PointsOperationResponse) {} - /* - Delete named vectors for points - */ - rpc DeleteVectors (DeletePointVectors) returns (PointsOperationResponse) {} - /* - Set payload for points - */ - rpc SetPayload (SetPayloadPoints) returns (PointsOperationResponse) {} - /* - Overwrite payload for points - */ - rpc OverwritePayload (SetPayloadPoints) returns (PointsOperationResponse) {} - /* - Delete specified key payload for points - */ - rpc DeletePayload (DeletePayloadPoints) returns (PointsOperationResponse) {} - /* - Remove all payload for specified points - */ - rpc ClearPayload (ClearPayloadPoints) returns (PointsOperationResponse) {} - /* - Create index for field in collection - */ - rpc CreateFieldIndex (CreateFieldIndexCollection) returns (PointsOperationResponse) {} - /* - Delete field index for collection - */ - rpc DeleteFieldIndex (DeleteFieldIndexCollection) returns (PointsOperationResponse) {} - /* - Retrieve closest points based on vector similarity and given filtering conditions - */ - rpc Search (SearchPoints) returns (SearchResponse) {} - /* - Retrieve closest points based on vector similarity and given filtering conditions - */ - rpc SearchBatch (SearchBatchPoints) returns (SearchBatchResponse) {} - /* - Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given field - */ - rpc SearchGroups (SearchPointGroups) returns (SearchGroupsResponse) {} - /* - Iterate over all or filtered points points - */ - rpc Scroll (ScrollPoints) returns (ScrollResponse) {} - /* - Look for the points which are closer to stored positive examples and at the same time further to negative examples. - */ - rpc Recommend (RecommendPoints) returns (RecommendResponse) {} - /* - Look for the points which are closer to stored positive examples and at the same time further to negative examples. - */ - rpc RecommendBatch (RecommendBatchPoints) returns (RecommendBatchResponse) {} - /* - Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given field - */ - rpc RecommendGroups (RecommendPointGroups) returns (RecommendGroupsResponse) {} - /* - Count points in collection with given filtering conditions - */ - rpc Count (CountPoints) returns (CountResponse) {} - - /* - Perform multiple update operations in one request - */ - rpc UpdateBatch (UpdateBatchPoints) returns (UpdateBatchResponse) {} -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/qdrant.proto b/crates/qdrant/lib/api/src/grpc/proto/qdrant.proto deleted file mode 100644 index 534c93a..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/qdrant.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; - -import "collections_service.proto"; -import "collections_internal_service.proto"; -import "points_service.proto"; -import "points_internal_service.proto"; -import "raft_service.proto"; -import "snapshots_service.proto"; - -package qdrant; - -service Qdrant { - rpc HealthCheck (HealthCheckRequest) returns (HealthCheckReply) {} -} - -message HealthCheckRequest { -} - -message HealthCheckReply { - string title = 1; - string version = 2; -} diff --git a/crates/qdrant/lib/api/src/grpc/proto/raft_service.proto b/crates/qdrant/lib/api/src/grpc/proto/raft_service.proto deleted file mode 100644 index b1d6caf..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/raft_service.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package qdrant; - -import "google/protobuf/empty.proto"; - -service Raft { - // Send Raft message to another peer - rpc Send (RaftMessage) returns (google.protobuf.Empty); - // Send to bootstrap peer - // Returns uri by id if bootstrap knows this peer - rpc WhoIs (PeerId) returns (Uri); - // Send to bootstrap peer - // Adds peer to the network - // Returns all peers - rpc AddPeerToKnown (AddPeerToKnownMessage) returns (AllPeers); - // DEPRECATED - // Its functionality is now included in `AddPeerToKnown` - // - // Send to bootstrap peer - // Proposes to add this peer as participant of consensus - rpc AddPeerAsParticipant (PeerId) returns (google.protobuf.Empty); -} - -message RaftMessage { - bytes message = 1; -} - -message AllPeers { - repeated Peer all_peers = 1; - uint64 first_peer_id = 2; -} - -message Peer { - string uri = 1; - uint64 id = 2; -} - -message AddPeerToKnownMessage { - optional string uri = 1; - optional uint32 port = 2; - uint64 id = 3; -} - -message PeerId { - uint64 id = 1; -} - -message Uri { - string uri = 1; -} \ No newline at end of file diff --git a/crates/qdrant/lib/api/src/grpc/proto/snapshots_service.proto b/crates/qdrant/lib/api/src/grpc/proto/snapshots_service.proto deleted file mode 100644 index 5770268..0000000 --- a/crates/qdrant/lib/api/src/grpc/proto/snapshots_service.proto +++ /dev/null @@ -1,75 +0,0 @@ -syntax = "proto3"; - -package qdrant; - -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -service Snapshots { - /* - Create collection snapshot - */ - rpc Create (CreateSnapshotRequest) returns (CreateSnapshotResponse) {} - /* - List collection snapshots - */ - rpc List (ListSnapshotsRequest) returns (ListSnapshotsResponse) {} - /* - Delete collection snapshots - */ - rpc Delete (DeleteSnapshotRequest) returns (DeleteSnapshotResponse) {} - /* - Create full storage snapshot - */ - rpc CreateFull (CreateFullSnapshotRequest) returns (CreateSnapshotResponse) {} - /* - List full storage snapshots - */ - rpc ListFull (ListFullSnapshotsRequest) returns (ListSnapshotsResponse) {} - /* - List full storage snapshots - */ - rpc DeleteFull (DeleteFullSnapshotRequest) returns (DeleteSnapshotResponse) {} - -} - -message CreateFullSnapshotRequest {} - -message ListFullSnapshotsRequest {} - -message DeleteFullSnapshotRequest { - string snapshot_name = 1; // Name of the full snapshot -} - -message CreateSnapshotRequest { - string collection_name = 1; // Name of the collection -} - -message ListSnapshotsRequest { - string collection_name = 1; // Name of the collection -} - -message DeleteSnapshotRequest { - string collection_name = 1; // Name of the collection - string snapshot_name = 2; // Name of the collection snapshot -} - -message SnapshotDescription { - string name = 1; // Name of the snapshot - google.protobuf.Timestamp creation_time = 2; // Creation time of the snapshot - int64 size = 3; // Size of the snapshot in bytes -} - -message CreateSnapshotResponse { - SnapshotDescription snapshot_description = 1; - double time = 2; // Time spent to process -} - -message ListSnapshotsResponse { - repeated SnapshotDescription snapshot_descriptions = 1; - double time = 2; // Time spent to process -} - -message DeleteSnapshotResponse { - double time = 1; // Time spent to process -} diff --git a/crates/qdrant/lib/api/src/grpc/qdrant.rs b/crates/qdrant/lib/api/src/grpc/qdrant.rs deleted file mode 100644 index d4c3fae..0000000 --- a/crates/qdrant/lib/api/src/grpc/qdrant.rs +++ /dev/null @@ -1,9058 +0,0 @@ -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VectorParams { - /// Size of the vectors - #[prost(uint64, tag = "1")] - #[validate(range(min = 1))] - pub size: u64, - /// 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")] - #[validate] - pub hnsw_config: ::core::option::Option, - /// Configuration of vector quantization config. If omitted - the collection configuration will be used - #[prost(message, optional, tag = "4")] - #[validate] - pub quantization_config: ::core::option::Option, - /// If true - serve vectors from disk. If set to false, the vectors will be loaded in RAM. - #[prost(bool, optional, tag = "5")] - pub on_disk: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VectorParamsDiff { - /// Update params for HNSW index. If empty object - it will be unset - #[prost(message, optional, tag = "1")] - #[validate] - pub hnsw_config: ::core::option::Option, - /// Update quantization params. If none - it is left unchanged. - #[prost(message, optional, tag = "2")] - #[validate] - pub quantization_config: ::core::option::Option, - /// If true - serve vectors from disk. If set to false, the vectors will be loaded in RAM. - #[prost(bool, optional, tag = "3")] - pub on_disk: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VectorParamsMap { - #[prost(map = "string, message", tag = "1")] - #[validate] - pub map: ::std::collections::HashMap<::prost::alloc::string::String, VectorParams>, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VectorParamsDiffMap { - #[prost(map = "string, message", tag = "1")] - #[validate] - pub map: ::std::collections::HashMap< - ::prost::alloc::string::String, - VectorParamsDiff, - >, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VectorsConfig { - #[prost(oneof = "vectors_config::Config", tags = "1, 2")] - #[validate] - pub config: ::core::option::Option, -} -/// Nested message and enum types in `VectorsConfig`. -pub mod vectors_config { - #[derive(serde::Serialize)] - #[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), - } -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VectorsConfigDiff { - #[prost(oneof = "vectors_config_diff::Config", tags = "1, 2")] - #[validate] - pub config: ::core::option::Option, -} -/// Nested message and enum types in `VectorsConfigDiff`. -pub mod vectors_config_diff { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Config { - #[prost(message, tag = "1")] - Params(super::VectorParamsDiff), - #[prost(message, tag = "2")] - ParamsMap(super::VectorParamsDiffMap), - } -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionInfoRequest { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListCollectionsRequest {} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionDescription { - /// Name of the collection - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[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, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HnswConfigDiff { - /// Number of edges per node in the index graph. Larger the value - more accurate the search, more space required. - #[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 the index. - #[prost(uint64, optional, tag = "2")] - #[validate(custom = "crate::grpc::validate::validate_u64_range_min_4")] - pub ef_construct: ::core::option::Option, - /// Minimal size (in KiloBytes) of vectors for additional payload-based indexing. - /// 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: 1 Kb = 1 vector of size 256 - #[prost(uint64, optional, tag = "3")] - pub full_scan_threshold: ::core::option::Option, - /// Number of parallel threads used for background index building. If 0 - auto selection. - #[prost(uint64, optional, tag = "4")] - pub max_indexing_threads: ::core::option::Option, - /// 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, - /// Number of additional payload-aware links per node in the index graph. If not set - regular M parameter will be used. - #[prost(uint64, optional, tag = "6")] - pub payload_m: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WalConfigDiff { - /// Size of a single WAL block file - #[prost(uint64, optional, tag = "1")] - #[validate(custom = "crate::grpc::validate::validate_u64_range_min_1")] - pub wal_capacity_mb: ::core::option::Option, - /// Number of segments to create in advance - #[prost(uint64, optional, tag = "2")] - pub wal_segments_ahead: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct OptimizersConfigDiff { - /// The minimal fraction of deleted vectors in a segment, required to perform segment optimization - #[prost(double, optional, tag = "1")] - #[validate(custom = "crate::grpc::validate::validate_f64_range_1")] - pub deleted_threshold: ::core::option::Option, - /// The minimal number of vectors in a segment, required to perform segment optimization - #[prost(uint64, optional, tag = "2")] - #[validate(custom = "crate::grpc::validate::validate_u64_range_min_100")] - pub vacuum_min_vector_number: ::core::option::Option, - /// 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 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, - /// Do not create segments larger this size (in kilobytes). - /// Large segments might require disproportionately long indexation times, - /// therefore it makes sense to limit the size of segments. - /// - /// If indexing speed is more important - make this parameter lower. - /// If search speed is more important - make this parameter higher. - /// Note: 1Kb = 1 vector of size 256 - /// If not set, will be automatically selected considering the number of available CPUs. - #[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. - /// - /// Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. - /// - /// To disable memmap storage, set this to `0`. - /// - /// Note: 1Kb = 1 vector of size 256 - #[prost(uint64, optional, tag = "5")] - pub memmap_threshold: ::core::option::Option, - /// Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing - /// - /// Default value is 20,000, based on <.> - /// - /// To disable vector indexing, set to `0`. - /// - /// Note: 1kB = 1 vector of size 256. - #[prost(uint64, optional, tag = "6")] - pub indexing_threshold: ::core::option::Option, - /// Interval between forced flushes. - #[prost(uint64, optional, tag = "7")] - pub flush_interval_sec: ::core::option::Option, - /// Max number of threads, which can be used for optimization. If 0 - `NUM_CPU - 1` will be used - #[prost(uint64, optional, tag = "8")] - pub max_optimization_threads: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScalarQuantization { - /// Type of quantization - #[prost(enumeration = "QuantizationType", tag = "1")] - pub r#type: i32, - /// Number of bits to use for quantization - #[prost(float, optional, tag = "2")] - #[validate(custom = "crate::grpc::validate::validate_f32_range_min_0_5_max_1")] - pub quantile: ::core::option::Option, - /// If true - quantized vectors always will be stored in RAM, ignoring the config of main storage - #[prost(bool, optional, tag = "3")] - pub always_ram: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProductQuantization { - /// Compression ratio - #[prost(enumeration = "CompressionRatio", tag = "1")] - pub compression: i32, - /// If true - quantized vectors always will be stored in RAM, ignoring the config of main storage - #[prost(bool, optional, tag = "2")] - pub always_ram: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuantizationConfig { - #[prost(oneof = "quantization_config::Quantization", tags = "1, 2")] - #[validate] - pub quantization: ::core::option::Option, -} -/// Nested message and enum types in `QuantizationConfig`. -pub mod quantization_config { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Quantization { - #[prost(message, tag = "1")] - Scalar(super::ScalarQuantization), - #[prost(message, tag = "2")] - Product(super::ProductQuantization), - } -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Disabled {} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuantizationConfigDiff { - #[prost(oneof = "quantization_config_diff::Quantization", tags = "1, 2, 3")] - #[validate] - pub quantization: ::core::option::Option, -} -/// Nested message and enum types in `QuantizationConfigDiff`. -pub mod quantization_config_diff { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Quantization { - #[prost(message, tag = "1")] - Scalar(super::ScalarQuantization), - #[prost(message, tag = "2")] - Product(super::ProductQuantization), - #[prost(message, tag = "3")] - Disabled(super::Disabled), - } -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateCollection { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate( - length(min = 1, max = 255), - custom = "crate::grpc::validate::validate_collection_name" - )] - pub collection_name: ::prost::alloc::string::String, - /// Configuration of vector index - #[prost(message, optional, tag = "4")] - #[validate] - pub hnsw_config: ::core::option::Option, - /// Configuration of the Write-Ahead-Log - #[prost(message, optional, tag = "5")] - #[validate] - pub wal_config: ::core::option::Option, - /// Configuration of the optimizers - #[prost(message, optional, tag = "6")] - #[validate] - pub optimizers_config: ::core::option::Option, - /// Number of shards in the collection, default is 1 for standalone, otherwise equal to the number of nodes. Minimum is 1 - #[prost(uint32, optional, tag = "7")] - pub shard_number: ::core::option::Option, - /// If true - point's payload will not be stored in memory - #[prost(bool, optional, tag = "8")] - pub on_disk_payload: ::core::option::Option, - /// Wait timeout for operation commit in seconds, if not specified - default value will be supplied - #[prost(uint64, optional, tag = "9")] - pub timeout: ::core::option::Option, - /// Configuration for vectors - #[prost(message, optional, tag = "10")] - #[validate] - pub vectors_config: ::core::option::Option, - /// Number of replicas of each shard that network tries to maintain, default = 1 - #[prost(uint32, optional, tag = "11")] - pub replication_factor: ::core::option::Option, - /// How many replicas should apply the operation for us to consider it successful, default = 1 - #[prost(uint32, optional, tag = "12")] - pub write_consistency_factor: ::core::option::Option, - /// 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")] - #[validate] - pub quantization_config: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollection { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// New configuration parameters for the collection. This operation is blocking, it will only proceed once all current optimizations are complete - #[prost(message, optional, tag = "2")] - #[validate] - pub optimizers_config: ::core::option::Option, - /// Wait timeout for operation commit in seconds if blocking, if not specified - default value will be supplied - #[prost(uint64, optional, tag = "3")] - #[validate(custom = "crate::grpc::validate::validate_u64_range_min_1")] - pub timeout: ::core::option::Option, - /// New configuration parameters for the collection - #[prost(message, optional, tag = "4")] - #[validate] - pub params: ::core::option::Option, - /// New HNSW parameters for the collection index - #[prost(message, optional, tag = "5")] - #[validate] - pub hnsw_config: ::core::option::Option, - /// New vector parameters - #[prost(message, optional, tag = "6")] - #[validate] - pub vectors_config: ::core::option::Option, - /// Quantization configuration of vector - #[prost(message, optional, tag = "7")] - #[validate] - pub quantization_config: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteCollection { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait timeout for operation commit in seconds, if not specified - default value will be supplied - #[prost(uint64, optional, tag = "2")] - #[validate(custom = "crate::grpc::validate::validate_u64_range_min_1")] - pub timeout: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionOperationResponse { - /// if operation made changes - #[prost(bool, tag = "1")] - pub result: bool, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionParams { - /// Number of shards in collection - #[prost(uint32, tag = "3")] - pub shard_number: u32, - /// If true - point's payload will not be stored in memory - #[prost(bool, tag = "4")] - pub on_disk_payload: bool, - /// Configuration for vectors - #[prost(message, optional, tag = "5")] - #[validate] - pub vectors_config: ::core::option::Option, - /// Number of replicas of each shard that network tries to maintain - #[prost(uint32, optional, tag = "6")] - pub replication_factor: ::core::option::Option, - /// How many replicas should apply the operation for us to consider it successful - #[prost(uint32, optional, tag = "7")] - pub write_consistency_factor: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionParamsDiff { - /// Number of replicas of each shard that network tries to maintain - #[prost(uint32, optional, tag = "1")] - pub replication_factor: ::core::option::Option, - /// How many replicas should apply the operation for us to consider it successful - #[prost(uint32, optional, tag = "2")] - pub write_consistency_factor: ::core::option::Option, - /// If true - point's payload will not be stored in memory - #[prost(bool, optional, tag = "3")] - pub on_disk_payload: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionConfig { - /// Collection parameters - #[prost(message, optional, tag = "1")] - #[validate] - pub params: ::core::option::Option, - /// Configuration of vector index - #[prost(message, optional, tag = "2")] - #[validate] - pub hnsw_config: ::core::option::Option, - /// Configuration of the optimizers - #[prost(message, optional, tag = "3")] - pub optimizer_config: ::core::option::Option, - /// Configuration of the Write-Ahead-Log - #[prost(message, optional, tag = "4")] - pub wal_config: ::core::option::Option, - /// Configuration of the vector quantization - #[prost(message, optional, tag = "5")] - #[validate] - pub quantization_config: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TextIndexParams { - /// Tokenizer type - #[prost(enumeration = "TokenizerType", tag = "1")] - pub tokenizer: i32, - /// If true - all tokens will be lowercase - #[prost(bool, optional, tag = "2")] - pub lowercase: ::core::option::Option, - /// Minimal token length - #[prost(uint64, optional, tag = "3")] - pub min_token_len: ::core::option::Option, - /// Maximal token length - #[prost(uint64, optional, tag = "4")] - pub max_token_len: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[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, -} -/// Nested message and enum types in `PayloadIndexParams`. -pub mod payload_index_params { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum IndexParams { - /// Parameters for text index - #[prost(message, tag = "1")] - TextIndexParams(super::TextIndexParams), - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PayloadSchemaInfo { - /// Field data type - #[prost(enumeration = "PayloadSchemaType", tag = "1")] - pub data_type: i32, - /// Field index parameters - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, - /// Number of points indexed within this field indexed - #[prost(uint64, optional, tag = "3")] - pub points: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionInfo { - /// operating condition of the collection - #[prost(enumeration = "CollectionStatus", tag = "1")] - pub status: i32, - /// status of collection optimizers - #[prost(message, optional, tag = "2")] - pub optimizer_status: ::core::option::Option, - /// number of vectors in the collection - #[prost(uint64, tag = "3")] - pub vectors_count: u64, - /// Number of independent segments - #[prost(uint64, tag = "4")] - pub segments_count: u64, - /// Configuration - #[prost(message, optional, tag = "7")] - 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, - >, - /// number of points in the collection - #[prost(uint64, tag = "9")] - pub points_count: u64, - /// number of indexed vectors in the collection. - #[prost(uint64, optional, tag = "10")] - pub indexed_vectors_count: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChangeAliases { - /// List of actions - #[prost(message, repeated, tag = "1")] - pub actions: ::prost::alloc::vec::Vec, - /// Wait timeout for operation commit in seconds, if not specified - default value will be supplied - #[prost(uint64, optional, tag = "2")] - #[validate(custom = "crate::grpc::validate::validate_u64_range_min_1")] - pub timeout: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[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, -} -/// Nested message and enum types in `AliasOperations`. -pub mod alias_operations { - #[derive(serde::Serialize)] - #[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), - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateAlias { - /// Name of the collection - #[prost(string, tag = "1")] - pub collection_name: ::prost::alloc::string::String, - /// New name of the alias - #[prost(string, tag = "2")] - pub alias_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RenameAlias { - /// Name of the alias to rename - #[prost(string, tag = "1")] - pub old_alias_name: ::prost::alloc::string::String, - /// Name of the alias - #[prost(string, tag = "2")] - pub new_alias_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteAlias { - /// Name of the alias - #[prost(string, tag = "1")] - pub alias_name: ::prost::alloc::string::String, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListAliasesRequest {} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListCollectionAliasesRequest { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AliasDescription { - /// Name of the alias - #[prost(string, tag = "1")] - pub alias_name: ::prost::alloc::string::String, - /// Name of the collection - #[prost(string, tag = "2")] - pub collection_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListAliasesResponse { - #[prost(message, repeated, tag = "1")] - pub aliases: ::prost::alloc::vec::Vec, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionClusterInfoRequest { - /// Name of the collection - #[prost(string, tag = "1")] - pub collection_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LocalShardInfo { - /// Local shard id - #[prost(uint32, tag = "1")] - pub shard_id: u32, - /// Number of points in the shard - #[prost(uint64, tag = "2")] - pub points_count: u64, - /// Is replica active - #[prost(enumeration = "ReplicaState", tag = "3")] - pub state: i32, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoteShardInfo { - /// Local shard id - #[prost(uint32, tag = "1")] - pub shard_id: u32, - /// Remote peer id - #[prost(uint64, tag = "2")] - pub peer_id: u64, - /// Is replica active - #[prost(enumeration = "ReplicaState", tag = "3")] - pub state: i32, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ShardTransferInfo { - /// Local shard id - #[prost(uint32, tag = "1")] - pub shard_id: u32, - #[prost(uint64, tag = "2")] - pub from: u64, - #[prost(uint64, tag = "3")] - pub to: u64, - /// If `true` transfer is a synchronization of a replicas; If `false` transfer is a moving of a shard from one peer to another - #[prost(bool, tag = "4")] - pub sync: bool, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionClusterInfoResponse { - /// ID of this peer - #[prost(uint64, tag = "1")] - pub peer_id: u64, - /// Total number of shards - #[prost(uint64, tag = "2")] - pub shard_count: u64, - /// Local shards - #[prost(message, repeated, tag = "3")] - pub local_shards: ::prost::alloc::vec::Vec, - /// Remote shards - #[prost(message, repeated, tag = "4")] - pub remote_shards: ::prost::alloc::vec::Vec, - /// Shard transfers - #[prost(message, repeated, tag = "5")] - pub shard_transfers: ::prost::alloc::vec::Vec, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MoveShard { - /// Local shard id - #[prost(uint32, tag = "1")] - pub shard_id: u32, - #[prost(uint64, tag = "2")] - pub from_peer_id: u64, - #[prost(uint64, tag = "3")] - pub to_peer_id: u64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Replica { - #[prost(uint32, tag = "1")] - pub shard_id: u32, - #[prost(uint64, tag = "2")] - pub peer_id: u64, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionClusterSetupRequest { - /// Name of the collection - #[prost(string, tag = "1")] - pub collection_name: ::prost::alloc::string::String, - /// Wait timeout for operation commit in seconds, if not specified - default value will be supplied - #[prost(uint64, optional, tag = "6")] - pub timeout: ::core::option::Option, - #[prost( - oneof = "update_collection_cluster_setup_request::Operation", - tags = "2, 3, 4, 5" - )] - pub operation: ::core::option::Option< - update_collection_cluster_setup_request::Operation, - >, -} -/// Nested message and enum types in `UpdateCollectionClusterSetupRequest`. -pub mod update_collection_cluster_setup_request { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Operation { - #[prost(message, tag = "2")] - MoveShard(super::MoveShard), - #[prost(message, tag = "3")] - ReplicateShard(super::MoveShard), - #[prost(message, tag = "4")] - AbortTransfer(super::MoveShard), - #[prost(message, tag = "5")] - DropReplica(super::Replica), - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionClusterSetupResponse { - #[prost(bool, tag = "1")] - pub result: bool, -} -#[derive(serde::Serialize)] -#[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 { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Distance::UnknownDistance => "UnknownDistance", - Distance::Cosine => "Cosine", - Distance::Euclid => "Euclid", - Distance::Dot => "Dot", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UnknownDistance" => Some(Self::UnknownDistance), - "Cosine" => Some(Self::Cosine), - "Euclid" => Some(Self::Euclid), - "Dot" => Some(Self::Dot), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum CollectionStatus { - UnknownCollectionStatus = 0, - /// All segments are ready - Green = 1, - /// Optimization in process - Yellow = 2, - /// Something went wrong - Red = 3, -} -impl CollectionStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - CollectionStatus::UnknownCollectionStatus => "UnknownCollectionStatus", - CollectionStatus::Green => "Green", - CollectionStatus::Yellow => "Yellow", - CollectionStatus::Red => "Red", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UnknownCollectionStatus" => Some(Self::UnknownCollectionStatus), - "Green" => Some(Self::Green), - "Yellow" => Some(Self::Yellow), - "Red" => Some(Self::Red), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[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, - Bool = 6, -} -impl PayloadSchemaType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - PayloadSchemaType::UnknownType => "UnknownType", - PayloadSchemaType::Keyword => "Keyword", - PayloadSchemaType::Integer => "Integer", - PayloadSchemaType::Float => "Float", - PayloadSchemaType::Geo => "Geo", - PayloadSchemaType::Text => "Text", - PayloadSchemaType::Bool => "Bool", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - 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), - "Bool" => Some(Self::Bool), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum QuantizationType { - UnknownQuantization = 0, - Int8 = 1, -} -impl QuantizationType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - QuantizationType::UnknownQuantization => "UnknownQuantization", - QuantizationType::Int8 => "Int8", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UnknownQuantization" => Some(Self::UnknownQuantization), - "Int8" => Some(Self::Int8), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum CompressionRatio { - X4 = 0, - X8 = 1, - X16 = 2, - X32 = 3, - X64 = 4, -} -impl CompressionRatio { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - CompressionRatio::X4 => "x4", - CompressionRatio::X8 => "x8", - CompressionRatio::X16 => "x16", - CompressionRatio::X32 => "x32", - CompressionRatio::X64 => "x64", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "x4" => Some(Self::X4), - "x8" => Some(Self::X8), - "x16" => Some(Self::X16), - "x32" => Some(Self::X32), - "x64" => Some(Self::X64), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum TokenizerType { - Unknown = 0, - Prefix = 1, - Whitespace = 2, - Word = 3, - Multilingual = 4, -} -impl TokenizerType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - TokenizerType::Unknown => "Unknown", - TokenizerType::Prefix => "Prefix", - TokenizerType::Whitespace => "Whitespace", - TokenizerType::Word => "Word", - TokenizerType::Multilingual => "Multilingual", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Unknown" => Some(Self::Unknown), - "Prefix" => Some(Self::Prefix), - "Whitespace" => Some(Self::Whitespace), - "Word" => Some(Self::Word), - "Multilingual" => Some(Self::Multilingual), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ReplicaState { - /// Active and sound - Active = 0, - /// Failed for some reason - Dead = 1, - /// The shard is partially loaded and is currently receiving data from other shards - Partial = 2, - /// Collection is being created - Initializing = 3, - /// A shard which receives data, but is not used for search; Useful for backup shards - Listener = 4, -} -impl ReplicaState { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ReplicaState::Active => "Active", - ReplicaState::Dead => "Dead", - ReplicaState::Partial => "Partial", - ReplicaState::Initializing => "Initializing", - ReplicaState::Listener => "Listener", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Active" => Some(Self::Active), - "Dead" => Some(Self::Dead), - "Partial" => Some(Self::Partial), - "Initializing" => Some(Self::Initializing), - "Listener" => Some(Self::Listener), - _ => None, - } - } -} -/// 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; - #[derive(Debug, Clone)] - pub struct CollectionsClient { - inner: tonic::client::Grpc, - } - impl CollectionsClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl CollectionsClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> CollectionsClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - CollectionsClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Get detailed information about specified existing collection - pub async fn get( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Get")); - self.inner.unary(req, path, codec).await - } - /// Get list name of all existing collections - pub async fn list( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "List")); - self.inner.unary(req, path, codec).await - } - /// Create new collection with given parameters - pub async fn create( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Create")); - self.inner.unary(req, path, codec).await - } - /// Update parameters of the existing collection - pub async fn update( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Update")); - self.inner.unary(req, path, codec).await - } - /// Drop collection and all associated data - pub async fn delete( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Delete")); - self.inner.unary(req, path, codec).await - } - /// Update Aliases of the existing collection - pub async fn update_aliases( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Collections", "UpdateAliases")); - self.inner.unary(req, path, codec).await - } - /// Get list of all aliases for a collection - pub async fn list_collection_aliases( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/ListCollectionAliases", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Collections", "ListCollectionAliases")); - self.inner.unary(req, path, codec).await - } - /// Get list of all aliases for all existing collections - pub async fn list_aliases( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/ListAliases", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Collections", "ListAliases")); - self.inner.unary(req, path, codec).await - } - /// Get cluster information for a collection - pub async fn collection_cluster_info( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/CollectionClusterInfo", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Collections", "CollectionClusterInfo")); - self.inner.unary(req, path, codec).await - } - /// Update cluster setup for a collection - pub async fn update_collection_cluster_setup( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/UpdateCollectionClusterSetup", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("qdrant.Collections", "UpdateCollectionClusterSetup"), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod collections_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with CollectionsServer. - #[async_trait] - pub trait Collections: Send + Sync + 'static { - /// Get detailed information about specified existing collection - async fn get( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Get list name of all existing collections - async fn list( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Create new collection with given parameters - async fn create( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Update parameters of the existing collection - async fn update( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Drop collection and all associated data - async fn delete( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Update Aliases of the existing collection - async fn update_aliases( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Get list of all aliases for a collection - async fn list_collection_aliases( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Get list of all aliases for all existing collections - async fn list_aliases( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Get cluster information for a collection - async fn collection_cluster_info( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Update cluster setup for a collection - async fn update_collection_cluster_setup( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct CollectionsServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl CollectionsServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for CollectionsServer - where - T: Collections, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/qdrant.Collections/Get" => { - #[allow(non_camel_case_types)] - struct GetSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for GetSvc { - type Response = super::GetCollectionInfoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/List" => { - #[allow(non_camel_case_types)] - struct ListSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for ListSvc { - type Response = super::ListCollectionsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/Create" => { - #[allow(non_camel_case_types)] - struct CreateSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for CreateSvc { - type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/Update" => { - #[allow(non_camel_case_types)] - struct UpdateSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for UpdateSvc { - type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/Delete" => { - #[allow(non_camel_case_types)] - struct DeleteSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for DeleteSvc { - type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/UpdateAliases" => { - #[allow(non_camel_case_types)] - struct UpdateAliasesSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for UpdateAliasesSvc { - type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/ListCollectionAliases" => { - #[allow(non_camel_case_types)] - struct ListCollectionAliasesSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for ListCollectionAliasesSvc { - type Response = super::ListAliasesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).list_collection_aliases(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/ListAliases" => { - #[allow(non_camel_case_types)] - struct ListAliasesSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for ListAliasesSvc { - type Response = super::ListAliasesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).list_aliases(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/CollectionClusterInfo" => { - #[allow(non_camel_case_types)] - struct CollectionClusterInfoSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService - for CollectionClusterInfoSvc { - type Response = super::CollectionClusterInfoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).collection_cluster_info(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CollectionClusterInfoSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Collections/UpdateCollectionClusterSetup" => { - #[allow(non_camel_case_types)] - struct UpdateCollectionClusterSetupSvc(pub Arc); - impl< - T: Collections, - > tonic::server::UnaryService< - super::UpdateCollectionClusterSetupRequest, - > for UpdateCollectionClusterSetupSvc { - type Response = super::UpdateCollectionClusterSetupResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::UpdateCollectionClusterSetupRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).update_collection_cluster_setup(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateCollectionClusterSetupSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for CollectionsServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for CollectionsServer { - const NAME: &'static str = "qdrant.Collections"; - } -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionInfoRequestInternal { - #[prost(message, optional, tag = "1")] - pub get_collection_info_request: ::core::option::Option, - #[prost(uint32, tag = "2")] - pub shard_id: u32, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InitiateShardTransferRequest { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Id of the temporary shard - #[prost(uint32, tag = "2")] - pub shard_id: u32, -} -/// Generated client implementations. -pub mod collections_internal_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 CollectionsInternalClient { - inner: tonic::client::Grpc, - } - impl CollectionsInternalClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl CollectionsInternalClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> CollectionsInternalClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - CollectionsInternalClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Get collection info - pub async fn get( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.CollectionsInternal/Get", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.CollectionsInternal", "Get")); - self.inner.unary(req, path, codec).await - } - /// Initiate shard transfer - pub async fn initiate( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.CollectionsInternal/Initiate", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.CollectionsInternal", "Initiate")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod collections_internal_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with CollectionsInternalServer. - #[async_trait] - pub trait CollectionsInternal: Send + Sync + 'static { - /// Get collection info - async fn get( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Initiate shard transfer - async fn initiate( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct CollectionsInternalServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl CollectionsInternalServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for CollectionsInternalServer - where - T: CollectionsInternal, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/qdrant.CollectionsInternal/Get" => { - #[allow(non_camel_case_types)] - struct GetSvc(pub Arc); - impl< - T: CollectionsInternal, - > tonic::server::UnaryService< - super::GetCollectionInfoRequestInternal, - > for GetSvc { - type Response = super::GetCollectionInfoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::GetCollectionInfoRequestInternal, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.CollectionsInternal/Initiate" => { - #[allow(non_camel_case_types)] - struct InitiateSvc(pub Arc); - impl< - T: CollectionsInternal, - > tonic::server::UnaryService - for InitiateSvc { - type Response = super::CollectionOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).initiate(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = InitiateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for CollectionsInternalServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService - for CollectionsInternalServer { - const NAME: &'static str = "qdrant.CollectionsInternal"; - } -} -/// `Struct` represents a structured data value, consisting of fields -/// which map to dynamically typed values. In some languages, `Struct` -/// might be supported by a native representation. For example, in -/// scripting languages like JS a struct is represented as an -/// object. The details of that representation are described together -/// with the proto support for the language. -/// -/// The JSON representation for `Struct` is a JSON object. -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Struct { - /// Unordered map of dynamically typed values. - #[prost(map = "string, message", tag = "1")] - pub fields: ::std::collections::HashMap<::prost::alloc::string::String, Value>, -} -/// `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 those -/// variants, absence of any variant indicates an error. -/// -/// The JSON representation for `Value` is a JSON value. -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Value { - /// The kind of value. - #[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6, 7")] - pub kind: ::core::option::Option, -} -/// Nested message and enum types in `Value`. -pub mod value { - /// The kind of value. - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Kind { - /// Represents a null value. - #[prost(enumeration = "super::NullValue", tag = "1")] - NullValue(i32), - /// Represents a double value. - #[prost(double, tag = "2")] - DoubleValue(f64), - /// Represents an integer value - #[prost(int64, tag = "3")] - IntegerValue(i64), - /// Represents a string value. - #[prost(string, tag = "4")] - StringValue(::prost::alloc::string::String), - /// Represents a boolean value. - #[prost(bool, tag = "5")] - BoolValue(bool), - /// Represents a structured value. - #[prost(message, tag = "6")] - StructValue(super::Struct), - /// Represents a repeated `Value`. - #[prost(message, tag = "7")] - ListValue(super::ListValue), - } -} -/// `ListValue` is a wrapper around a repeated field of values. -/// -/// The JSON representation for `ListValue` is a JSON array. -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListValue { - /// Repeated field of dynamically typed values. - #[prost(message, repeated, tag = "1")] - pub values: ::prost::alloc::vec::Vec, -} -/// `NullValue` is a singleton enumeration to represent the null value for the -/// `Value` type union. -/// -/// The JSON representation for `NullValue` is JSON `null`. -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum NullValue { - /// Null value. - NullValue = 0, -} -impl NullValue { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - NullValue::NullValue => "NULL_VALUE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NULL_VALUE" => Some(Self::NullValue), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WriteOrdering { - /// Write ordering guarantees - #[prost(enumeration = "WriteOrderingType", tag = "1")] - pub r#type: i32, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReadConsistency { - #[prost(oneof = "read_consistency::Value", tags = "1, 2")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `ReadConsistency`. -pub mod read_consistency { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Value { - /// Common read consistency configurations - #[prost(enumeration = "super::ReadConsistencyType", tag = "1")] - Type(i32), - /// Send request to a specified number of nodes, and return points which are present on all of them - #[prost(uint64, tag = "2")] - Factor(u64), - } -} -#[derive(serde::Serialize)] -#[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, -} -/// Nested message and enum types in `PointId`. -pub mod point_id { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum PointIdOptions { - /// Numerical ID of the point - #[prost(uint64, tag = "1")] - Num(u64), - /// UUID - #[prost(string, tag = "2")] - Uuid(::prost::alloc::string::String), - } -} -#[derive(serde::Serialize)] -#[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, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpsertPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub points: ::prost::alloc::vec::Vec, - /// Write ordering guarantees - #[prost(message, optional, tag = "4")] - pub ordering: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeletePoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// Affected points - #[prost(message, optional, tag = "3")] - pub points: ::core::option::Option, - /// Write ordering guarantees - #[prost(message, optional, tag = "4")] - pub ordering: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// List of points to retrieve - #[prost(message, repeated, tag = "2")] - pub ids: ::prost::alloc::vec::Vec, - /// Options for specifying which payload to include or not - #[prost(message, optional, tag = "4")] - pub with_payload: ::core::option::Option, - /// Options for specifying which vectors to include into response - #[prost(message, optional, tag = "5")] - pub with_vectors: ::core::option::Option, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "6")] - pub read_consistency: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdatePointVectors { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// List of points and vectors to update - #[prost(message, repeated, tag = "3")] - pub points: ::prost::alloc::vec::Vec, - /// Write ordering guarantees - #[prost(message, optional, tag = "4")] - pub ordering: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PointVectors { - /// ID to update vectors for - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, - /// Named vectors to update, leave others intact - #[prost(message, optional, tag = "2")] - pub vectors: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeletePointVectors { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// Affected points - #[prost(message, optional, tag = "3")] - pub points_selector: ::core::option::Option, - /// List of vector names to delete - #[prost(message, optional, tag = "4")] - pub vectors: ::core::option::Option, - /// Write ordering guarantees - #[prost(message, optional, tag = "5")] - pub ordering: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetPayloadPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// New payload values - #[prost(map = "string, message", tag = "3")] - pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>, - /// Affected points - #[prost(message, optional, tag = "5")] - pub points_selector: ::core::option::Option, - /// Write ordering guarantees - #[prost(message, optional, tag = "6")] - pub ordering: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeletePayloadPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// List of keys to delete - #[prost(string, repeated, tag = "3")] - pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Affected points - #[prost(message, optional, tag = "5")] - pub points_selector: ::core::option::Option, - /// Write ordering guarantees - #[prost(message, optional, tag = "6")] - pub ordering: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClearPayloadPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// Affected points - #[prost(message, optional, tag = "3")] - pub points: ::core::option::Option, - /// Write ordering guarantees - #[prost(message, optional, tag = "4")] - pub ordering: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateFieldIndexCollection { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// Field name to index - #[prost(string, tag = "3")] - #[validate(length(min = 1))] - pub field_name: ::prost::alloc::string::String, - /// Field type. - #[prost(enumeration = "FieldType", optional, tag = "4")] - pub field_type: ::core::option::Option, - /// Payload index params. - #[prost(message, optional, tag = "5")] - pub field_index_params: ::core::option::Option, - /// Write ordering guarantees - #[prost(message, optional, tag = "6")] - pub ordering: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteFieldIndexCollection { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - /// Field name to delete - #[prost(string, tag = "3")] - #[validate(length(min = 1))] - pub field_name: ::prost::alloc::string::String, - /// Write ordering guarantees - #[prost(message, optional, tag = "4")] - pub ordering: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PayloadIncludeSelector { - /// List of payload keys to include into result - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PayloadExcludeSelector { - /// List of payload keys to exclude from the result - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Serialize)] -#[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, -} -/// Nested message and enum types in `WithPayloadSelector`. -pub mod with_payload_selector { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum SelectorOptions { - /// If `true` - return all payload, if `false` - none - #[prost(bool, tag = "1")] - Enable(bool), - #[prost(message, tag = "2")] - Include(super::PayloadIncludeSelector), - #[prost(message, tag = "3")] - Exclude(super::PayloadExcludeSelector), - } -} -#[derive(serde::Serialize)] -#[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>, -} -#[derive(serde::Serialize)] -#[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, -} -/// Nested message and enum types in `Vectors`. -pub mod vectors { - #[derive(serde::Serialize)] - #[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), - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VectorsSelector { - /// List of vectors to include into result - #[prost(string, repeated, tag = "1")] - pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Serialize)] -#[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, -} -/// Nested message and enum types in `WithVectorsSelector`. -pub mod with_vectors_selector { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum SelectorOptions { - /// If `true` - return all vectors, if `false` - none - #[prost(bool, tag = "1")] - Enable(bool), - /// List of payload keys to include into result - #[prost(message, tag = "2")] - Include(super::VectorsSelector), - } -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuantizationSearchParams { - /// If set to true, search will ignore quantized vector data - #[prost(bool, optional, tag = "1")] - pub ignore: ::core::option::Option, - /// If true, use original vectors to re-score top-k results. Default is true. - #[prost(bool, optional, tag = "2")] - pub rescore: ::core::option::Option, - /// Oversampling factor for quantization. - /// - /// Defines how many extra vectors should be pre-selected using quantized index, - /// and then re-scored using original vectors. - /// - /// For example, if `oversampling` is 2.4 and `limit` is 100, then 240 vectors will be pre-selected using quantized index, - /// and then top-100 will be returned after re-scoring. - #[prost(double, optional, tag = "3")] - #[validate(custom = "crate::grpc::validate::validate_f64_range_min_1")] - pub oversampling: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchParams { - /// Params relevant to HNSW index. Size of the beam in a beam-search. - /// Larger the value - more accurate the result, more time required for search. - #[prost(uint64, optional, tag = "1")] - pub hnsw_ef: ::core::option::Option, - /// Search without approximation. If set to true, search may run long but with exact results. - #[prost(bool, optional, tag = "2")] - pub exact: ::core::option::Option, - /// If set to true, search will ignore quantized vector data - #[prost(message, optional, tag = "3")] - #[validate] - pub quantization: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// vector - #[prost(float, repeated, tag = "2")] - pub vector: ::prost::alloc::vec::Vec, - /// Filter conditions - return only those points that satisfy the specified conditions - #[prost(message, optional, tag = "3")] - pub filter: ::core::option::Option, - /// Max number of result - #[prost(uint64, tag = "4")] - #[validate(range(min = 1))] - pub limit: u64, - /// Options for specifying which payload to include or not - #[prost(message, optional, tag = "6")] - pub with_payload: ::core::option::Option, - /// Search config - #[prost(message, optional, tag = "7")] - #[validate] - pub params: ::core::option::Option, - /// If provided - cut off results with worse scores - #[prost(float, optional, tag = "8")] - pub score_threshold: ::core::option::Option, - /// Offset of the result - #[prost(uint64, optional, tag = "9")] - pub offset: ::core::option::Option, - /// Which vector to use for search, if not specified - use default vector - #[prost(string, optional, tag = "10")] - #[validate(custom = "crate::grpc::validate::validate_not_empty")] - pub vector_name: ::core::option::Option<::prost::alloc::string::String>, - /// Options for specifying which vectors to include into response - #[prost(message, optional, tag = "11")] - pub with_vectors: ::core::option::Option, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "12")] - pub read_consistency: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchBatchPoints { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - #[validate] - pub search_points: ::prost::alloc::vec::Vec, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "3")] - pub read_consistency: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WithLookup { - /// Name of the collection to use for points lookup - #[prost(string, tag = "1")] - pub collection: ::prost::alloc::string::String, - /// Options for specifying which payload to include (or not) - #[prost(message, optional, tag = "2")] - pub with_payload: ::core::option::Option, - /// Options for specifying which vectors to include (or not) - #[prost(message, optional, tag = "3")] - pub with_vectors: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchPointGroups { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Vector to compare against - #[prost(float, repeated, tag = "2")] - pub vector: ::prost::alloc::vec::Vec, - /// Filter conditions - return only those points that satisfy the specified conditions - #[prost(message, optional, tag = "3")] - pub filter: ::core::option::Option, - /// Max number of result - #[prost(uint32, tag = "4")] - #[validate(range(min = 1))] - pub limit: u32, - /// Options for specifying which payload to include or not - #[prost(message, optional, tag = "5")] - pub with_payload: ::core::option::Option, - /// Search config - #[prost(message, optional, tag = "6")] - #[validate] - pub params: ::core::option::Option, - /// If provided - cut off results with worse scores - #[prost(float, optional, tag = "7")] - pub score_threshold: ::core::option::Option, - /// Which vector to use for search, if not specified - use default vector - #[prost(string, optional, tag = "8")] - #[validate(custom = "crate::grpc::validate::validate_not_empty")] - pub vector_name: ::core::option::Option<::prost::alloc::string::String>, - /// Options for specifying which vectors to include into response - #[prost(message, optional, tag = "9")] - pub with_vectors: ::core::option::Option, - /// Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups. - #[prost(string, tag = "10")] - #[validate(length(min = 1))] - pub group_by: ::prost::alloc::string::String, - /// Maximum amount of points to return per group - #[prost(uint32, tag = "11")] - #[validate(range(min = 1))] - pub group_size: u32, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "12")] - pub read_consistency: ::core::option::Option, - /// Options for specifying how to use the group id to lookup points in another collection - #[prost(message, optional, tag = "13")] - pub with_lookup: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScrollPoints { - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Filter conditions - return only those points that satisfy the specified conditions - #[prost(message, optional, tag = "2")] - pub filter: ::core::option::Option, - /// Start with this ID - #[prost(message, optional, tag = "3")] - pub offset: ::core::option::Option, - /// Max number of result - #[prost(uint32, optional, tag = "4")] - #[validate(custom = "crate::grpc::validate::validate_u32_range_min_1")] - pub limit: ::core::option::Option, - /// Options for specifying which payload to include or not - #[prost(message, optional, tag = "6")] - pub with_payload: ::core::option::Option, - /// Options for specifying which vectors to include into response - #[prost(message, optional, tag = "7")] - pub with_vectors: ::core::option::Option, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "8")] - pub read_consistency: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[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, - /// Which vector to use for search, if not specified - use default vector - #[prost(string, optional, tag = "2")] - pub vector_name: ::core::option::Option<::prost::alloc::string::String>, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RecommendPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Look for vectors closest to those - #[prost(message, repeated, tag = "2")] - pub positive: ::prost::alloc::vec::Vec, - /// Try to avoid vectors like this - #[prost(message, repeated, tag = "3")] - pub negative: ::prost::alloc::vec::Vec, - /// Filter conditions - return only those points that satisfy the specified conditions - #[prost(message, optional, tag = "4")] - pub filter: ::core::option::Option, - /// Max number of result - #[prost(uint64, tag = "5")] - pub limit: u64, - /// Options for specifying which payload to include or not - #[prost(message, optional, tag = "7")] - pub with_payload: ::core::option::Option, - /// Search config - #[prost(message, optional, tag = "8")] - #[validate] - pub params: ::core::option::Option, - /// If provided - cut off results with worse scores - #[prost(float, optional, tag = "9")] - pub score_threshold: ::core::option::Option, - /// Offset of the result - #[prost(uint64, optional, tag = "10")] - pub offset: ::core::option::Option, - /// Define which vector to use for recommendation, if not specified - default vector - #[prost(string, optional, tag = "11")] - pub using: ::core::option::Option<::prost::alloc::string::String>, - /// Options for specifying which vectors to include into response - #[prost(message, optional, tag = "12")] - pub with_vectors: ::core::option::Option, - /// Name of the collection to use for points lookup, if not specified - use current collection - #[prost(message, optional, tag = "13")] - pub lookup_from: ::core::option::Option, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "14")] - pub read_consistency: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RecommendBatchPoints { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - #[validate] - pub recommend_points: ::prost::alloc::vec::Vec, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "3")] - pub read_consistency: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RecommendPointGroups { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Look for vectors closest to those - #[prost(message, repeated, tag = "2")] - pub positive: ::prost::alloc::vec::Vec, - /// Try to avoid vectors like this - #[prost(message, repeated, tag = "3")] - pub negative: ::prost::alloc::vec::Vec, - /// Filter conditions - return only those points that satisfy the specified conditions - #[prost(message, optional, tag = "4")] - pub filter: ::core::option::Option, - /// Max number of groups in result - #[prost(uint32, tag = "5")] - #[validate(range(min = 1))] - pub limit: u32, - /// Options for specifying which payload to include or not - #[prost(message, optional, tag = "6")] - pub with_payload: ::core::option::Option, - /// Search config - #[prost(message, optional, tag = "7")] - #[validate] - pub params: ::core::option::Option, - /// If provided - cut off results with worse scores - #[prost(float, optional, tag = "8")] - pub score_threshold: ::core::option::Option, - /// Define which vector to use for recommendation, if not specified - default vector - #[prost(string, optional, tag = "9")] - pub using: ::core::option::Option<::prost::alloc::string::String>, - /// Options for specifying which vectors to include into response - #[prost(message, optional, tag = "10")] - pub with_vectors: ::core::option::Option, - /// Name of the collection to use for points lookup, if not specified - use current collection - #[prost(message, optional, tag = "11")] - pub lookup_from: ::core::option::Option, - /// Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups. - #[prost(string, tag = "12")] - #[validate(length(min = 1))] - pub group_by: ::prost::alloc::string::String, - /// Maximum amount of points to return per group - #[prost(uint32, tag = "13")] - #[validate(range(min = 1))] - pub group_size: u32, - /// Options for specifying read consistency guarantees - #[prost(message, optional, tag = "14")] - pub read_consistency: ::core::option::Option, - /// Options for specifying how to use the group id to lookup points in another collection - #[prost(message, optional, tag = "15")] - pub with_lookup: ::core::option::Option, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CountPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Filter conditions - return only those points that satisfy the specified conditions - #[prost(message, optional, tag = "2")] - pub filter: ::core::option::Option, - /// If `true` - return exact count, if `false` - return approximate count - #[prost(bool, optional, tag = "3")] - pub exact: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PointsUpdateOperation { - #[prost( - oneof = "points_update_operation::Operation", - tags = "1, 2, 3, 4, 5, 6, 7, 8" - )] - pub operation: ::core::option::Option, -} -/// Nested message and enum types in `PointsUpdateOperation`. -pub mod points_update_operation { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct PointStructList { - #[prost(message, repeated, tag = "1")] - pub points: ::prost::alloc::vec::Vec, - } - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct SetPayload { - #[prost(map = "string, message", tag = "1")] - pub payload: ::std::collections::HashMap< - ::prost::alloc::string::String, - super::Value, - >, - /// Affected points - #[prost(message, optional, tag = "2")] - pub points_selector: ::core::option::Option, - } - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct DeletePayload { - #[prost(string, repeated, tag = "1")] - pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Affected points - #[prost(message, optional, tag = "2")] - pub points_selector: ::core::option::Option, - } - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct UpdateVectors { - /// List of points and vectors to update - #[prost(message, repeated, tag = "1")] - pub points: ::prost::alloc::vec::Vec, - } - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct DeleteVectors { - /// Affected points - #[prost(message, optional, tag = "1")] - pub points_selector: ::core::option::Option, - /// List of vector names to delete - #[prost(message, optional, tag = "2")] - pub vectors: ::core::option::Option, - } - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Operation { - #[prost(message, tag = "1")] - Upsert(PointStructList), - #[prost(message, tag = "2")] - Delete(super::PointsSelector), - #[prost(message, tag = "3")] - SetPayload(SetPayload), - #[prost(message, tag = "4")] - OverwritePayload(SetPayload), - #[prost(message, tag = "5")] - DeletePayload(DeletePayload), - #[prost(message, tag = "6")] - ClearPayload(super::PointsSelector), - #[prost(message, tag = "7")] - UpdateVectors(UpdateVectors), - #[prost(message, tag = "8")] - DeleteVectors(DeleteVectors), - } -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateBatchPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - #[validate(length(min = 1))] - pub operations: ::prost::alloc::vec::Vec, - /// Write ordering guarantees - #[prost(message, optional, tag = "4")] - pub ordering: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateResult { - /// Number of operation - #[prost(uint64, tag = "1")] - pub operation_id: u64, - /// Operation status - #[prost(enumeration = "UpdateStatus", tag = "2")] - pub status: i32, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScoredPoint { - /// Point id - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, - /// Payload - #[prost(map = "string, message", tag = "2")] - pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>, - /// Similarity score - #[prost(float, tag = "3")] - pub score: f32, - /// Last update operation applied to this point - #[prost(uint64, tag = "5")] - pub version: u64, - /// Vectors to search - #[prost(message, optional, tag = "6")] - pub vectors: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GroupId { - #[prost(oneof = "group_id::Kind", tags = "1, 2, 3")] - pub kind: ::core::option::Option, -} -/// Nested message and enum types in `GroupId`. -pub mod group_id { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Kind { - /// Represents a double value. - #[prost(uint64, tag = "1")] - UnsignedValue(u64), - /// Represents an integer value - #[prost(int64, tag = "2")] - IntegerValue(i64), - /// Represents a string value. - #[prost(string, tag = "3")] - StringValue(::prost::alloc::string::String), - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PointGroup { - /// Group id - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, - /// Points in the group - #[prost(message, repeated, tag = "2")] - pub hits: ::prost::alloc::vec::Vec, - /// Point(s) from the lookup collection that matches the group id - #[prost(message, optional, tag = "3")] - pub lookup: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GroupsResult { - /// Groups - #[prost(message, repeated, tag = "1")] - pub groups: ::prost::alloc::vec::Vec, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[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, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchGroupsResponse { - #[prost(message, optional, tag = "1")] - pub result: ::core::option::Option, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScrollResponse { - /// Use this offset for the next query - #[prost(message, optional, tag = "1")] - pub next_page_offset: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub result: ::prost::alloc::vec::Vec, - /// Time spent to process - #[prost(double, tag = "3")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CountResult { - #[prost(uint64, tag = "1")] - pub count: u64, -} -#[derive(serde::Serialize)] -#[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, - #[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, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RecommendGroupsResponse { - #[prost(message, optional, tag = "1")] - pub result: ::core::option::Option, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateBatchResponse { - #[prost(message, repeated, tag = "1")] - pub result: ::prost::alloc::vec::Vec, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Filter { - /// At least one of those conditions should match - #[prost(message, repeated, tag = "1")] - pub should: ::prost::alloc::vec::Vec, - /// All conditions must match - #[prost(message, repeated, tag = "2")] - pub must: ::prost::alloc::vec::Vec, - /// All conditions must NOT match - #[prost(message, repeated, tag = "3")] - pub must_not: ::prost::alloc::vec::Vec, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Condition { - #[prost(oneof = "condition::ConditionOneOf", tags = "1, 2, 3, 4, 5, 6")] - pub condition_one_of: ::core::option::Option, -} -/// Nested message and enum types in `Condition`. -pub mod condition { - #[derive(serde::Serialize)] - #[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), - #[prost(message, tag = "5")] - IsNull(super::IsNullCondition), - #[prost(message, tag = "6")] - Nested(super::NestedCondition), - } -} -#[derive(serde::Serialize)] -#[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, -} -#[derive(serde::Serialize)] -#[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, -} -#[derive(serde::Serialize)] -#[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, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NestedCondition { - /// Path to nested object - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - /// Filter condition - #[prost(message, optional, tag = "2")] - pub filter: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[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, - /// Check if point has field with a given value - #[prost(message, optional, tag = "2")] - pub r#match: ::core::option::Option, - /// Check if points value lies in a given range - #[prost(message, optional, tag = "3")] - pub range: ::core::option::Option, - /// 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 - #[prost(message, optional, tag = "5")] - pub geo_radius: ::core::option::Option, - /// Check number of values for a specific field - #[prost(message, optional, tag = "6")] - pub values_count: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[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, 5, 6, 7, 8")] - pub match_value: ::core::option::Option, -} -/// Nested message and enum types in `Match`. -pub mod r#match { - #[derive(serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum MatchValue { - /// Match string keyword - #[prost(string, tag = "1")] - Keyword(::prost::alloc::string::String), - /// Match integer - #[prost(int64, tag = "2")] - Integer(i64), - /// Match boolean - #[prost(bool, tag = "3")] - Boolean(bool), - /// Match text - #[prost(string, tag = "4")] - Text(::prost::alloc::string::String), - /// Match multiple keywords - #[prost(message, tag = "5")] - Keywords(super::RepeatedStrings), - /// Match multiple integers - #[prost(message, tag = "6")] - Integers(super::RepeatedIntegers), - /// Match any other value except those integers - #[prost(message, tag = "7")] - ExceptIntegers(super::RepeatedIntegers), - /// Match any other value except those keywords - #[prost(message, tag = "8")] - ExceptKeywords(super::RepeatedStrings), - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RepeatedStrings { - #[prost(string, repeated, tag = "1")] - pub strings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RepeatedIntegers { - #[prost(int64, repeated, tag = "1")] - pub integers: ::prost::alloc::vec::Vec, -} -#[derive(serde::Serialize)] -#[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, - #[prost(double, optional, tag = "2")] - pub gt: ::core::option::Option, - #[prost(double, optional, tag = "3")] - pub gte: ::core::option::Option, - #[prost(double, optional, tag = "4")] - pub lte: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GeoBoundingBox { - /// north-west corner - #[prost(message, optional, tag = "1")] - pub top_left: ::core::option::Option, - /// south-east corner - #[prost(message, optional, tag = "2")] - pub bottom_right: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GeoRadius { - /// Center of the circle - #[prost(message, optional, tag = "1")] - pub center: ::core::option::Option, - /// In meters - #[prost(float, tag = "2")] - pub radius: f32, -} -#[derive(validator::Validate)] -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GeoPolygon { - /// Ordered list of coordinates representing the vertices of a polygon. - /// The minimum size is 4, and the first coordinate and the last coordinate - /// should be the same to form a closed polygon. - #[prost(message, repeated, tag = "1")] - #[validate(custom = "crate::grpc::validate::validate_geo_polygon")] - pub points: ::prost::alloc::vec::Vec, -} -#[derive(serde::Serialize)] -#[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, - #[prost(uint64, optional, tag = "2")] - pub gt: ::core::option::Option, - #[prost(uint64, optional, tag = "3")] - pub gte: ::core::option::Option, - #[prost(uint64, optional, tag = "4")] - pub lte: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[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, - >, -} -/// Nested message and enum types in `PointsSelector`. -pub mod points_selector { - #[derive(serde::Serialize)] - #[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), - } -} -#[derive(serde::Serialize)] -#[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, -} -#[derive(serde::Serialize)] -#[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, - #[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, -} -#[derive(serde::Serialize)] -#[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(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum WriteOrderingType { - /// Write operations may be reordered, works faster, default - Weak = 0, - /// Write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change - Medium = 1, - /// Write operations go through the permanent leader, consistent, but may be unavailable if leader is down - Strong = 2, -} -impl WriteOrderingType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - WriteOrderingType::Weak => "Weak", - WriteOrderingType::Medium => "Medium", - WriteOrderingType::Strong => "Strong", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Weak" => Some(Self::Weak), - "Medium" => Some(Self::Medium), - "Strong" => Some(Self::Strong), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ReadConsistencyType { - /// Send request to all nodes and return points which are present on all of them - All = 0, - /// Send requests to all nodes and return points which are present on majority of them - Majority = 1, - /// Send requests to half + 1 nodes, return points which are present on all of them - Quorum = 2, -} -impl ReadConsistencyType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ReadConsistencyType::All => "All", - ReadConsistencyType::Majority => "Majority", - ReadConsistencyType::Quorum => "Quorum", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "All" => Some(Self::All), - "Majority" => Some(Self::Majority), - "Quorum" => Some(Self::Quorum), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[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, - Bool = 5, -} -impl FieldType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - FieldType::Keyword => "FieldTypeKeyword", - FieldType::Integer => "FieldTypeInteger", - FieldType::Float => "FieldTypeFloat", - FieldType::Geo => "FieldTypeGeo", - FieldType::Text => "FieldTypeText", - FieldType::Bool => "FieldTypeBool", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "FieldTypeKeyword" => Some(Self::Keyword), - "FieldTypeInteger" => Some(Self::Integer), - "FieldTypeFloat" => Some(Self::Float), - "FieldTypeGeo" => Some(Self::Geo), - "FieldTypeText" => Some(Self::Text), - "FieldTypeBool" => Some(Self::Bool), - _ => None, - } - } -} -#[derive(serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum UpdateStatus { - UnknownUpdateStatus = 0, - /// Update is received, but not processed yet - Acknowledged = 1, - /// Update is applied and ready for search - Completed = 2, -} -impl UpdateStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - UpdateStatus::UnknownUpdateStatus => "UnknownUpdateStatus", - UpdateStatus::Acknowledged => "Acknowledged", - UpdateStatus::Completed => "Completed", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UnknownUpdateStatus" => Some(Self::UnknownUpdateStatus), - "Acknowledged" => Some(Self::Acknowledged), - "Completed" => Some(Self::Completed), - _ => None, - } - } -} -/// 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; - #[derive(Debug, Clone)] - pub struct PointsClient { - inner: tonic::client::Grpc, - } - impl PointsClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl PointsClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> PointsClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - PointsClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// 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, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Upsert")); - self.inner.unary(req, path, codec).await - } - /// Delete points - pub async fn delete( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Delete")); - self.inner.unary(req, path, codec).await - } - /// Retrieve points - pub async fn get( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Get")); - self.inner.unary(req, path, codec).await - } - /// Update named vectors for point - pub async fn update_vectors( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/UpdateVectors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "UpdateVectors")); - self.inner.unary(req, path, codec).await - } - /// Delete named vectors for points - pub async fn delete_vectors( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/DeleteVectors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "DeleteVectors")); - self.inner.unary(req, path, codec).await - } - /// Set payload for points - pub async fn set_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "SetPayload")); - self.inner.unary(req, path, codec).await - } - /// Overwrite payload for points - pub async fn overwrite_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "OverwritePayload")); - self.inner.unary(req, path, codec).await - } - /// Delete specified key payload for points - pub async fn delete_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "DeletePayload")); - self.inner.unary(req, path, codec).await - } - /// Remove all payload for specified points - pub async fn clear_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "ClearPayload")); - self.inner.unary(req, path, codec).await - } - /// Create index for field in collection - pub async fn create_field_index( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "CreateFieldIndex")); - self.inner.unary(req, path, codec).await - } - /// Delete field index for collection - pub async fn delete_field_index( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "DeleteFieldIndex")); - self.inner.unary(req, path, codec).await - } - /// Retrieve closest points based on vector similarity and given filtering conditions - pub async fn search( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Search")); - self.inner.unary(req, path, codec).await - } - /// Retrieve closest points based on vector similarity and given filtering conditions - pub async fn search_batch( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "SearchBatch")); - self.inner.unary(req, path, codec).await - } - /// Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given field - pub async fn search_groups( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/SearchGroups", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "SearchGroups")); - self.inner.unary(req, path, codec).await - } - /// Iterate over all or filtered points points - pub async fn scroll( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Scroll")); - self.inner.unary(req, path, codec).await - } - /// Look for the points which are closer to stored positive examples and at the same time further to negative examples. - pub async fn recommend( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Recommend")); - self.inner.unary(req, path, codec).await - } - /// Look for the points which are closer to stored positive examples and at the same time further to negative examples. - pub async fn recommend_batch( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "RecommendBatch")); - self.inner.unary(req, path, codec).await - } - /// Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given field - pub async fn recommend_groups( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/RecommendGroups", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Points", "RecommendGroups")); - self.inner.unary(req, path, codec).await - } - /// Count points in collection with given filtering conditions - pub async fn count( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Count")); - self.inner.unary(req, path, codec).await - } - /// Perform multiple update operations in one request - pub async fn update_batch( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/UpdateBatch", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "UpdateBatch")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod points_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with PointsServer. - #[async_trait] - pub trait Points: Send + Sync + 'static { - /// 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, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delete points - async fn delete( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Retrieve points - async fn get( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Update named vectors for point - async fn update_vectors( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delete named vectors for points - async fn delete_vectors( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Set payload for points - async fn set_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Overwrite payload for points - async fn overwrite_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delete specified key payload for points - async fn delete_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Remove all payload for specified points - async fn clear_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Create index for field in collection - async fn create_field_index( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delete field index for collection - async fn delete_field_index( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Retrieve closest points based on vector similarity and given filtering conditions - async fn search( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Retrieve closest points based on vector similarity and given filtering conditions - async fn search_batch( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given field - async fn search_groups( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Iterate over all or filtered points points - async fn scroll( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Look for the points which are closer to stored positive examples and at the same time further to negative examples. - async fn recommend( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Look for the points which are closer to stored positive examples and at the same time further to negative examples. - async fn recommend_batch( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given field - async fn recommend_groups( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Count points in collection with given filtering conditions - async fn count( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Perform multiple update operations in one request - async fn update_batch( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct PointsServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl PointsServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for PointsServer - where - T: Points, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/qdrant.Points/Upsert" => { - #[allow(non_camel_case_types)] - struct UpsertSvc(pub Arc); - impl tonic::server::UnaryService - for UpsertSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/Delete" => { - #[allow(non_camel_case_types)] - struct DeleteSvc(pub Arc); - impl tonic::server::UnaryService - for DeleteSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/Get" => { - #[allow(non_camel_case_types)] - struct GetSvc(pub Arc); - impl tonic::server::UnaryService - for GetSvc { - type Response = super::GetResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/UpdateVectors" => { - #[allow(non_camel_case_types)] - struct UpdateVectorsSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for UpdateVectorsSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).update_vectors(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateVectorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/DeleteVectors" => { - #[allow(non_camel_case_types)] - struct DeleteVectorsSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for DeleteVectorsSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).delete_vectors(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteVectorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/SetPayload" => { - #[allow(non_camel_case_types)] - struct SetPayloadSvc(pub Arc); - impl tonic::server::UnaryService - for SetPayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/OverwritePayload" => { - #[allow(non_camel_case_types)] - struct OverwritePayloadSvc(pub Arc); - impl tonic::server::UnaryService - for OverwritePayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/DeletePayload" => { - #[allow(non_camel_case_types)] - struct DeletePayloadSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for DeletePayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/ClearPayload" => { - #[allow(non_camel_case_types)] - struct ClearPayloadSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for ClearPayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/CreateFieldIndex" => { - #[allow(non_camel_case_types)] - struct CreateFieldIndexSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for CreateFieldIndexSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/DeleteFieldIndex" => { - #[allow(non_camel_case_types)] - struct DeleteFieldIndexSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for DeleteFieldIndexSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/Search" => { - #[allow(non_camel_case_types)] - struct SearchSvc(pub Arc); - impl tonic::server::UnaryService - for SearchSvc { - type Response = super::SearchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/SearchBatch" => { - #[allow(non_camel_case_types)] - struct SearchBatchSvc(pub Arc); - impl tonic::server::UnaryService - for SearchBatchSvc { - type Response = super::SearchBatchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/SearchGroups" => { - #[allow(non_camel_case_types)] - struct SearchGroupsSvc(pub Arc); - impl tonic::server::UnaryService - for SearchGroupsSvc { - type Response = super::SearchGroupsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).search_groups(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SearchGroupsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/Scroll" => { - #[allow(non_camel_case_types)] - struct ScrollSvc(pub Arc); - impl tonic::server::UnaryService - for ScrollSvc { - type Response = super::ScrollResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/Recommend" => { - #[allow(non_camel_case_types)] - struct RecommendSvc(pub Arc); - impl tonic::server::UnaryService - for RecommendSvc { - type Response = super::RecommendResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/RecommendBatch" => { - #[allow(non_camel_case_types)] - struct RecommendBatchSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for RecommendBatchSvc { - type Response = super::RecommendBatchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/RecommendGroups" => { - #[allow(non_camel_case_types)] - struct RecommendGroupsSvc(pub Arc); - impl< - T: Points, - > tonic::server::UnaryService - for RecommendGroupsSvc { - type Response = super::RecommendGroupsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).recommend_groups(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RecommendGroupsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/Count" => { - #[allow(non_camel_case_types)] - struct CountSvc(pub Arc); - impl tonic::server::UnaryService - for CountSvc { - type Response = super::CountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Points/UpdateBatch" => { - #[allow(non_camel_case_types)] - struct UpdateBatchSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateBatchSvc { - type Response = super::UpdateBatchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).update_batch(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateBatchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for PointsServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for PointsServer { - const NAME: &'static str = "qdrant.Points"; - } -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SyncPoints { - /// name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Wait until the changes have been applied? - #[prost(bool, optional, tag = "2")] - pub wait: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub points: ::prost::alloc::vec::Vec, - /// Start of the sync range - #[prost(message, optional, tag = "4")] - pub from_id: ::core::option::Option, - /// End of the sync range - #[prost(message, optional, tag = "5")] - pub to_id: ::core::option::Option, - #[prost(message, optional, tag = "6")] - pub ordering: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SyncPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub sync_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpsertPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub upsert_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeletePointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub delete_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateVectorsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub update_vectors: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteVectorsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub delete_vectors: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetPayloadPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub set_payload_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeletePayloadPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub delete_payload_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClearPayloadPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub clear_payload_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateFieldIndexCollectionInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub create_field_index_collection: ::core::option::Option< - CreateFieldIndexCollection, - >, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteFieldIndexCollectionInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub delete_field_index_collection: ::core::option::Option< - DeleteFieldIndexCollection, - >, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub search_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchBatchPointsInternal { - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - #[validate] - pub search_points: ::prost::alloc::vec::Vec, - #[prost(uint32, optional, tag = "3")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScrollPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub scroll_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RecommendPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub recommend_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub get_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CountPointsInternal { - #[prost(message, optional, tag = "1")] - #[validate] - pub count_points: ::core::option::Option, - #[prost(uint32, optional, tag = "2")] - pub shard_id: ::core::option::Option, -} -/// Generated client implementations. -pub mod points_internal_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 PointsInternalClient { - inner: tonic::client::Grpc, - } - impl PointsInternalClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl PointsInternalClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> PointsInternalClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - PointsInternalClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn upsert( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/Upsert", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "Upsert")); - self.inner.unary(req, path, codec).await - } - pub async fn sync( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/Sync", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "Sync")); - self.inner.unary(req, path, codec).await - } - pub async fn delete( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/Delete", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "Delete")); - self.inner.unary(req, path, codec).await - } - pub async fn update_vectors( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/UpdateVectors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "UpdateVectors")); - self.inner.unary(req, path, codec).await - } - pub async fn delete_vectors( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/DeleteVectors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "DeleteVectors")); - self.inner.unary(req, path, codec).await - } - pub async fn set_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/SetPayload", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "SetPayload")); - self.inner.unary(req, path, codec).await - } - pub async fn overwrite_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/OverwritePayload", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "OverwritePayload")); - self.inner.unary(req, path, codec).await - } - pub async fn delete_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/DeletePayload", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "DeletePayload")); - self.inner.unary(req, path, codec).await - } - pub async fn clear_payload( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/ClearPayload", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "ClearPayload")); - self.inner.unary(req, path, codec).await - } - pub async fn create_field_index( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/CreateFieldIndex", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "CreateFieldIndex")); - self.inner.unary(req, path, codec).await - } - pub async fn delete_field_index( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/DeleteFieldIndex", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "DeleteFieldIndex")); - self.inner.unary(req, path, codec).await - } - pub async fn search( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.PointsInternal/Search", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "Search")); - self.inner.unary(req, path, codec).await - } - pub async fn search_batch( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/SearchBatch", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "SearchBatch")); - self.inner.unary(req, path, codec).await - } - pub async fn scroll( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.PointsInternal/Scroll", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "Scroll")); - self.inner.unary(req, path, codec).await - } - pub async fn count( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.PointsInternal/Count", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "Count")); - self.inner.unary(req, path, codec).await - } - pub async fn recommend( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.PointsInternal/Recommend", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.PointsInternal", "Recommend")); - self.inner.unary(req, path, codec).await - } - pub async fn get( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.PointsInternal/Get", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.PointsInternal", "Get")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod points_internal_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with PointsInternalServer. - #[async_trait] - pub trait PointsInternal: Send + Sync + 'static { - async fn upsert( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn sync( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn delete( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn update_vectors( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn delete_vectors( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn set_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn overwrite_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn delete_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn clear_payload( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn create_field_index( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn delete_field_index( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn search( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn search_batch( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn scroll( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn count( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn recommend( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn get( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - #[derive(Debug)] - pub struct PointsInternalServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl PointsInternalServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for PointsInternalServer - where - T: PointsInternal, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/qdrant.PointsInternal/Upsert" => { - #[allow(non_camel_case_types)] - struct UpsertSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for UpsertSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/Sync" => { - #[allow(non_camel_case_types)] - struct SyncSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for SyncSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).sync(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SyncSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/Delete" => { - #[allow(non_camel_case_types)] - struct DeleteSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for DeleteSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/UpdateVectors" => { - #[allow(non_camel_case_types)] - struct UpdateVectorsSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for UpdateVectorsSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).update_vectors(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateVectorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/DeleteVectors" => { - #[allow(non_camel_case_types)] - struct DeleteVectorsSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for DeleteVectorsSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).delete_vectors(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteVectorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/SetPayload" => { - #[allow(non_camel_case_types)] - struct SetPayloadSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for SetPayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/OverwritePayload" => { - #[allow(non_camel_case_types)] - struct OverwritePayloadSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for OverwritePayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/DeletePayload" => { - #[allow(non_camel_case_types)] - struct DeletePayloadSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for DeletePayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/ClearPayload" => { - #[allow(non_camel_case_types)] - struct ClearPayloadSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for ClearPayloadSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/CreateFieldIndex" => { - #[allow(non_camel_case_types)] - struct CreateFieldIndexSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService< - super::CreateFieldIndexCollectionInternal, - > for CreateFieldIndexSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::CreateFieldIndexCollectionInternal, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/DeleteFieldIndex" => { - #[allow(non_camel_case_types)] - struct DeleteFieldIndexSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService< - super::DeleteFieldIndexCollectionInternal, - > for DeleteFieldIndexSvc { - type Response = super::PointsOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::DeleteFieldIndexCollectionInternal, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/Search" => { - #[allow(non_camel_case_types)] - struct SearchSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for SearchSvc { - type Response = super::SearchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/SearchBatch" => { - #[allow(non_camel_case_types)] - struct SearchBatchSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for SearchBatchSvc { - type Response = super::SearchBatchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/Scroll" => { - #[allow(non_camel_case_types)] - struct ScrollSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for ScrollSvc { - type Response = super::ScrollResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/Count" => { - #[allow(non_camel_case_types)] - struct CountSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for CountSvc { - type Response = super::CountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/Recommend" => { - #[allow(non_camel_case_types)] - struct RecommendSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for RecommendSvc { - type Response = super::RecommendResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.PointsInternal/Get" => { - #[allow(non_camel_case_types)] - struct GetSvc(pub Arc); - impl< - T: PointsInternal, - > tonic::server::UnaryService - for GetSvc { - type Response = super::GetResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for PointsInternalServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for PointsInternalServer { - const NAME: &'static str = "qdrant.PointsInternal"; - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RaftMessage { - #[prost(bytes = "vec", tag = "1")] - pub message: ::prost::alloc::vec::Vec, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AllPeers { - #[prost(message, repeated, tag = "1")] - pub all_peers: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub first_peer_id: u64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Peer { - #[prost(string, tag = "1")] - pub uri: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - pub id: u64, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPeerToKnownMessage { - #[prost(string, optional, tag = "1")] - #[validate(custom = "crate::grpc::validate::validate_not_empty")] - pub uri: ::core::option::Option<::prost::alloc::string::String>, - #[prost(uint32, optional, tag = "2")] - #[validate(custom = "crate::grpc::validate::validate_u32_range_min_1")] - pub port: ::core::option::Option, - #[prost(uint64, tag = "3")] - pub id: u64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PeerId { - #[prost(uint64, tag = "1")] - pub id: u64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Uri { - #[prost(string, tag = "1")] - pub uri: ::prost::alloc::string::String, -} -/// Generated client implementations. -pub mod raft_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 RaftClient { - inner: tonic::client::Grpc, - } - impl RaftClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl RaftClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> RaftClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - RaftClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Send Raft message to another peer - pub async fn send( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.Raft/Send"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Raft", "Send")); - self.inner.unary(req, path, codec).await - } - /// Send to bootstrap peer - /// Returns uri by id if bootstrap knows this peer - pub async fn who_is( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.Raft/WhoIs"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Raft", "WhoIs")); - self.inner.unary(req, path, codec).await - } - /// Send to bootstrap peer - /// Adds peer to the network - /// Returns all peers - pub async fn add_peer_to_known( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.Raft/AddPeerToKnown", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Raft", "AddPeerToKnown")); - self.inner.unary(req, path, codec).await - } - /// DEPRECATED - /// Its functionality is now included in `AddPeerToKnown` - /// - /// Send to bootstrap peer - /// Proposes to add this peer as participant of consensus - pub async fn add_peer_as_participant( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, 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.Raft/AddPeerAsParticipant", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Raft", "AddPeerAsParticipant")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod raft_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with RaftServer. - #[async_trait] - pub trait Raft: Send + Sync + 'static { - /// Send Raft message to another peer - async fn send( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Send to bootstrap peer - /// Returns uri by id if bootstrap knows this peer - async fn who_is( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// Send to bootstrap peer - /// Adds peer to the network - /// Returns all peers - async fn add_peer_to_known( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// DEPRECATED - /// Its functionality is now included in `AddPeerToKnown` - /// - /// Send to bootstrap peer - /// Proposes to add this peer as participant of consensus - async fn add_peer_as_participant( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - #[derive(Debug)] - pub struct RaftServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl RaftServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for RaftServer - where - T: Raft, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/qdrant.Raft/Send" => { - #[allow(non_camel_case_types)] - struct SendSvc(pub Arc); - impl tonic::server::UnaryService - for SendSvc { - type Response = (); - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).send(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SendSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Raft/WhoIs" => { - #[allow(non_camel_case_types)] - struct WhoIsSvc(pub Arc); - impl tonic::server::UnaryService - for WhoIsSvc { - type Response = super::Uri; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).who_is(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = WhoIsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Raft/AddPeerToKnown" => { - #[allow(non_camel_case_types)] - struct AddPeerToKnownSvc(pub Arc); - impl< - T: Raft, - > tonic::server::UnaryService - for AddPeerToKnownSvc { - type Response = super::AllPeers; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).add_peer_to_known(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = AddPeerToKnownSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Raft/AddPeerAsParticipant" => { - #[allow(non_camel_case_types)] - struct AddPeerAsParticipantSvc(pub Arc); - impl tonic::server::UnaryService - for AddPeerAsParticipantSvc { - type Response = (); - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).add_peer_as_participant(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = AddPeerAsParticipantSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for RaftServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for RaftServer { - const NAME: &'static str = "qdrant.Raft"; - } -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateFullSnapshotRequest {} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListFullSnapshotsRequest {} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteFullSnapshotRequest { - /// Name of the full snapshot - #[prost(string, tag = "1")] - #[validate(length(min = 1))] - pub snapshot_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateSnapshotRequest { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListSnapshotsRequest { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[derive(validator::Validate)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteSnapshotRequest { - /// Name of the collection - #[prost(string, tag = "1")] - #[validate(length(min = 1, max = 255))] - pub collection_name: ::prost::alloc::string::String, - /// Name of the collection snapshot - #[prost(string, tag = "2")] - #[validate(length(min = 1))] - pub snapshot_name: ::prost::alloc::string::String, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotDescription { - /// Name of the snapshot - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Creation time of the snapshot - #[prost(message, optional, tag = "2")] - pub creation_time: ::core::option::Option, - /// Size of the snapshot in bytes - #[prost(int64, tag = "3")] - pub size: i64, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[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, - /// Time spent to process - #[prost(double, tag = "2")] - pub time: f64, -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteSnapshotResponse { - /// Time spent to process - #[prost(double, tag = "1")] - pub time: f64, -} -/// 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; - #[derive(Debug, Clone)] - pub struct SnapshotsClient { - inner: tonic::client::Grpc, - } - impl SnapshotsClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl SnapshotsClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> SnapshotsClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - SnapshotsClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Create collection snapshot - pub async fn create( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "Create")); - self.inner.unary(req, path, codec).await - } - /// List collection snapshots - pub async fn list( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "List")); - self.inner.unary(req, path, codec).await - } - /// Delete collection snapshots - pub async fn delete( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/Delete"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "Delete")); - self.inner.unary(req, path, codec).await - } - /// Create full storage snapshot - pub async fn create_full( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Snapshots", "CreateFull")); - self.inner.unary(req, path, codec).await - } - /// List full storage snapshots - pub async fn list_full( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "ListFull")); - self.inner.unary(req, path, codec).await - } - /// List full storage snapshots - pub async fn delete_full( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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/DeleteFull", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("qdrant.Snapshots", "DeleteFull")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod snapshots_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with SnapshotsServer. - #[async_trait] - pub trait Snapshots: Send + Sync + 'static { - /// Create collection snapshot - async fn create( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// List collection snapshots - async fn list( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delete collection snapshots - async fn delete( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Create full storage snapshot - async fn create_full( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// List full storage snapshots - async fn list_full( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// List full storage snapshots - async fn delete_full( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct SnapshotsServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl SnapshotsServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for SnapshotsServer - where - T: Snapshots, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/qdrant.Snapshots/Create" => { - #[allow(non_camel_case_types)] - struct CreateSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for CreateSvc { - type Response = super::CreateSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Snapshots/List" => { - #[allow(non_camel_case_types)] - struct ListSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for ListSvc { - type Response = super::ListSnapshotsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Snapshots/Delete" => { - #[allow(non_camel_case_types)] - struct DeleteSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for DeleteSvc { - type Response = super::DeleteSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Snapshots/CreateFull" => { - #[allow(non_camel_case_types)] - struct CreateFullSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for CreateFullSvc { - type Response = super::CreateSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Snapshots/ListFull" => { - #[allow(non_camel_case_types)] - struct ListFullSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for ListFullSvc { - type Response = super::ListSnapshotsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/qdrant.Snapshots/DeleteFull" => { - #[allow(non_camel_case_types)] - struct DeleteFullSvc(pub Arc); - impl< - T: Snapshots, - > tonic::server::UnaryService - for DeleteFullSvc { - type Response = super::DeleteSnapshotResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).delete_full(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for SnapshotsServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for SnapshotsServer { - const NAME: &'static str = "qdrant.Snapshots"; - } -} -#[derive(serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HealthCheckRequest {} -#[derive(serde::Serialize)] -#[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, -} -/// 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; - #[derive(Debug, Clone)] - pub struct QdrantClient { - inner: tonic::client::Grpc, - } - impl QdrantClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QdrantClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> QdrantClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - QdrantClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn health_check( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("qdrant.Qdrant", "HealthCheck")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod qdrant_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QdrantServer. - #[async_trait] - pub trait Qdrant: Send + Sync + 'static { - async fn health_check( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct QdrantServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl QdrantServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for QdrantServer - where - T: Qdrant, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/qdrant.Qdrant/HealthCheck" => { - #[allow(non_camel_case_types)] - struct HealthCheckSvc(pub Arc); - impl< - T: Qdrant, - > tonic::server::UnaryService - for HealthCheckSvc { - type Response = super::HealthCheckReply; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - 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 max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let 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, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for QdrantServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for QdrantServer { - const NAME: &'static str = "qdrant.Qdrant"; - } -} -use super::validate::ValidateExt; diff --git a/crates/qdrant/lib/api/src/grpc/transport_channel_pool.rs b/crates/qdrant/lib/api/src/grpc/transport_channel_pool.rs deleted file mode 100644 index bb9f15d..0000000 --- a/crates/qdrant/lib/api/src/grpc/transport_channel_pool.rs +++ /dev/null @@ -1,378 +0,0 @@ -use std::collections::HashMap; -use std::future::Future; -use std::num::NonZeroUsize; -use std::time::Duration; - -use rand::{thread_rng, Rng}; -use tokio::select; -use tonic::transport::{Channel, ClientTlsConfig, Error as TonicError, Uri}; -use tonic::{Code, Status}; - -use crate::grpc::dynamic_channel_pool::DynamicChannelPool; -use crate::grpc::dynamic_pool::CountedItem; -use crate::grpc::qdrant::qdrant_client::QdrantClient; -use crate::grpc::qdrant::HealthCheckRequest; - -pub const DEFAULT_GRPC_TIMEOUT: Duration = Duration::from_secs(60); -pub const DEFAULT_CONNECT_TIMEOUT: Duration = Duration::from_secs(2); -pub const DEFAULT_POOL_SIZE: usize = 2; - -/// Allow a large number of connections per channel, that is close to the limit of -/// `http2_max_pending_accept_reset_streams` that we configure to minimize the chance of -/// GOAWAY/ENHANCE_YOUR_CALM errors from occurring. -/// More info: -const MAX_CONNECTIONS_PER_CHANNEL: usize = 1024; -const DEFAULT_RETRIES: usize = 2; -const DEFAULT_BACKOFF: Duration = Duration::from_millis(100); - -/// How long to wait for response from server, before checking health of the server -const SMART_CONNECT_INTERVAL: Duration = Duration::from_secs(1); - -/// There is no indication, that health-check API is affected by high parallel load -/// So we can use small timeout for health-check -const HEALTH_CHECK_TIMEOUT: Duration = Duration::from_secs(2); - -/// Try to recreate channel, if there were no successful requests within this time -const CHANNEL_TTL: Duration = Duration::from_secs(5); - -#[derive(thiserror::Error, Debug)] -pub enum RequestError { - #[error("Error in closure supplied to transport channel pool: {0}")] - FromClosure(E), - #[error("Tonic error: {0}")] - Tonic(#[from] TonicError), -} - -enum RetryAction { - Fail(Status), - RetryOnce(Status), - RetryWithBackoff(Status), - RetryImmediately(Status), -} - -#[derive(Debug)] -enum HealthCheckError { - NoChannel, - ConnectionError(TonicError), - RequestError(Status), -} - -#[derive(Debug)] -enum RequestFailure { - HealthCheck(HealthCheckError), - RequestError(Status), - RequestConnection(TonicError), -} - -/// Holds a pool of channels established for a set of URIs. -/// Channel are shared by cloning them. -/// Make the `pool_size` larger to increase throughput. -pub struct TransportChannelPool { - uri_to_pool: tokio::sync::RwLock>, - pool_size: NonZeroUsize, - grpc_timeout: Duration, - connection_timeout: Duration, - tls_config: Option, -} - -impl Default for TransportChannelPool { - fn default() -> Self { - Self { - uri_to_pool: tokio::sync::RwLock::new(HashMap::new()), - pool_size: NonZeroUsize::new(DEFAULT_POOL_SIZE).unwrap(), - grpc_timeout: DEFAULT_GRPC_TIMEOUT, - connection_timeout: DEFAULT_CONNECT_TIMEOUT, - tls_config: None, - } - } -} - -impl TransportChannelPool { - pub fn new( - p2p_grpc_timeout: Duration, - connection_timeout: Duration, - pool_size: usize, - tls_config: Option, - ) -> Self { - Self { - uri_to_pool: Default::default(), - grpc_timeout: p2p_grpc_timeout, - connection_timeout, - pool_size: NonZeroUsize::new(pool_size).unwrap(), - tls_config, - } - } - - async fn _init_pool_for_uri(&self, uri: Uri) -> Result { - DynamicChannelPool::new( - uri, - self.grpc_timeout, - self.connection_timeout, - self.tls_config.clone(), - MAX_CONNECTIONS_PER_CHANNEL, - self.pool_size.get(), - ) - .await - } - - /// Initialize a pool for the URI and return a clone of the first channel. - /// Does not fail if the pool already exist. - async fn init_pool_for_uri(&self, uri: Uri) -> Result, TonicError> { - let mut guard = self.uri_to_pool.write().await; - match guard.get_mut(&uri) { - None => { - let channels = self._init_pool_for_uri(uri.clone()).await?; - let channel = channels.choose().await?; - guard.insert(uri, channels); - Ok(channel) - } - Some(channels) => channels.choose().await, - } - } - - pub async fn drop_pool(&self, uri: &Uri) { - let mut guard = self.uri_to_pool.write().await; - guard.remove(uri); - } - - pub async fn drop_channel(&self, uri: &Uri, channel: CountedItem) { - let guard = self.uri_to_pool.read().await; - if let Some(pool) = guard.get(uri) { - pool.drop_channel(channel); - } - } - - async fn get_pooled_channel( - &self, - uri: &Uri, - ) -> Option, TonicError>> { - let guard = self.uri_to_pool.read().await; - match guard.get(uri) { - None => None, - Some(channels) => Some(channels.choose().await), - } - } - - async fn get_or_create_pooled_channel( - &self, - uri: &Uri, - ) -> Result, TonicError> { - match self.get_pooled_channel(uri).await { - None => self.init_pool_for_uri(uri.clone()).await, - Some(channel) => channel, - } - } - - /// Checks if the channel is still alive. - /// - /// It uses duplicate "fast" channel, equivalent to the original, but with smaller timeout. - /// If it can't get healthcheck response in the timeout, it assumes the channel is dead. - /// And we need to drop the pool for the uri and try again. - /// For performance reasons, we start the check only after `SMART_CONNECT_TIMEOUT`. - async fn check_connectability(&self, uri: &Uri) -> HealthCheckError { - loop { - tokio::time::sleep(SMART_CONNECT_INTERVAL).await; - let channel = self.get_pooled_channel(uri).await; - match channel { - None => return HealthCheckError::NoChannel, - Some(Err(tonic_error)) => return HealthCheckError::ConnectionError(tonic_error), - Some(Ok(channel)) => { - let mut client = QdrantClient::new(channel.item().clone()); - - let resp: Result<_, Status> = select! { - res = client.health_check(HealthCheckRequest {}) => { - res - } - _ = tokio::time::sleep(HEALTH_CHECK_TIMEOUT) => { - // Current healthcheck timed out, but maybe there were other requests - // that succeeded in a given time window. - // If so, we can continue watching. - if channel.last_success_age() > HEALTH_CHECK_TIMEOUT { - return HealthCheckError::RequestError(Status::deadline_exceeded(format!("Healthcheck timeout {}ms exceeded", HEALTH_CHECK_TIMEOUT.as_millis()))) - } else { - continue; - } - } - }; - match resp { - Ok(_) => { - channel.report_success(); - // continue watching - } - Err(status) => return HealthCheckError::RequestError(status), - } - } - } - } - } - - async fn _make_request>>( - &self, - uri: &Uri, - f: &impl Fn(Channel) -> O, - timeout: Duration, - ) -> Result { - let channel = match self.get_or_create_pooled_channel(uri).await { - Ok(channel) => channel, - Err(tonic_error) => { - return Err(RequestFailure::RequestConnection(tonic_error)); - } - }; - - let result: RequestFailure = select! { - res = f(channel.item().clone()) => { - match res { - Ok(body) => { - channel.report_success(); - return Ok(body); - }, - Err(err) => RequestFailure::RequestError(err) - } - } - res = self.check_connectability(uri) => { - RequestFailure::HealthCheck(res) - } - _res = tokio::time::sleep(timeout) => { - RequestFailure::RequestError(Status::deadline_exceeded(format!("Timeout {}ms reached for uri: {}", timeout.as_millis(), uri))) - } - }; - - // After this point the request is not successful, but we can try to recover - let last_success_age = channel.last_success_age(); - if last_success_age > CHANNEL_TTL { - // There were no successful requests for a long time, we can try to reconnect - // It might be possible that server died and changed its ip address - self.drop_channel(uri, channel).await; - } else { - // We don't need this channel anymore, drop before waiting for the backoff - drop(channel); - } - - Err(result) - } - - // Allows to use channel to `uri`. If there is no channels to specified uri - they will be created. - pub async fn with_channel_timeout>>( - &self, - uri: &Uri, - f: impl Fn(Channel) -> O, - timeout: Option, - retries: usize, - ) -> Result> { - let mut retries_left = retries; - let mut attempt = 0; - let max_timeout = timeout.unwrap_or_else(|| self.grpc_timeout + self.connection_timeout); - - loop { - let request_result: Result = self._make_request(uri, &f, max_timeout).await; - - let error_result = match request_result { - Ok(body) => return Ok(body), - Err(err) => err, - }; - - let action = match error_result { - RequestFailure::HealthCheck(healthcheck_error) => { - match healthcheck_error { - HealthCheckError::NoChannel => { - // The channel pool was dropped during the request processing. - // Meaning that the peer is not available anymore. - // So we can just fail the request. - RetryAction::Fail(Status::unavailable(format!( - "Peer {} is not available", - uri - ))) - } - HealthCheckError::ConnectionError(error) => { - // Can't establish connection to the server during the healthcheck. - // Possible situation: - // - Server was killed during the request processing and request timed out. - // Actions: - // - retry no backoff - RetryAction::RetryImmediately(Status::unavailable(format!( - "Failed to connect to {}, error: {}", - uri, error - ))) - } - HealthCheckError::RequestError(status) => { - // Channel might be unavailable or overloaded. - // Or server might be dead. - RetryAction::RetryWithBackoff(status) - } - } - } - RequestFailure::RequestError(status) => { - match status.code() { - Code::Cancelled | Code::Unavailable => { - // Possible situations: - // - Server is frozen and will never respond. - // - Server is overloaded and will respond in the future. - RetryAction::RetryWithBackoff(status) - } - Code::Internal => { - // Something is broken, but let's retry anyway, but only once. - RetryAction::RetryOnce(status) - } - _ => { - // No special handling, just fail already. - RetryAction::Fail(status) - } - } - } - RequestFailure::RequestConnection(error) => { - // Can't establish connection to the server during the request. - // Possible situation: - // - Server is killed - // - Server is overloaded - // Actions: - // - retry with backoff - RetryAction::RetryWithBackoff(Status::unavailable(format!( - "Failed to connect to {}, error: {}", - uri, error - ))) - } - }; - - let (backoff_time, fallback_status) = match action { - RetryAction::Fail(err) => return Err(RequestError::FromClosure(err)), - RetryAction::RetryImmediately(fallback_status) => (Duration::ZERO, fallback_status), - RetryAction::RetryWithBackoff(fallback_status) => { - // Calculate backoff - let backoff = DEFAULT_BACKOFF * 2u32.pow(attempt as u32) - + Duration::from_millis(thread_rng().gen_range(0..100)); - - if backoff > max_timeout { - // We can't wait for the request any longer, return the error as is - return Err(RequestError::FromClosure(fallback_status)); - } - (backoff, fallback_status) - } - RetryAction::RetryOnce(fallback_status) => { - if retries_left > 1 { - retries_left = 1; - } - (Duration::ZERO, fallback_status) - } - }; - - attempt += 1; - if retries_left == 0 { - return Err(RequestError::FromClosure(fallback_status)); - } - retries_left = retries_left.saturating_sub(1); - - // Wait for the backoff - tokio::time::sleep(backoff_time).await; - } - } - - // Allows to use channel to `uri`. If there is no channels to specified uri - they will be created. - pub async fn with_channel>>( - &self, - uri: &Uri, - f: impl Fn(Channel) -> O, - ) -> Result> { - self.with_channel_timeout(uri, f, None, DEFAULT_RETRIES) - .await - } -} diff --git a/crates/qdrant/lib/api/src/grpc/validate.rs b/crates/qdrant/lib/api/src/grpc/validate.rs deleted file mode 100644 index d18967a..0000000 --- a/crates/qdrant/lib/api/src/grpc/validate.rs +++ /dev/null @@ -1,419 +0,0 @@ -use std::borrow::Cow; -use std::collections::HashMap; - -use serde::Serialize; -use validator::{Validate, ValidationError, ValidationErrors}; - -use super::qdrant::{GeoPoint, NamedVectors}; - -pub trait ValidateExt { - fn validate(&self) -> Result<(), ValidationErrors>; -} - -impl Validate for dyn ValidateExt { - #[inline] - fn validate(&self) -> Result<(), ValidationErrors> { - ValidateExt::validate(self) - } -} - -impl ValidateExt for ::core::option::Option -where - V: Validate, -{ - #[inline] - fn validate(&self) -> Result<(), ValidationErrors> { - (&self).validate() - } -} - -impl ValidateExt for &::core::option::Option -where - V: Validate, -{ - #[inline] - fn validate(&self) -> Result<(), ValidationErrors> { - self.as_ref().map(Validate::validate).unwrap_or(Ok(())) - } -} - -impl ValidateExt for Vec -where - V: Validate, -{ - #[inline] - fn validate(&self) -> Result<(), ValidationErrors> { - let errors = self - .iter() - .filter_map(|v| v.validate().err()) - .fold(Err(ValidationErrors::new()), |bag, err| { - ValidationErrors::merge(bag, "?", Err(err)) - }) - .unwrap_err(); - errors.errors().is_empty().then_some(()).ok_or(errors) - } -} - -impl ValidateExt for HashMap -where - V: Validate, -{ - #[inline] - fn validate(&self) -> Result<(), ValidationErrors> { - let errors = self - .values() - .filter_map(|v| v.validate().err()) - .fold(Err(ValidationErrors::new()), |bag, err| { - ValidationErrors::merge(bag, "?", Err(err)) - }) - .unwrap_err(); - errors.errors().is_empty().then_some(()).ok_or(errors) - } -} - -impl Validate for crate::grpc::qdrant::vectors_config::Config { - fn validate(&self) -> Result<(), ValidationErrors> { - use crate::grpc::qdrant::vectors_config::Config; - match self { - Config::Params(params) => params.validate(), - Config::ParamsMap(params_map) => params_map.validate(), - } - } -} - -impl Validate for crate::grpc::qdrant::vectors_config_diff::Config { - fn validate(&self) -> Result<(), ValidationErrors> { - use crate::grpc::qdrant::vectors_config_diff::Config; - match self { - Config::Params(params) => params.validate(), - Config::ParamsMap(params_map) => params_map.validate(), - } - } -} - -impl Validate for crate::grpc::qdrant::quantization_config::Quantization { - fn validate(&self) -> Result<(), ValidationErrors> { - use crate::grpc::qdrant::quantization_config::Quantization; - match self { - Quantization::Scalar(scalar) => scalar.validate(), - Quantization::Product(product) => product.validate(), - } - } -} - -impl Validate for crate::grpc::qdrant::quantization_config_diff::Quantization { - fn validate(&self) -> Result<(), ValidationErrors> { - use crate::grpc::qdrant::quantization_config_diff::Quantization; - match self { - Quantization::Scalar(scalar) => scalar.validate(), - Quantization::Product(product) => product.validate(), - Quantization::Disabled(_) => Ok(()), - } - } -} - -/// Validate that `value` is a non-empty string or `None`. -pub fn validate_not_empty(value: &Option) -> Result<(), ValidationError> { - match value { - Some(value) if value.is_empty() => Err(ValidationError::new("not_empty")), - _ => Ok(()), - } -} - -/// Validate the value is in `[1, ]` or `None`. -pub fn validate_u64_range_min_1(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(1), None) -} - -/// Validate the value is in `[1, ]` or `None`. -pub fn validate_u32_range_min_1(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(1), None) -} - -/// Validate the value is in `[100, ]` or `None`. -pub fn validate_u64_range_min_100(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(100), None) -} - -/// Validate the value is in `[1000, ]` or `None`. -pub fn validate_u64_range_min_1000(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(1000), None) -} - -/// Validate the value is in `[4, ]` or `None`. -pub fn validate_u64_range_min_4(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(4), None) -} - -/// Validate the value is in `[4, 10000]` or `None`. -pub fn validate_u64_range_min_4_max_10000(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(4), Some(10_000)) -} - -/// Validate the value is in `[0.5, 1.0]` or `None`. -pub fn validate_f32_range_min_0_5_max_1(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(0.5), Some(1.0)) -} - -/// Validate the value is in `[0.0, 1.0]` or `None`. -pub fn validate_f64_range_1(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(0.0), Some(1.0)) -} - -/// Validate the value is in `[1.0, ]` or `None`. -pub fn validate_f64_range_min_1(value: &Option) -> Result<(), ValidationError> { - validate_range_generic(value, Some(1.0), None) -} - -/// Validate the value is in `[min, max]` or `None`. -#[inline] -pub fn validate_range_generic( - value: &Option, - min: Option, - max: Option, -) -> Result<(), ValidationError> -where - N: PartialOrd + Serialize, -{ - // If value is None we're good - let value = match value { - Some(value) => value, - None => return Ok(()), - }; - - // If value is within bounds we're good - if min.as_ref().map(|min| value >= min).unwrap_or(true) - && max.as_ref().map(|max| value <= max).unwrap_or(true) - { - return Ok(()); - } - - let mut err = ValidationError::new("range"); - if let Some(min) = min { - err.add_param(Cow::from("min"), &min); - } - if let Some(max) = max { - err.add_param(Cow::from("max"), &max); - } - Err(err) -} - -/// Validate the list of named vectors is not empty. -pub fn validate_named_vectors_not_empty( - value: &Option, -) -> Result<(), ValidationError> { - // If length is non-zero, we're good - match value { - Some(vectors) if !vectors.vectors.is_empty() => return Ok(()), - Some(_) | None => {} - } - - let mut err = ValidationError::new("length"); - err.add_param(Cow::from("min"), &1); - Err(err) -} - -/// Validate the collection name contains no illegal characters. -pub fn validate_collection_name(value: &str) -> Result<(), ValidationError> { - const INVALID_CHARS: [char; 11] = - ['<', '>', ':', '"', '/', '\\', '|', '?', '*', '\0', '\u{1F}']; - - match INVALID_CHARS.into_iter().find(|c| value.contains(*c)) { - Some(c) => { - let mut err = ValidationError::new("does_not_contain"); - err.add_param(Cow::from("pattern"), &c); - err.message - .replace(format!("collection name cannot contain \"{c}\" char").into()); - Err(err) - } - None => Ok(()), - } -} - -/// Validate a polygon has at least 4 points and is closed. -pub fn validate_geo_polygon(points: &Vec) -> Result<(), ValidationError> { - let min_length = 4; - if points.len() < min_length { - let mut err = ValidationError::new("min_polygon_length"); - err.add_param(Cow::from("length"), &points.len()); - err.add_param(Cow::from("min_length"), &min_length); - return Err(err); - } - - let first_point = &points[0]; - let last_point = &points[points.len() - 1]; - if first_point != last_point { - return Err(ValidationError::new("closed_polygon")); - } - - Ok(()) -} - -#[cfg(test)] -mod tests { - use validator::Validate; - - use crate::grpc::qdrant::{ - CreateCollection, CreateFieldIndexCollection, GeoPoint, GeoPolygon, SearchPoints, - UpdateCollection, - }; - - #[test] - fn test_good_request() { - let bad_request = CreateCollection { - collection_name: "test_collection".into(), - timeout: Some(10), - ..Default::default() - }; - assert!( - bad_request.validate().is_ok(), - "good collection request should not error on validation" - ); - - // Collection name validation must not be strict on non-creation - let bad_request = UpdateCollection { - collection_name: "no/path".into(), - ..Default::default() - }; - assert!( - bad_request.validate().is_ok(), - "good collection request should not error on validation" - ); - - // Collection name validation must not be strict on non-creation - let bad_request = UpdateCollection { - collection_name: "no*path".into(), - ..Default::default() - }; - assert!( - bad_request.validate().is_ok(), - "good collection request should not error on validation" - ); - } - - #[test] - fn test_bad_collection_request() { - let bad_request = CreateCollection { - collection_name: "".into(), - timeout: Some(0), - ..Default::default() - }; - assert!( - bad_request.validate().is_err(), - "bad collection request should error on validation" - ); - - // Collection name validation must be strict on creation - let bad_request = CreateCollection { - collection_name: "no/path".into(), - ..Default::default() - }; - assert!( - bad_request.validate().is_err(), - "bad collection request should error on validation" - ); - - // Collection name validation must be strict on creation - let bad_request = CreateCollection { - collection_name: "no*path".into(), - ..Default::default() - }; - assert!( - bad_request.validate().is_err(), - "bad collection request should error on validation" - ); - } - - #[test] - fn test_bad_index_request() { - let bad_request = CreateFieldIndexCollection { - collection_name: "".into(), - field_name: "".into(), - ..Default::default() - }; - assert!( - bad_request.validate().is_err(), - "bad index request should error on validation" - ); - } - - #[test] - fn test_bad_search_request() { - let bad_request = SearchPoints { - collection_name: "".into(), - limit: 0, - vector_name: Some("".into()), - ..Default::default() - }; - assert!( - bad_request.validate().is_err(), - "bad search request should error on validation" - ); - - let bad_request = SearchPoints { - limit: 0, - ..Default::default() - }; - assert!( - bad_request.validate().is_err(), - "bad search request should error on validation" - ); - - let bad_request = SearchPoints { - vector_name: Some("".into()), - ..Default::default() - }; - assert!( - bad_request.validate().is_err(), - "bad search request should error on validation" - ); - } - - #[test] - fn test_geo_polygon() { - let bad_polygon = GeoPolygon { points: vec![] }; - assert!( - bad_polygon.validate().is_err(), - "bad polygon should error on validation" - ); - - let bad_polygon = GeoPolygon { - points: vec![ - GeoPoint { lat: 1., lon: 1. }, - GeoPoint { lat: 2., lon: 2. }, - GeoPoint { lat: 3., lon: 3. }, - ], - }; - assert!( - bad_polygon.validate().is_err(), - "bad polygon should error on validation" - ); - - let bad_polygon = GeoPolygon { - points: vec![ - GeoPoint { lat: 1., lon: 1. }, - GeoPoint { lat: 2., lon: 2. }, - GeoPoint { lat: 3., lon: 3. }, - GeoPoint { lat: 4., lon: 4. }, - ], - }; - - assert!( - bad_polygon.validate().is_err(), - "bad polygon should error on validation" - ); - - let good_polygon = GeoPolygon { - points: vec![ - GeoPoint { lat: 1., lon: 1. }, - GeoPoint { lat: 2., lon: 2. }, - GeoPoint { lat: 3., lon: 3. }, - GeoPoint { lat: 1., lon: 1. }, - ], - }; - assert!( - good_polygon.validate().is_ok(), - "good polygon should not error on validation" - ); - } -} diff --git a/crates/qdrant/lib/api/src/lib.rs b/crates/qdrant/lib/api/src/lib.rs deleted file mode 100644 index 773d491..0000000 --- a/crates/qdrant/lib/api/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod grpc; diff --git a/crates/qdrant/lib/collection/Cargo.toml b/crates/qdrant/lib/collection/Cargo.toml deleted file mode 100644 index 430a15d..0000000 --- a/crates/qdrant/lib/collection/Cargo.toml +++ /dev/null @@ -1,68 +0,0 @@ -[package] -name = "collection" -version = "0.4.2" -authors = [ - "Andrey Vasnetsov ", - "Qdrant Team ", -] -license = "Apache-2.0" -edition = "2021" - -[dev-dependencies] -tempfile = "3.7.1" -criterion = "0.5" -rstest = "0.18.1" - -[target.'cfg(not(target_os = "windows"))'.dev-dependencies] -pprof = { version = "0.12", features = ["flamegraph", "prost-codec"] } - -[dependencies] - -parking_lot = "0.12" - -rand = "0.8.5" -thiserror = "1.0" -serde = { version = "~1.0", features = ["derive"] } -serde_json = { version = "~1.0", features = ["std"] } -serde_cbor = "0.11.2" -rmp-serde = "~1.1" -wal = { git = "https://github.com/qdrant/wal.git", rev = "a32f6a38acf7ffd761df83b0790eaefeb107cd60"} -ordered-float = "3.7" -hashring = "0.3.2" -tinyvec = { version = "1.6.0", features = ["alloc"] } - -tokio = {version = "~1.29", features = ["full"]} -futures = "0.3.28" -atomicwrites = "0.4.1" -log = "0.4" -env_logger = "0.10.0" -merge = "0.1.0" -async-trait = "0.1.72" -arc-swap = "1.6.0" -tonic = { version = "0.9.2", features = ["gzip", "tls"] } -tower = "0.4.13" -uuid = { version = "1.4", features = ["v4", "serde"] } -url = { version = "2", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } -actix-web-validator = "5.0.1" - -common = {path = "../common"} -segment = {path = "../segment"} -api = {path = "../api"} - -itertools = "0.11" -indicatif = "0.17.6" -chrono = { version = "~0.4", features = ["serde"] } -schemars = { version = "0.8.12", features = ["uuid1", "preserve_order", "chrono", "url"] } -num_cpus = "1.16.0" -tar = "0.4.40" -fs_extra = "1.3.0" -semver = "1.0.18" - -[[bench]] -name = "hash_ring_bench" -harness = false - -[[bench]] -name = "batch_search_bench" -harness = false diff --git a/crates/qdrant/lib/collection/README.md b/crates/qdrant/lib/collection/README.md deleted file mode 100644 index 1d1be13..0000000 --- a/crates/qdrant/lib/collection/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Collection - -Crate, which implements all functions required for operations with a single collection of points. -Points within a collection should share the same payload schema and have same vector size. -So that search requests could be performed over all points of a single collection. - -## Structure - -![Collection structure](./docs/collection-struct.mmd.png) - -## Update process - -![Update process](./docs/update-sequence.mmd.png) - diff --git a/crates/qdrant/lib/collection/benches/batch_search_bench.rs b/crates/qdrant/lib/collection/benches/batch_search_bench.rs deleted file mode 100644 index 748c3b8..0000000 --- a/crates/qdrant/lib/collection/benches/batch_search_bench.rs +++ /dev/null @@ -1,202 +0,0 @@ -#[cfg(not(target_os = "windows"))] -mod prof; - -use std::num::{NonZeroU32, NonZeroU64}; -use std::sync::Arc; - -use collection::config::{CollectionConfig, CollectionParams, WalConfig}; -use collection::operations::point_ops::{PointInsertOperations, PointOperations, PointStruct}; -use collection::operations::types::{SearchRequest, SearchRequestBatch, VectorParams}; -use collection::operations::CollectionUpdateOperations; -use collection::optimizers_builder::OptimizersConfig; -use collection::shards::local_shard::LocalShard; -use collection::shards::shard_trait::ShardOperation; -use criterion::{criterion_group, criterion_main, Criterion}; -use rand::thread_rng; -use segment::data_types::vectors::only_default_vector; -use segment::fixtures::payload_fixtures::random_vector; -use segment::types::{Condition, Distance, FieldCondition, Filter, Payload, Range}; -use serde_json::Map; -use tempfile::Builder; -use tokio::runtime::Runtime; -use tokio::sync::RwLock; - -fn create_rnd_batch() -> CollectionUpdateOperations { - let mut rng = thread_rng(); - let num_points = 2000; - let dim = 100; - let mut points = Vec::with_capacity(num_points); - for i in 0..num_points { - let mut payload_map = Map::new(); - payload_map.insert("a".to_string(), (i % 5).into()); - let vector = random_vector(&mut rng, dim); - let vectors = only_default_vector(&vector); - let point = PointStruct { - id: (i as u64).into(), - vector: vectors.into(), - payload: Some(Payload(payload_map)), - }; - points.push(point); - } - CollectionUpdateOperations::PointOperation(PointOperations::UpsertPoints( - PointInsertOperations::PointsList(points), - )) -} - -fn batch_search_bench(c: &mut Criterion) { - let storage_dir = Builder::new().prefix("storage").tempdir().unwrap(); - - let runtime = Runtime::new().unwrap(); - let search_runtime = Runtime::new().unwrap(); - let search_runtime_handle = search_runtime.handle(); - let handle = runtime.handle().clone(); - - let wal_config = WalConfig { - wal_capacity_mb: 1, - wal_segments_ahead: 0, - }; - - let collection_params = CollectionParams { - vectors: VectorParams { - size: NonZeroU64::new(100).unwrap(), - distance: Distance::Dot, - hnsw_config: None, - quantization_config: None, - on_disk: None, - } - .into(), - shard_number: NonZeroU32::new(1).expect("Shard number can not be zero"), - replication_factor: NonZeroU32::new(1).unwrap(), - write_consistency_factor: NonZeroU32::new(1).unwrap(), - on_disk_payload: false, - }; - - let collection_config = CollectionConfig { - params: collection_params, - optimizer_config: OptimizersConfig { - deleted_threshold: 0.9, - vacuum_min_vector_number: 1000, - default_segment_number: 2, - max_segment_size: Some(100_000), - memmap_threshold: Some(100_000), - indexing_threshold: Some(50_000), - flush_interval_sec: 30, - max_optimization_threads: 2, - }, - wal_config, - hnsw_config: Default::default(), - quantization_config: Default::default(), - }; - - let shared_config = Arc::new(RwLock::new(collection_config)); - - let shard = handle - .block_on(LocalShard::build_local( - 0, - "test_collection".to_string(), - storage_dir.path(), - shared_config, - Default::default(), - handle.clone(), - )) - .unwrap(); - - let rnd_batch = create_rnd_batch(); - - handle.block_on(shard.update(rnd_batch, true)).unwrap(); - - let mut group = c.benchmark_group("batch-search-bench"); - - let filters = vec![ - None, - Some(Filter::new_must(Condition::Field( - FieldCondition::new_match("a".to_string(), 3.into()), - ))), - Some(Filter::new_must(Condition::Field( - FieldCondition::new_range( - "a".to_string(), - Range { - lt: None, - gt: Some(-1.), - gte: None, - lte: Some(100.0), - }, - ), - ))), - ]; - - let batch_size = 100; - - for (fid, filter) in filters.into_iter().enumerate() { - group.bench_function(format!("search-{fid}"), |b| { - b.iter(|| { - runtime.block_on(async { - let mut rng = thread_rng(); - for _i in 0..batch_size { - let query = random_vector(&mut rng, 100); - let search_query = SearchRequest { - vector: query.into(), - filter: filter.clone(), - params: None, - limit: 10, - offset: 0, - with_payload: None, - with_vector: None, - score_threshold: None, - }; - let result = shard - .search( - Arc::new(SearchRequestBatch { - searches: vec![search_query], - }), - search_runtime_handle, - ) - .await - .unwrap(); - assert!(!result.is_empty()); - } - }); - }) - }); - - group.bench_function(format!("search-batch-{fid}"), |b| { - b.iter(|| { - runtime.block_on(async { - let mut rng = thread_rng(); - let mut searches = Vec::with_capacity(batch_size); - for _i in 0..batch_size { - let query = random_vector(&mut rng, 100); - let search_query = SearchRequest { - vector: query.into(), - filter: filter.clone(), - params: None, - limit: 10, - offset: 0, - with_payload: None, - with_vector: None, - score_threshold: None, - }; - searches.push(search_query); - } - - let search_query = SearchRequestBatch { searches }; - let result = shard - .search(Arc::new(search_query), search_runtime_handle) - .await - .unwrap(); - assert!(!result.is_empty()); - }); - }) - }); - } - - group.finish(); -} - -criterion_group! { - name = benches; - config = Criterion::default(); - targets = batch_search_bench, -} - -criterion_main!(benches); diff --git a/crates/qdrant/lib/collection/benches/hash_ring_bench.rs b/crates/qdrant/lib/collection/benches/hash_ring_bench.rs deleted file mode 100644 index 1fb95f6..0000000 --- a/crates/qdrant/lib/collection/benches/hash_ring_bench.rs +++ /dev/null @@ -1,43 +0,0 @@ -#[cfg(not(target_os = "windows"))] -mod prof; - -use collection::hash_ring::HashRing; -use criterion::{criterion_group, criterion_main, Criterion}; -use rand::Rng; - -fn hash_ring_bench(c: &mut Criterion) { - let mut group = c.benchmark_group("hash-ring-bench"); - - let mut ring_raw = HashRing::raw(); - let mut ring_fair = HashRing::fair(100); - - // add 10 shards to ring - for i in 0..10 { - ring_raw.add(i); - ring_fair.add(i); - } - - let mut rnd = rand::thread_rng(); - - group.bench_function("hash-ring-fair", |b| { - b.iter(|| { - let point = rnd.gen_range(0..100000); - let _shard = ring_fair.get(&point); - }) - }); - - group.bench_function("hash-ring-raw", |b| { - b.iter(|| { - let point = rnd.gen_range(0..100000); - let _shard = ring_raw.get(&point); - }) - }); -} - -criterion_group! { - name = benches; - config = Criterion::default(); - targets = hash_ring_bench, -} - -criterion_main!(benches); diff --git a/crates/qdrant/lib/collection/benches/prof.rs b/crates/qdrant/lib/collection/benches/prof.rs deleted file mode 100644 index eeb8ab6..0000000 --- a/crates/qdrant/lib/collection/benches/prof.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::fs::File; -use std::io::Write; -use std::os::raw::c_int; -use std::path::Path; - -use criterion::profiler::Profiler; -use pprof::flamegraph::TextTruncateDirection; -use pprof::protos::Message; -use pprof::ProfilerGuard; - -/// Small custom profiler that can be used with Criterion to create a flamegraph for benchmarks. -/// Also see [the Criterion documentation on this][custom-profiler]. -/// -/// ## Example on how to enable the custom profiler: -/// -/// ``` -/// mod perf; -/// use perf::FlamegraphProfiler; -/// -/// fn fibonacci_profiled(criterion: &mut Criterion) { -/// // Use the criterion struct as normal here. -/// } -/// -/// fn custom() -> Criterion { -/// Criterion::default().with_profiler(FlamegraphProfiler::new()) -/// } -/// -/// criterion_group! { -/// name = benches; -/// config = custom(); -/// targets = fibonacci_profiled -/// } -/// ``` -/// -/// The neat thing about this is that it will sample _only_ the benchmark, and not other stuff like -/// the setup process. -/// -/// Further, it will only kick in if `--profile-time