diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000000..37022824852 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,879 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[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 = "anyhow" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "h2" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[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 = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[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 = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[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", +] + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +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 = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys", +] + +[[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-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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-types" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b39bd850e4bf99146b3fd244019562cafd30338db068c5795c55b448eb02411" +dependencies = [ + "prost", + "prost-types", + "tonic", +] + +[[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", + "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.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "vald-agent-rs" +version = "0.1.0" +dependencies = [ + "prost", + "tonic", + "tonic-types", +] + +[[package]] +name = "vald-client-rs" +version = "0.1.0" +dependencies = [ + "prost", + "tonic", + "tonic-types", +] + +[[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.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[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.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[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.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[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.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000000..7fe6fa64a62 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +members = ["vald-client-rs", "vald-agent-rs"] diff --git a/buf.gen.yaml b/buf.gen.yaml index cd164377122..6cf00c62eb4 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -38,3 +38,17 @@ plugins: out: apis/swagger opt: - json_names_for_fields=true + - plugin: buf.build/community/neoeinstein-prost + out: vald-client-rs/src + - plugin: buf.build/community/neoeinstein-tonic + out: vald-client-rs/src + opt: + - no_include + - no_server + - plugin: buf.build/community/neoeinstein-prost + out: vald-agent-rs/src + - plugin: buf.build/community/neoeinstein-tonic + out: vald-agent-rs/src + opt: + - no_include + - no_client diff --git a/vald-agent-rs/Cargo.toml b/vald-agent-rs/Cargo.toml new file mode 100644 index 00000000000..4a33caaf1e2 --- /dev/null +++ b/vald-agent-rs/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "vald-agent-rs" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +prost = "0.12.3" +tonic = "0.10.2" +tonic-types = "0.10.2" diff --git a/vald-agent-rs/src/core.v1.tonic.rs b/vald-agent-rs/src/core.v1.tonic.rs new file mode 100644 index 00000000000..bcb2b3277c1 --- /dev/null +++ b/vald-agent-rs/src/core.v1.tonic.rs @@ -0,0 +1,417 @@ +// @generated +/// Generated server implementations. +pub mod agent_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 AgentServer. + #[async_trait] + pub trait Agent: Send + Sync + 'static { + async fn create_index( + &self, + request: tonic::Request< + super::super::super::payload::v1::control::CreateIndexRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn save_index( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** Represent the creating and saving index RPC. +*/ + async fn create_and_save_index( + &self, + request: tonic::Request< + super::super::super::payload::v1::control::CreateIndexRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** Represent the RPC to get the agent index information. +*/ + async fn index_info( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process +*/ + async fn get_timestamp( + &self, + request: tonic::Request< + super::super::super::payload::v1::object::GetTimestampRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct AgentServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl AgentServer { + 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 AgentServer + where + T: Agent, + 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() { + "/core.v1.Agent/CreateIndex" => { + #[allow(non_camel_case_types)] + struct CreateIndexSvc(pub Arc); + impl< + T: Agent, + > tonic::server::UnaryService< + super::super::super::payload::v1::control::CreateIndexRequest, + > for CreateIndexSvc { + type Response = super::super::super::payload::v1::Empty; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::control::CreateIndexRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).create_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 = CreateIndexSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/core.v1.Agent/SaveIndex" => { + #[allow(non_camel_case_types)] + struct SaveIndexSvc(pub Arc); + impl< + T: Agent, + > tonic::server::UnaryService< + super::super::super::payload::v1::Empty, + > for SaveIndexSvc { + type Response = super::super::super::payload::v1::Empty; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::Empty, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).save_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 = SaveIndexSvc(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) + } + "/core.v1.Agent/CreateAndSaveIndex" => { + #[allow(non_camel_case_types)] + struct CreateAndSaveIndexSvc(pub Arc); + impl< + T: Agent, + > tonic::server::UnaryService< + super::super::super::payload::v1::control::CreateIndexRequest, + > for CreateAndSaveIndexSvc { + type Response = super::super::super::payload::v1::Empty; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::control::CreateIndexRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).create_and_save_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 = CreateAndSaveIndexSvc(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) + } + "/core.v1.Agent/IndexInfo" => { + #[allow(non_camel_case_types)] + struct IndexInfoSvc(pub Arc); + impl< + T: Agent, + > tonic::server::UnaryService< + super::super::super::payload::v1::Empty, + > for IndexInfoSvc { + type Response = super::super::super::payload::v1::info::index::Count; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::Empty, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).index_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 = IndexInfoSvc(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) + } + "/core.v1.Agent/GetTimestamp" => { + #[allow(non_camel_case_types)] + struct GetTimestampSvc(pub Arc); + impl< + T: Agent, + > tonic::server::UnaryService< + super::super::super::payload::v1::object::GetTimestampRequest, + > for GetTimestampSvc { + type Response = super::super::super::payload::v1::object::Timestamp; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::object::GetTimestampRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_timestamp(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 = GetTimestampSvc(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 AgentServer { + 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 AgentServer { + const NAME: &'static str = "core.v1.Agent"; + } +} diff --git a/vald-agent-rs/src/discoverer.v1.tonic.rs b/vald-agent-rs/src/discoverer.v1.tonic.rs new file mode 100644 index 00000000000..7a226234cb7 --- /dev/null +++ b/vald-agent-rs/src/discoverer.v1.tonic.rs @@ -0,0 +1,301 @@ +// @generated +/// Generated server implementations. +pub mod discoverer_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 DiscovererServer. + #[async_trait] + pub trait Discoverer: Send + Sync + 'static { + async fn pods( + &self, + request: tonic::Request< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** Represent the RPC to get the node information. +*/ + async fn nodes( + &self, + request: tonic::Request< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** Represent the RPC to get the readreplica svc information. +*/ + async fn services( + &self, + request: tonic::Request< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct DiscovererServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl DiscovererServer { + 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 DiscovererServer + where + T: Discoverer, + 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() { + "/discoverer.v1.Discoverer/Pods" => { + #[allow(non_camel_case_types)] + struct PodsSvc(pub Arc); + impl< + T: Discoverer, + > tonic::server::UnaryService< + super::super::super::payload::v1::discoverer::Request, + > for PodsSvc { + type Response = super::super::super::payload::v1::info::Pods; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).pods(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 = PodsSvc(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) + } + "/discoverer.v1.Discoverer/Nodes" => { + #[allow(non_camel_case_types)] + struct NodesSvc(pub Arc); + impl< + T: Discoverer, + > tonic::server::UnaryService< + super::super::super::payload::v1::discoverer::Request, + > for NodesSvc { + type Response = super::super::super::payload::v1::info::Nodes; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).nodes(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 = NodesSvc(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) + } + "/discoverer.v1.Discoverer/Services" => { + #[allow(non_camel_case_types)] + struct ServicesSvc(pub Arc); + impl< + T: Discoverer, + > tonic::server::UnaryService< + super::super::super::payload::v1::discoverer::Request, + > for ServicesSvc { + type Response = super::super::super::payload::v1::info::Services; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).services(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 = ServicesSvc(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 DiscovererServer { + 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 DiscovererServer { + const NAME: &'static str = "discoverer.v1.Discoverer"; + } +} diff --git a/vald-agent-rs/src/filter.egress.v1.tonic.rs b/vald-agent-rs/src/filter.egress.v1.tonic.rs new file mode 100644 index 00000000000..a26681672b8 --- /dev/null +++ b/vald-agent-rs/src/filter.egress.v1.tonic.rs @@ -0,0 +1,251 @@ +// @generated +/// Generated server implementations. +pub mod filter_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 FilterServer. + #[async_trait] + pub trait Filter: Send + Sync + 'static { + /** Represent the RPC to filter the distance. +*/ + async fn filter_distance( + &self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Distance, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** Represent the RPC to filter the vector. +*/ + async fn filter_vector( + &self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Vector, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /** Represent the egress filter service. +*/ + #[derive(Debug)] + pub struct FilterServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl FilterServer { + 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 FilterServer + where + T: Filter, + 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() { + "/filter.egress.v1.Filter/FilterDistance" => { + #[allow(non_camel_case_types)] + struct FilterDistanceSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::super::payload::v1::object::Distance, + > for FilterDistanceSvc { + type Response = super::super::super::super::payload::v1::object::Distance; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Distance, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).filter_distance(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 = FilterDistanceSvc(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) + } + "/filter.egress.v1.Filter/FilterVector" => { + #[allow(non_camel_case_types)] + struct FilterVectorSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::super::payload::v1::object::Vector, + > for FilterVectorSvc { + type Response = super::super::super::super::payload::v1::object::Vector; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Vector, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).filter_vector(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 = FilterVectorSvc(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 FilterServer { + 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 FilterServer { + const NAME: &'static str = "filter.egress.v1.Filter"; + } +} diff --git a/vald-agent-rs/src/filter.ingress.v1.tonic.rs b/vald-agent-rs/src/filter.ingress.v1.tonic.rs new file mode 100644 index 00000000000..8c3fa8767e4 --- /dev/null +++ b/vald-agent-rs/src/filter.ingress.v1.tonic.rs @@ -0,0 +1,249 @@ +// @generated +/// Generated server implementations. +pub mod filter_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 FilterServer. + #[async_trait] + pub trait Filter: Send + Sync + 'static { + /** Represent the RPC to generate the vector. +*/ + async fn gen_vector( + &self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Blob, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** Represent the RPC to filter the vector. +*/ + async fn filter_vector( + &self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Vector, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /** Represent the ingress filter service. +*/ + #[derive(Debug)] + pub struct FilterServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl FilterServer { + 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 FilterServer + where + T: Filter, + 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() { + "/filter.ingress.v1.Filter/GenVector" => { + #[allow(non_camel_case_types)] + struct GenVectorSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::super::payload::v1::object::Blob, + > for GenVectorSvc { + type Response = super::super::super::super::payload::v1::object::Vector; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Blob, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).gen_vector(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 = GenVectorSvc(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) + } + "/filter.ingress.v1.Filter/FilterVector" => { + #[allow(non_camel_case_types)] + struct FilterVectorSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::super::payload::v1::object::Vector, + > for FilterVectorSvc { + type Response = super::super::super::super::payload::v1::object::Vector; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::payload::v1::object::Vector, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).filter_vector(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 = FilterVectorSvc(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 FilterServer { + 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 FilterServer { + const NAME: &'static str = "filter.ingress.v1.Filter"; + } +} diff --git a/vald-agent-rs/src/main.rs b/vald-agent-rs/src/main.rs new file mode 100644 index 00000000000..5358312e61a --- /dev/null +++ b/vald-agent-rs/src/main.rs @@ -0,0 +1,27 @@ +pub mod google { + pub mod rpc { + pub type Status = tonic_types::Status; + } +} + +pub mod payload { + pub mod v1 { + include!("payload.v1.rs"); + } +} + +pub mod core { + pub mod v1 { + include!("core.v1.tonic.rs"); + } +} + +pub mod vald { + pub mod v1 { + include!("vald.v1.tonic.rs"); + } +} + +fn main() { + println!("Hello, world!"); +} diff --git a/vald-agent-rs/src/manager.index.v1.tonic.rs b/vald-agent-rs/src/manager.index.v1.tonic.rs new file mode 100644 index 00000000000..67bdbcf02a4 --- /dev/null +++ b/vald-agent-rs/src/manager.index.v1.tonic.rs @@ -0,0 +1,183 @@ +// @generated +/// Generated server implementations. +pub mod index_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 IndexServer. + #[async_trait] + pub trait Index: Send + Sync + 'static { + async fn index_info( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct IndexServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl IndexServer { + 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 IndexServer + where + T: Index, + 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() { + "/manager.index.v1.Index/IndexInfo" => { + #[allow(non_camel_case_types)] + struct IndexInfoSvc(pub Arc); + impl< + T: Index, + > tonic::server::UnaryService< + super::super::super::super::payload::v1::Empty, + > for IndexInfoSvc { + type Response = super::super::super::super::payload::v1::info::index::Count; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::payload::v1::Empty, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).index_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 = IndexInfoSvc(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 IndexServer { + 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 IndexServer { + const NAME: &'static str = "manager.index.v1.Index"; + } +} diff --git a/vald-agent-rs/src/payload.v1.rs b/vald-agent-rs/src/payload.v1.rs new file mode 100644 index 00000000000..bd136dd9e4d --- /dev/null +++ b/vald-agent-rs/src/payload.v1.rs @@ -0,0 +1,998 @@ +// @generated +/// Search related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Search { +} +/// Nested message and enum types in `Search`. +pub mod search { + /// Represent a search request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be searched. + #[prost(float, repeated, packed="false", tag="1")] + pub vector: ::prost::alloc::vec::Vec, + /// The configuration of the search request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple search request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple search request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent a search by ID request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct IdRequest { + /// The vector ID to be searched. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The configuration of the search request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple search by ID request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiIdRequest { + /// Represent the multiple search by ID request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent a search by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be searched. + #[prost(bytes="vec", tag="1")] + pub object: ::prost::alloc::vec::Vec, + /// The configuration of the search request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter configuration. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple search by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent the multiple search by binary object request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent search configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// Unique request ID. + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, + /// Maximum number of result to be returned. + #[prost(uint32, tag="2")] + pub num: u32, + /// Search radius. + #[prost(float, tag="3")] + pub radius: f32, + /// Search coefficient. + #[prost(float, tag="4")] + pub epsilon: f32, + /// Search timeout in nanoseconds. + #[prost(int64, tag="5")] + pub timeout: i64, + /// Ingress filter configurations. + #[prost(message, optional, tag="6")] + pub ingress_filters: ::core::option::Option, + /// Egress filter configurations. + #[prost(message, optional, tag="7")] + pub egress_filters: ::core::option::Option, + /// Minimum number of result to be returned. + #[prost(uint32, tag="8")] + pub min_num: u32, + /// Aggregation Algorithm + #[prost(enumeration="AggregationAlgorithm", tag="9")] + pub aggregation_algorithm: i32, + } + /// Represent a search response. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Response { + /// The unique request ID. + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, + /// Search results. + #[prost(message, repeated, tag="2")] + pub results: ::prost::alloc::vec::Vec, + } + /// Represent multiple search responses. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Responses { + /// Represent the multiple search response content. + #[prost(message, repeated, tag="1")] + pub responses: ::prost::alloc::vec::Vec, + } + /// Represent stream search response. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamResponse { + #[prost(oneof="stream_response::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamResponse`. + pub mod stream_response { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// Represent the search response. + #[prost(message, tag="1")] + Response(super::Response), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// AggregationAlgorithm is enum of each aggregation algorithms + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum AggregationAlgorithm { + Unknown = 0, + ConcurrentQueue = 1, + SortSlice = 2, + SortPoolSlice = 3, + PairingHeap = 4, + } + impl AggregationAlgorithm { + /// 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 { + AggregationAlgorithm::Unknown => "Unknown", + AggregationAlgorithm::ConcurrentQueue => "ConcurrentQueue", + AggregationAlgorithm::SortSlice => "SortSlice", + AggregationAlgorithm::SortPoolSlice => "SortPoolSlice", + AggregationAlgorithm::PairingHeap => "PairingHeap", + } + } + /// 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), + "ConcurrentQueue" => Some(Self::ConcurrentQueue), + "SortSlice" => Some(Self::SortSlice), + "SortPoolSlice" => Some(Self::SortPoolSlice), + "PairingHeap" => Some(Self::PairingHeap), + _ => None, + } + } + } +} +/// Filter related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Filter { +} +/// Nested message and enum types in `Filter`. +pub mod filter { + /// Represent the target filter server. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Target { + /// The target hostname. + #[prost(string, tag="1")] + pub host: ::prost::alloc::string::String, + /// The target port. + #[prost(uint32, tag="2")] + pub port: u32, + } + /// Represent filter configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// Represent the filter target configuration. + #[prost(message, repeated, tag="1")] + pub targets: ::prost::alloc::vec::Vec, + } +} +/// Insert related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Insert { +} +/// Nested message and enum types in `Insert`. +pub mod insert { + /// Represent the insert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be inserted. + #[prost(message, optional, tag="1")] + pub vector: ::core::option::Option, + /// The configuration of the insert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple insert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent multiple insert request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the insert by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be inserted. + #[prost(message, optional, tag="1")] + pub object: ::core::option::Option, + /// The configuration of the insert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter configurations. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple insert by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent multiple insert by object content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent insert configurations. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during insert operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Filter configurations. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + /// Insert timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + } +} +/// Update related messages +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Update { +} +/// Nested message and enum types in `Update`. +pub mod update { + /// Represent the update request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be updated. + #[prost(message, optional, tag="1")] + pub vector: ::core::option::Option, + /// The configuration of the update request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple update request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple update request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the update binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be updated. + #[prost(message, optional, tag="1")] + pub object: ::core::option::Option, + /// The configuration of the update request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter target. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple update binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent the multiple update object request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the update configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during update operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Filter configuration. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + /// Update timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + /// A flag to disable balanced update (split remove -> insert operation) + /// during update operation. + #[prost(bool, tag="4")] + pub disable_balanced_update: bool, + } +} +/// Upsert related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Upsert { +} +/// Nested message and enum types in `Upsert`. +pub mod upsert { + /// Represent the upsert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be upserted. + #[prost(message, optional, tag="1")] + pub vector: ::core::option::Option, + /// The configuration of the upsert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent mthe ultiple upsert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple upsert request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the upsert binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be upserted. + #[prost(message, optional, tag="1")] + pub object: ::core::option::Option, + /// The configuration of the upsert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter target. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple upsert binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent the multiple upsert object request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the upsert configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during upsert operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Filter configuration. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + /// Upsert timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + /// A flag to disable balanced update (split remove -> insert operation) + /// during update operation. + #[prost(bool, tag="4")] + pub disable_balanced_update: bool, + } +} +/// Remove related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Remove { +} +/// Nested message and enum types in `Remove`. +pub mod remove { + /// Represent the remove request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The object ID to be removed. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// The configuration of the remove request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple remove request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple remove request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the remove request based on timestamp. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct TimestampRequest { + /// The timestamp comparison list. If more than one is specified, the `AND` search is applied. + #[prost(message, repeated, tag="1")] + pub timestamps: ::prost::alloc::vec::Vec, + } + /// Represent the timestamp comparison. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Timestamp { + /// The timestamp. + #[prost(int64, tag="1")] + pub timestamp: i64, + /// The conditional operator. + #[prost(enumeration="timestamp::Operator", tag="2")] + pub operator: i32, + } + /// Nested message and enum types in `Timestamp`. + pub mod timestamp { + /// Operator is enum of each conditional operator. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Operator { + /// The timestamp is equal to the specified value in the request. + Eq = 0, + /// The timestamp is not equal to the specified value in the request. + Ne = 1, + /// The timestamp is greater than or equal to the specified value in the request. + Ge = 2, + /// The timestamp is greater than the specified value in the request. + Gt = 3, + /// The timestamp is less than or equal to the specified value in the request. + Le = 4, + /// The timestamp is less than the specified value in the request. + Lt = 5, + } + impl Operator { + /// 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 { + Operator::Eq => "Eq", + Operator::Ne => "Ne", + Operator::Ge => "Ge", + Operator::Gt => "Gt", + Operator::Le => "Le", + Operator::Lt => "Lt", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Eq" => Some(Self::Eq), + "Ne" => Some(Self::Ne), + "Ge" => Some(Self::Ge), + "Gt" => Some(Self::Gt), + "Le" => Some(Self::Le), + "Lt" => Some(Self::Lt), + _ => None, + } + } + } + } + /// Represent the remove configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during upsert operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Remove timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + } +} +/// Common messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Object { +} +/// Nested message and enum types in `Object`. +pub mod object { + /// Represent a request to fetch raw vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct VectorRequest { + /// The vector ID to be fetched. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// Filter configurations. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + } + /// Represent the ID and distance pair. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Distance { + /// The vector ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The distance. + #[prost(float, tag="2")] + pub distance: f32, + } + /// Represent stream response of distances. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamDistance { + #[prost(oneof="stream_distance::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamDistance`. + pub mod stream_distance { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The distance. + #[prost(message, tag="1")] + Distance(super::Distance), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent the vector ID. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Id { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + } + /// Represent multiple vector IDs. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct IDs { + #[prost(string, repeated, tag="1")] + pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } + /// Represent a vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Vector { + /// The vector ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The vector. + #[prost(float, repeated, packed="false", tag="2")] + pub vector: ::prost::alloc::vec::Vec, + /// timestamp represents when this vector inserted. + #[prost(int64, tag="3")] + pub timestamp: i64, + } + /// Represent a request to fetch vector meta data. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct GetTimestampRequest { + /// The vector ID to be fetched. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + } + /// Represent a vector meta data. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Timestamp { + /// The vector ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// timestamp represents when this vector inserted. + #[prost(int64, tag="2")] + pub timestamp: i64, + } + /// Represent multiple vectors. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Vectors { + #[prost(message, repeated, tag="1")] + pub vectors: ::prost::alloc::vec::Vec, + } + /// Represent stream response of the vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamVector { + #[prost(oneof="stream_vector::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamVector`. + pub mod stream_vector { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The vector. + #[prost(message, tag="1")] + Vector(super::Vector), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent reshape vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ReshapeVector { + /// The binary object. + #[prost(bytes="vec", tag="1")] + pub object: ::prost::alloc::vec::Vec, + /// The new shape. + #[prost(int32, repeated, tag="2")] + pub shape: ::prost::alloc::vec::Vec, + } + /// Represent the binary object. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Blob { + /// The object ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The binary object. + #[prost(bytes="vec", tag="2")] + pub object: ::prost::alloc::vec::Vec, + } + /// Represent stream response of binary objects. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamBlob { + #[prost(oneof="stream_blob::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamBlob`. + pub mod stream_blob { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The binary object. + #[prost(message, tag="1")] + Blob(super::Blob), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent the vector location. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Location { + /// The name of the location. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The UUID of the vector. + #[prost(string, tag="2")] + pub uuid: ::prost::alloc::string::String, + /// The IP list. + #[prost(string, repeated, tag="3")] + pub ips: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } + /// Represent the stream response of the vector location. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamLocation { + #[prost(oneof="stream_location::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamLocation`. + pub mod stream_location { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The vector location. + #[prost(message, tag="1")] + Location(super::Location), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent multiple vector locations. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Locations { + #[prost(message, repeated, tag="1")] + pub locations: ::prost::alloc::vec::Vec, + } + /// Represent the list object vector stream request and response. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct List { + } + /// Nested message and enum types in `List`. + pub mod list { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Response { + #[prost(oneof="response::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `Response`. + pub mod response { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The vector + #[prost(message, tag="1")] + Vector(super::super::Vector), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::super::google::rpc::Status), + } + } + } +} +/// Control related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Control { +} +/// Nested message and enum types in `Control`. +pub mod control { + /// Represent the create index request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct CreateIndexRequest { + /// The pool size of the create index operation. + #[prost(uint32, tag="1")] + pub pool_size: u32, + } +} +/// Discoverer related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Discoverer { +} +/// Nested message and enum types in `Discoverer`. +pub mod discoverer { + /// Represent the dicoverer request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The agent name to be discovered. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The namespace to be discovered. + #[prost(string, tag="2")] + pub namespace: ::prost::alloc::string::String, + /// The node to be discovered. + #[prost(string, tag="3")] + pub node: ::prost::alloc::string::String, + } +} +/// Info related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Info { +} +/// Nested message and enum types in `Info`. +pub mod info { + /// Represent the index information messages. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Index { + } + /// Nested message and enum types in `Index`. + pub mod index { + /// Represent the index count message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Count { + /// The stored index count. + #[prost(uint32, tag="1")] + pub stored: u32, + /// The uncommitted index count. + #[prost(uint32, tag="2")] + pub uncommitted: u32, + /// The indexing index count. + #[prost(bool, tag="3")] + pub indexing: bool, + /// The saving index count. + #[prost(bool, tag="4")] + pub saving: bool, + } + /// Represent the UUID message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Uuid { + } + /// Nested message and enum types in `UUID`. + pub mod uuid { + /// The committed UUID. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Committed { + #[prost(string, tag="1")] + pub uuid: ::prost::alloc::string::String, + } + /// The uncommitted UUID. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Uncommitted { + #[prost(string, tag="1")] + pub uuid: ::prost::alloc::string::String, + } + } + } + /// Represent the pod information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Pod { + /// The app name of the pod on the label. + #[prost(string, tag="1")] + pub app_name: ::prost::alloc::string::String, + /// The name of the pod. + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + /// The namespace of the pod. + #[prost(string, tag="3")] + pub namespace: ::prost::alloc::string::String, + /// The IP of the pod. + #[prost(string, tag="4")] + pub ip: ::prost::alloc::string::String, + /// The CPU information of the pod. + #[prost(message, optional, tag="5")] + pub cpu: ::core::option::Option, + /// The memory information of the pod. + #[prost(message, optional, tag="6")] + pub memory: ::core::option::Option, + /// The node information of the pod. + #[prost(message, optional, tag="7")] + pub node: ::core::option::Option, + } + /// Represent the node information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Node { + /// The name of the node. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The internal IP address of the node. + #[prost(string, tag="2")] + pub internal_addr: ::prost::alloc::string::String, + /// The external IP address of the node. + #[prost(string, tag="3")] + pub external_addr: ::prost::alloc::string::String, + /// The CPU information of the node. + #[prost(message, optional, tag="4")] + pub cpu: ::core::option::Option, + /// The memory information of the node. + #[prost(message, optional, tag="5")] + pub memory: ::core::option::Option, + /// The pod information of the node. + #[prost(message, optional, tag="6")] + pub pods: ::core::option::Option, + } + /// Represent the service information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Service { + /// The name of the svc. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The cluster ip of the svc. + #[prost(string, tag="2")] + pub cluster_ip: ::prost::alloc::string::String, + /// The cluster ips of the svc. + #[prost(string, repeated, tag="3")] + pub cluster_ips: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The port of the svc. + #[prost(message, repeated, tag="4")] + pub ports: ::prost::alloc::vec::Vec, + /// The labels of the service. + #[prost(message, optional, tag="5")] + pub labels: ::core::option::Option, + /// The annotations of the service. + #[prost(message, optional, tag="6")] + pub annotations: ::core::option::Option, + } + /// Represets the service port information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ServicePort { + /// The name of the port. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The port number + #[prost(int32, tag="2")] + pub port: i32, + } + /// Represent the kubernetes labels. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Labels { + #[prost(map="string, string", tag="1")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + } + /// Represent the kubernetes annotations. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Annotations { + #[prost(map="string, string", tag="1")] + pub annotations: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + } + /// Represent the CPU information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Cpu { + /// The CPU resource limit. + #[prost(double, tag="1")] + pub limit: f64, + /// The CPU resource requested. + #[prost(double, tag="2")] + pub request: f64, + /// The CPU usage. + #[prost(double, tag="3")] + pub usage: f64, + } + /// Represent the memory information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Memory { + /// The memory limit. + #[prost(double, tag="1")] + pub limit: f64, + /// The memory requested. + #[prost(double, tag="2")] + pub request: f64, + /// The memory usage. + #[prost(double, tag="3")] + pub usage: f64, + } + /// Represent the multiple pod information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Pods { + /// The multiple pod information. + #[prost(message, repeated, tag="1")] + pub pods: ::prost::alloc::vec::Vec, + } + /// Represent the multiple node information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Nodes { + /// The multiple node information. + #[prost(message, repeated, tag="1")] + pub nodes: ::prost::alloc::vec::Vec, + } + /// Represent the multiple service information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Services { + /// The multiple service information. + #[prost(message, repeated, tag="1")] + pub services: ::prost::alloc::vec::Vec, + } + /// Represent the multiple IP message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct IPs { + #[prost(string, repeated, tag="1")] + pub ip: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } +} +/// Represent an empty message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Empty { +} +// @@protoc_insertion_point(module) diff --git a/vald-agent-rs/src/rpc.v1.rs b/vald-agent-rs/src/rpc.v1.rs new file mode 100644 index 00000000000..7924d6d4db9 --- /dev/null +++ b/vald-agent-rs/src/rpc.v1.rs @@ -0,0 +1,302 @@ +// @generated +/// Describes the cause of the error with structured details. +/// +/// Example of an error when contacting the "pubsub.googleapis.com" API when it +/// is not enabled: +/// +/// { "reason": "API_DISABLED" +/// "domain": "googleapis.com" +/// "metadata": { +/// "resource": "projects/123", +/// "service": "pubsub.googleapis.com" +/// } +/// } +/// +/// This response indicates that the pubsub.googleapis.com API is not enabled. +/// +/// Example of an error that is returned when attempting to create a Spanner +/// instance in a region that is out of stock: +/// +/// { "reason": "STOCKOUT" +/// "domain": "spanner.googleapis.com", +/// "metadata": { +/// "availableRegions": "us-central1,us-east2" +/// } +/// } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ErrorInfo { + /// The reason of the error. This is a constant value that identifies the + /// proximate cause of the error. Error reasons are unique within a particular + /// domain of errors. This should be at most 63 characters and match a + /// regular expression of `\[A-Z][A-Z0-9_]+[A-Z0-9\]`, which represents + /// UPPER_SNAKE_CASE. + #[prost(string, tag="1")] + pub reason: ::prost::alloc::string::String, + /// The logical grouping to which the "reason" belongs. The error domain + /// is typically the registered service name of the tool or product that + /// generates the error. Example: "pubsub.googleapis.com". If the error is + /// generated by some common infrastructure, the error domain must be a + /// globally unique value that identifies the infrastructure. For Google API + /// infrastructure, the error domain is "googleapis.com". + #[prost(string, tag="2")] + pub domain: ::prost::alloc::string::String, + /// Additional structured details about this error. + /// + /// Keys should match /\[a-zA-Z0-9-_\]/ and be limited to 64 characters in + /// length. When identifying the current value of an exceeded limit, the units + /// should be contained in the key, not the value. For example, rather than + /// {"instanceLimit": "100/request"}, should be returned as, + /// {"instanceLimitPerRequest": "100"}, if the client exceeds the number of + /// instances that can be created in a single (batch) request. + #[prost(map="string, string", tag="3")] + pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, +} +/// Describes when the clients can retry a failed request. Clients could ignore +/// the recommendation here or retry when this information is missing from error +/// responses. +/// +/// It's always recommended that clients should use exponential backoff when +/// retrying. +/// +/// Clients should wait until `retry_delay` amount of time has passed since +/// receiving the error response before retrying. If retrying requests also +/// fail, clients should use an exponential backoff scheme to gradually increase +/// the delay between retries based on `retry_delay`, until either a maximum +/// number of retries have been reached or a maximum retry delay cap has been +/// reached. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RetryInfo { + /// Clients should wait at least this long between retrying the same request. + #[prost(message, optional, tag="1")] + pub retry_delay: ::core::option::Option<::prost_types::Duration>, +} +/// Describes additional debugging info. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DebugInfo { + /// The stack trace entries indicating where the error occurred. + #[prost(string, repeated, tag="1")] + pub stack_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Additional debugging information provided by the server. + #[prost(string, tag="2")] + pub detail: ::prost::alloc::string::String, +} +/// Describes how a quota check failed. +/// +/// For example if a daily limit was exceeded for the calling project, +/// a service could respond with a QuotaFailure detail containing the project +/// id and the description of the quota limit that was exceeded. If the +/// calling project hasn't enabled the service in the developer console, then +/// a service could respond with the project id and set `service_disabled` +/// to true. +/// +/// Also see RetryInfo and Help types for other details about handling a +/// quota failure. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuotaFailure { + /// Describes all quota violations. + #[prost(message, repeated, tag="1")] + pub violations: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `QuotaFailure`. +pub mod quota_failure { + /// A message type used to describe a single quota violation. For example, a + /// daily quota or a custom quota that was exceeded. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Violation { + /// The subject on which the quota check failed. + /// For example, "clientip:" or "project:". + #[prost(string, tag="1")] + pub subject: ::prost::alloc::string::String, + /// A description of how the quota check failed. Clients can use this + /// description to find more about the quota configuration in the service's + /// public documentation, or find the relevant quota limit to adjust through + /// developer console. + /// + /// For example: "Service disabled" or "Daily Limit for read operations + /// exceeded". + #[prost(string, tag="2")] + pub description: ::prost::alloc::string::String, + } +} +/// Describes what preconditions have failed. +/// +/// For example, if an RPC failed because it required the Terms of Service to be +/// acknowledged, it could list the terms of service violation in the +/// PreconditionFailure message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PreconditionFailure { + /// Describes all precondition violations. + #[prost(message, repeated, tag="1")] + pub violations: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `PreconditionFailure`. +pub mod precondition_failure { + /// A message type used to describe a single precondition failure. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Violation { + /// The type of PreconditionFailure. We recommend using a service-specific + /// enum type to define the supported precondition violation subjects. For + /// example, "TOS" for "Terms of Service violation". + #[prost(string, tag="1")] + pub r#type: ::prost::alloc::string::String, + /// The subject, relative to the type, that failed. + /// For example, "google.com/cloud" relative to the "TOS" type would indicate + /// which terms of service is being referenced. + #[prost(string, tag="2")] + pub subject: ::prost::alloc::string::String, + /// A description of how the precondition failed. Developers can use this + /// description to understand how to fix the failure. + /// + /// For example: "Terms of service not accepted". + #[prost(string, tag="3")] + pub description: ::prost::alloc::string::String, + } +} +/// Describes violations in a client request. This error type focuses on the +/// syntactic aspects of the request. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BadRequest { + /// Describes all violations in a client request. + #[prost(message, repeated, tag="1")] + pub field_violations: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `BadRequest`. +pub mod bad_request { + /// A message type used to describe a single bad request field. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct FieldViolation { + /// A path that leads to a field in the request body. The value will be a + /// sequence of dot-separated identifiers that identify a protocol buffer + /// field. + /// + /// Consider the following: + /// + /// message CreateContactRequest { + /// message EmailAddress { + /// enum Type { + /// TYPE_UNSPECIFIED = 0; + /// HOME = 1; + /// WORK = 2; + /// } + /// + /// optional string email = 1; + /// repeated EmailType type = 2; + /// } + /// + /// string full_name = 1; + /// repeated EmailAddress email_addresses = 2; + /// } + /// + /// In this example, in proto `field` could take one of the following values: + /// + /// * `full_name` for a violation in the `full_name` value + /// * `email_addresses\[1\].email` for a violation in the `email` field of the + /// first `email_addresses` message + /// * `email_addresses\[3].type[2\]` for a violation in the second `type` + /// value in the third `email_addresses` message. + /// + /// In JSON, the same values are represented as: + /// + /// * `fullName` for a violation in the `fullName` value + /// * `emailAddresses\[1\].email` for a violation in the `email` field of the + /// first `emailAddresses` message + /// * `emailAddresses\[3].type[2\]` for a violation in the second `type` + /// value in the third `emailAddresses` message. + #[prost(string, tag="1")] + pub field: ::prost::alloc::string::String, + /// A description of why the request element is bad. + #[prost(string, tag="2")] + pub description: ::prost::alloc::string::String, + } +} +/// Contains metadata about the request that clients can attach when filing a bug +/// or providing other forms of feedback. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RequestInfo { + /// An opaque string that should only be interpreted by the service generating + /// it. For example, it can be used to identify requests in the service's logs. + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, + /// Any data that was used to serve this request. For example, an encrypted + /// stack trace that can be sent back to the service provider for debugging. + #[prost(string, tag="2")] + pub serving_data: ::prost::alloc::string::String, +} +/// Describes the resource that is being accessed. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResourceInfo { + /// A name for the type of resource being accessed, e.g. "sql table", + /// "cloud storage bucket", "file", "Google calendar"; or the type URL + /// of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + #[prost(string, tag="1")] + pub resource_type: ::prost::alloc::string::String, + /// The name of the resource being accessed. For example, a shared calendar + /// name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + /// error is + /// \[google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED\]. + #[prost(string, tag="2")] + pub resource_name: ::prost::alloc::string::String, + /// The owner of the resource (optional). + /// For example, "user:" or "project:". + #[prost(string, tag="3")] + pub owner: ::prost::alloc::string::String, + /// Describes what error is encountered when accessing this resource. + /// For example, updating a cloud project may require the `writer` permission + /// on the developer console project. + #[prost(string, tag="4")] + pub description: ::prost::alloc::string::String, +} +/// Provides links to documentation or for performing an out of band action. +/// +/// For example, if a quota check failed with an error indicating the calling +/// project hasn't enabled the accessed service, this can contain a URL pointing +/// directly to the right place in the developer console to flip the bit. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Help { + /// URL(s) pointing to additional information on handling the current error. + #[prost(message, repeated, tag="1")] + pub links: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `Help`. +pub mod help { + /// Describes a URL link. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Link { + /// Describes what the link offers. + #[prost(string, tag="1")] + pub description: ::prost::alloc::string::String, + /// The URL of the link. + #[prost(string, tag="2")] + pub url: ::prost::alloc::string::String, + } +} +/// Provides a localized error message that is safe to return to the user +/// which can be attached to an RPC error. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LocalizedMessage { + /// The locale used following the specification defined at + /// + /// Examples are: "en-US", "fr-CH", "es-MX" + #[prost(string, tag="1")] + pub locale: ::prost::alloc::string::String, + /// The localized error message in the above locale. + #[prost(string, tag="2")] + pub message: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/vald-agent-rs/src/sidecar.v1.tonic.rs b/vald-agent-rs/src/sidecar.v1.tonic.rs new file mode 100644 index 00000000000..297951cefce --- /dev/null +++ b/vald-agent-rs/src/sidecar.v1.tonic.rs @@ -0,0 +1,128 @@ +// @generated +/// Generated server implementations. +pub mod sidecar_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 SidecarServer. + #[async_trait] + pub trait Sidecar: Send + Sync + 'static {} + #[derive(Debug)] + pub struct SidecarServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl SidecarServer { + 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 SidecarServer + where + T: Sidecar, + 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() { + _ => { + 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 SidecarServer { + 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 SidecarServer { + const NAME: &'static str = "sidecar.v1.Sidecar"; + } +} diff --git a/vald-agent-rs/src/vald.v1.tonic.rs b/vald-agent-rs/src/vald.v1.tonic.rs new file mode 100644 index 00000000000..d6df5a636b7 --- /dev/null +++ b/vald-agent-rs/src/vald.v1.tonic.rs @@ -0,0 +1,3479 @@ +// @generated +/// Generated server implementations. +pub mod filter_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 FilterServer. + #[async_trait] + pub trait Filter: Send + Sync + 'static { + async fn search_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::search::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to search multiple objects. +*/ + async fn multi_search_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamSearchObject method. + type StreamSearchObjectStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::search::StreamResponse, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to search object by bidirectional streaming. +*/ + async fn stream_search_object( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method insert object. +*/ + async fn insert_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::insert::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamInsertObject method. + type StreamInsertObjectStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamLocation, + tonic::Status, + >, + > + + Send + + 'static; + /** Represent the streaming RPC to insert object by bidirectional streaming. +*/ + async fn stream_insert_object( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to insert multiple objects. +*/ + async fn multi_insert_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::insert::MultiObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to update object. +*/ + async fn update_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::update::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamUpdateObject method. + type StreamUpdateObjectStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamLocation, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to update object by bidirectional streaming. +*/ + async fn stream_update_object( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to update multiple objects. +*/ + async fn multi_update_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::update::MultiObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to upsert object. +*/ + async fn upsert_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::upsert::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamUpsertObject method. + type StreamUpsertObjectStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamLocation, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to upsert object by bidirectional streaming. +*/ + async fn stream_upsert_object( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to upsert multiple objects. +*/ + async fn multi_upsert_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::upsert::MultiObjectRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct FilterServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl FilterServer { + 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 FilterServer + where + T: Filter, + 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() { + "/vald.v1.Filter/SearchObject" => { + #[allow(non_camel_case_types)] + struct SearchObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::ObjectRequest, + > for SearchObjectSvc { + type Response = super::super::super::payload::v1::search::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::ObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).search_object(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 = SearchObjectSvc(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) + } + "/vald.v1.Filter/MultiSearchObject" => { + #[allow(non_camel_case_types)] + struct MultiSearchObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::MultiObjectRequest, + > for MultiSearchObjectSvc { + type Response = super::super::super::payload::v1::search::Responses; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_search_object(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 = MultiSearchObjectSvc(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) + } + "/vald.v1.Filter/StreamSearchObject" => { + #[allow(non_camel_case_types)] + struct StreamSearchObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::StreamingService< + super::super::super::payload::v1::search::ObjectRequest, + > for StreamSearchObjectSvc { + type Response = super::super::super::payload::v1::search::StreamResponse; + type ResponseStream = T::StreamSearchObjectStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::search::ObjectRequest, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_search_object(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 = StreamSearchObjectSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Filter/InsertObject" => { + #[allow(non_camel_case_types)] + struct InsertObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::insert::ObjectRequest, + > for InsertObjectSvc { + type Response = super::super::super::payload::v1::object::Location; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::insert::ObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).insert_object(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 = InsertObjectSvc(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) + } + "/vald.v1.Filter/StreamInsertObject" => { + #[allow(non_camel_case_types)] + struct StreamInsertObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::StreamingService< + super::super::super::payload::v1::insert::ObjectRequest, + > for StreamInsertObjectSvc { + type Response = super::super::super::payload::v1::object::StreamLocation; + type ResponseStream = T::StreamInsertObjectStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::insert::ObjectRequest, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_insert_object(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 = StreamInsertObjectSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Filter/MultiInsertObject" => { + #[allow(non_camel_case_types)] + struct MultiInsertObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::insert::MultiObjectRequest, + > for MultiInsertObjectSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::insert::MultiObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_insert_object(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 = MultiInsertObjectSvc(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) + } + "/vald.v1.Filter/UpdateObject" => { + #[allow(non_camel_case_types)] + struct UpdateObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::update::ObjectRequest, + > for UpdateObjectSvc { + type Response = super::super::super::payload::v1::object::Location; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::update::ObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).update_object(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 = UpdateObjectSvc(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) + } + "/vald.v1.Filter/StreamUpdateObject" => { + #[allow(non_camel_case_types)] + struct StreamUpdateObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::StreamingService< + super::super::super::payload::v1::update::ObjectRequest, + > for StreamUpdateObjectSvc { + type Response = super::super::super::payload::v1::object::StreamLocation; + type ResponseStream = T::StreamUpdateObjectStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::update::ObjectRequest, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_update_object(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 = StreamUpdateObjectSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Filter/MultiUpdateObject" => { + #[allow(non_camel_case_types)] + struct MultiUpdateObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::update::MultiObjectRequest, + > for MultiUpdateObjectSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::update::MultiObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_update_object(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 = MultiUpdateObjectSvc(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) + } + "/vald.v1.Filter/UpsertObject" => { + #[allow(non_camel_case_types)] + struct UpsertObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::upsert::ObjectRequest, + > for UpsertObjectSvc { + type Response = super::super::super::payload::v1::object::Location; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::upsert::ObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).upsert_object(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 = UpsertObjectSvc(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) + } + "/vald.v1.Filter/StreamUpsertObject" => { + #[allow(non_camel_case_types)] + struct StreamUpsertObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::StreamingService< + super::super::super::payload::v1::upsert::ObjectRequest, + > for StreamUpsertObjectSvc { + type Response = super::super::super::payload::v1::object::StreamLocation; + type ResponseStream = T::StreamUpsertObjectStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::upsert::ObjectRequest, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_upsert_object(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 = StreamUpsertObjectSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Filter/MultiUpsertObject" => { + #[allow(non_camel_case_types)] + struct MultiUpsertObjectSvc(pub Arc); + impl< + T: Filter, + > tonic::server::UnaryService< + super::super::super::payload::v1::upsert::MultiObjectRequest, + > for MultiUpsertObjectSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::upsert::MultiObjectRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_upsert_object(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 = MultiUpsertObjectSvc(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 FilterServer { + 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 FilterServer { + const NAME: &'static str = "vald.v1.Filter"; + } +} +/// Generated server implementations. +pub mod insert_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 InsertServer. + #[async_trait] + pub trait Insert: Send + Sync + 'static { + async fn insert( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamInsert method. + type StreamInsertStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamLocation, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to add new multiple vectors by bidirectional streaming. +*/ + async fn stream_insert( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to add new multiple vectors in a single request. +*/ + async fn multi_insert( + &self, + request: tonic::Request< + super::super::super::payload::v1::insert::MultiRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct InsertServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl InsertServer { + 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 InsertServer + where + T: Insert, + 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() { + "/vald.v1.Insert/Insert" => { + #[allow(non_camel_case_types)] + struct InsertSvc(pub Arc); + impl< + T: Insert, + > tonic::server::UnaryService< + super::super::super::payload::v1::insert::Request, + > for InsertSvc { + type Response = super::super::super::payload::v1::object::Location; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::insert::Request, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).insert(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 = InsertSvc(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) + } + "/vald.v1.Insert/StreamInsert" => { + #[allow(non_camel_case_types)] + struct StreamInsertSvc(pub Arc); + impl< + T: Insert, + > tonic::server::StreamingService< + super::super::super::payload::v1::insert::Request, + > for StreamInsertSvc { + type Response = super::super::super::payload::v1::object::StreamLocation; + type ResponseStream = T::StreamInsertStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::insert::Request, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_insert(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 = StreamInsertSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Insert/MultiInsert" => { + #[allow(non_camel_case_types)] + struct MultiInsertSvc(pub Arc); + impl< + T: Insert, + > tonic::server::UnaryService< + super::super::super::payload::v1::insert::MultiRequest, + > for MultiInsertSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::insert::MultiRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_insert(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 = MultiInsertSvc(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 InsertServer { + 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 InsertServer { + const NAME: &'static str = "vald.v1.Insert"; + } +} +/// Generated server implementations. +pub mod object_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 ObjectServer. + #[async_trait] + pub trait Object: Send + Sync + 'static { + async fn exists( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to fetch a vector. +*/ + async fn get_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::object::VectorRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamGetObject method. + type StreamGetObjectStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamVector, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to fetch vectors by bidirectional streaming. +*/ + async fn stream_get_object( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamListObject method. + type StreamListObjectStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::list::Response, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to get all the vectors with server streaming +*/ + async fn stream_list_object( + &self, + request: tonic::Request< + super::super::super::payload::v1::object::list::Request, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct ObjectServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl ObjectServer { + 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 ObjectServer + where + T: Object, + 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() { + "/vald.v1.Object/Exists" => { + #[allow(non_camel_case_types)] + struct ExistsSvc(pub Arc); + impl< + T: Object, + > tonic::server::UnaryService< + super::super::super::payload::v1::object::Id, + > for ExistsSvc { + type Response = super::super::super::payload::v1::object::Id; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::object::Id, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).exists(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 = ExistsSvc(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) + } + "/vald.v1.Object/GetObject" => { + #[allow(non_camel_case_types)] + struct GetObjectSvc(pub Arc); + impl< + T: Object, + > tonic::server::UnaryService< + super::super::super::payload::v1::object::VectorRequest, + > for GetObjectSvc { + type Response = super::super::super::payload::v1::object::Vector; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::object::VectorRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_object(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 = GetObjectSvc(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) + } + "/vald.v1.Object/StreamGetObject" => { + #[allow(non_camel_case_types)] + struct StreamGetObjectSvc(pub Arc); + impl< + T: Object, + > tonic::server::StreamingService< + super::super::super::payload::v1::object::VectorRequest, + > for StreamGetObjectSvc { + type Response = super::super::super::payload::v1::object::StreamVector; + type ResponseStream = T::StreamGetObjectStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::object::VectorRequest, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_get_object(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 = StreamGetObjectSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Object/StreamListObject" => { + #[allow(non_camel_case_types)] + struct StreamListObjectSvc(pub Arc); + impl< + T: Object, + > tonic::server::ServerStreamingService< + super::super::super::payload::v1::object::list::Request, + > for StreamListObjectSvc { + type Response = super::super::super::payload::v1::object::list::Response; + type ResponseStream = T::StreamListObjectStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::object::list::Request, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_list_object(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 = StreamListObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.server_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + 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 ObjectServer { + 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 ObjectServer { + const NAME: &'static str = "vald.v1.Object"; + } +} +/// Generated server implementations. +pub mod remove_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 RemoveServer. + #[async_trait] + pub trait Remove: Send + Sync + 'static { + async fn remove( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to remove an indexed vector based on timestamp. +*/ + async fn remove_by_timestamp( + &self, + request: tonic::Request< + super::super::super::payload::v1::remove::TimestampRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamRemove method. + type StreamRemoveStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamLocation, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to remove multiple indexed vectors by bidirectional streaming. +*/ + async fn stream_remove( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to remove multiple indexed vectors in a single request. +*/ + async fn multi_remove( + &self, + request: tonic::Request< + super::super::super::payload::v1::remove::MultiRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct RemoveServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl RemoveServer { + 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 RemoveServer + where + T: Remove, + 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() { + "/vald.v1.Remove/Remove" => { + #[allow(non_camel_case_types)] + struct RemoveSvc(pub Arc); + impl< + T: Remove, + > tonic::server::UnaryService< + super::super::super::payload::v1::remove::Request, + > for RemoveSvc { + type Response = super::super::super::payload::v1::object::Location; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::remove::Request, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).remove(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 = RemoveSvc(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) + } + "/vald.v1.Remove/RemoveByTimestamp" => { + #[allow(non_camel_case_types)] + struct RemoveByTimestampSvc(pub Arc); + impl< + T: Remove, + > tonic::server::UnaryService< + super::super::super::payload::v1::remove::TimestampRequest, + > for RemoveByTimestampSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::remove::TimestampRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).remove_by_timestamp(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 = RemoveByTimestampSvc(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) + } + "/vald.v1.Remove/StreamRemove" => { + #[allow(non_camel_case_types)] + struct StreamRemoveSvc(pub Arc); + impl< + T: Remove, + > tonic::server::StreamingService< + super::super::super::payload::v1::remove::Request, + > for StreamRemoveSvc { + type Response = super::super::super::payload::v1::object::StreamLocation; + type ResponseStream = T::StreamRemoveStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::remove::Request, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_remove(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 = StreamRemoveSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Remove/MultiRemove" => { + #[allow(non_camel_case_types)] + struct MultiRemoveSvc(pub Arc); + impl< + T: Remove, + > tonic::server::UnaryService< + super::super::super::payload::v1::remove::MultiRequest, + > for MultiRemoveSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::remove::MultiRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_remove(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 = MultiRemoveSvc(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 RemoveServer { + 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 RemoveServer { + const NAME: &'static str = "vald.v1.Remove"; + } +} +/// Generated server implementations. +pub mod search_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 SearchServer. + #[async_trait] + pub trait Search: Send + Sync + 'static { + async fn search( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to search indexed vectors by ID. +*/ + async fn search_by_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamSearch method. + type StreamSearchStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::search::StreamResponse, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to search indexed vectors by multiple vectors. +*/ + async fn stream_search( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamSearchByID method. + type StreamSearchByIDStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::search::StreamResponse, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to search indexed vectors by multiple IDs. +*/ + async fn stream_search_by_id( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to search indexed vectors by multiple vectors in a single request. +*/ + async fn multi_search( + &self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to search indexed vectors by multiple IDs in a single request. +*/ + async fn multi_search_by_id( + &self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiIdRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to linear search indexed vectors by a raw vector. +*/ + async fn linear_search( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to linear search indexed vectors by ID. +*/ + async fn linear_search_by_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamLinearSearch method. + type StreamLinearSearchStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::search::StreamResponse, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to linear search indexed vectors by multiple vectors. +*/ + async fn stream_linear_search( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamLinearSearchByID method. + type StreamLinearSearchByIDStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::search::StreamResponse, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to linear search indexed vectors by multiple IDs. +*/ + async fn stream_linear_search_by_id( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to linear search indexed vectors by multiple vectors in a single + request. +*/ + async fn multi_linear_search( + &self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to linear search indexed vectors by multiple IDs in a single + request. +*/ + async fn multi_linear_search_by_id( + &self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiIdRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct SearchServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl SearchServer { + 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 SearchServer + where + T: Search, + 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() { + "/vald.v1.Search/Search" => { + #[allow(non_camel_case_types)] + struct SearchSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::Request, + > for SearchSvc { + type Response = super::super::super::payload::v1::search::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::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) + } + "/vald.v1.Search/SearchByID" => { + #[allow(non_camel_case_types)] + struct SearchByIDSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::IdRequest, + > for SearchByIDSvc { + type Response = super::super::super::payload::v1::search::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::IdRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).search_by_id(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 = SearchByIDSvc(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) + } + "/vald.v1.Search/StreamSearch" => { + #[allow(non_camel_case_types)] + struct StreamSearchSvc(pub Arc); + impl< + T: Search, + > tonic::server::StreamingService< + super::super::super::payload::v1::search::Request, + > for StreamSearchSvc { + type Response = super::super::super::payload::v1::search::StreamResponse; + type ResponseStream = T::StreamSearchStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::search::Request, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_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 = StreamSearchSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Search/StreamSearchByID" => { + #[allow(non_camel_case_types)] + struct StreamSearchByIDSvc(pub Arc); + impl< + T: Search, + > tonic::server::StreamingService< + super::super::super::payload::v1::search::IdRequest, + > for StreamSearchByIDSvc { + type Response = super::super::super::payload::v1::search::StreamResponse; + type ResponseStream = T::StreamSearchByIDStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::search::IdRequest, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_search_by_id(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 = StreamSearchByIDSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Search/MultiSearch" => { + #[allow(non_camel_case_types)] + struct MultiSearchSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::MultiRequest, + > for MultiSearchSvc { + type Response = super::super::super::payload::v1::search::Responses; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_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 = MultiSearchSvc(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) + } + "/vald.v1.Search/MultiSearchByID" => { + #[allow(non_camel_case_types)] + struct MultiSearchByIDSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::MultiIdRequest, + > for MultiSearchByIDSvc { + type Response = super::super::super::payload::v1::search::Responses; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiIdRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_search_by_id(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 = MultiSearchByIDSvc(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) + } + "/vald.v1.Search/LinearSearch" => { + #[allow(non_camel_case_types)] + struct LinearSearchSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::Request, + > for LinearSearchSvc { + type Response = super::super::super::payload::v1::search::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::Request, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).linear_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 = LinearSearchSvc(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) + } + "/vald.v1.Search/LinearSearchByID" => { + #[allow(non_camel_case_types)] + struct LinearSearchByIDSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::IdRequest, + > for LinearSearchByIDSvc { + type Response = super::super::super::payload::v1::search::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::IdRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).linear_search_by_id(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 = LinearSearchByIDSvc(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) + } + "/vald.v1.Search/StreamLinearSearch" => { + #[allow(non_camel_case_types)] + struct StreamLinearSearchSvc(pub Arc); + impl< + T: Search, + > tonic::server::StreamingService< + super::super::super::payload::v1::search::Request, + > for StreamLinearSearchSvc { + type Response = super::super::super::payload::v1::search::StreamResponse; + type ResponseStream = T::StreamLinearSearchStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::search::Request, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_linear_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 = StreamLinearSearchSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Search/StreamLinearSearchByID" => { + #[allow(non_camel_case_types)] + struct StreamLinearSearchByIDSvc(pub Arc); + impl< + T: Search, + > tonic::server::StreamingService< + super::super::super::payload::v1::search::IdRequest, + > for StreamLinearSearchByIDSvc { + type Response = super::super::super::payload::v1::search::StreamResponse; + type ResponseStream = T::StreamLinearSearchByIDStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::search::IdRequest, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_linear_search_by_id(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 = StreamLinearSearchByIDSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Search/MultiLinearSearch" => { + #[allow(non_camel_case_types)] + struct MultiLinearSearchSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::MultiRequest, + > for MultiLinearSearchSvc { + type Response = super::super::super::payload::v1::search::Responses; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_linear_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 = MultiLinearSearchSvc(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) + } + "/vald.v1.Search/MultiLinearSearchByID" => { + #[allow(non_camel_case_types)] + struct MultiLinearSearchByIDSvc(pub Arc); + impl< + T: Search, + > tonic::server::UnaryService< + super::super::super::payload::v1::search::MultiIdRequest, + > for MultiLinearSearchByIDSvc { + type Response = super::super::super::payload::v1::search::Responses; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::search::MultiIdRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_linear_search_by_id(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 = MultiLinearSearchByIDSvc(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 SearchServer { + 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 SearchServer { + const NAME: &'static str = "vald.v1.Search"; + } +} +/// Generated server implementations. +pub mod update_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 UpdateServer. + #[async_trait] + pub trait Update: Send + Sync + 'static { + async fn update( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamUpdate method. + type StreamUpdateStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamLocation, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to update multiple indexed vectors by bidirectional streaming. +*/ + async fn stream_update( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to update multiple indexed vectors in a single request. +*/ + async fn multi_update( + &self, + request: tonic::Request< + super::super::super::payload::v1::update::MultiRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct UpdateServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl UpdateServer { + 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 UpdateServer + where + T: Update, + 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() { + "/vald.v1.Update/Update" => { + #[allow(non_camel_case_types)] + struct UpdateSvc(pub Arc); + impl< + T: Update, + > tonic::server::UnaryService< + super::super::super::payload::v1::update::Request, + > for UpdateSvc { + type Response = super::super::super::payload::v1::object::Location; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::update::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) + } + "/vald.v1.Update/StreamUpdate" => { + #[allow(non_camel_case_types)] + struct StreamUpdateSvc(pub Arc); + impl< + T: Update, + > tonic::server::StreamingService< + super::super::super::payload::v1::update::Request, + > for StreamUpdateSvc { + type Response = super::super::super::payload::v1::object::StreamLocation; + type ResponseStream = T::StreamUpdateStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::update::Request, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_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 = StreamUpdateSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Update/MultiUpdate" => { + #[allow(non_camel_case_types)] + struct MultiUpdateSvc(pub Arc); + impl< + T: Update, + > tonic::server::UnaryService< + super::super::super::payload::v1::update::MultiRequest, + > for MultiUpdateSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::update::MultiRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_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 = MultiUpdateSvc(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 UpdateServer { + 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 UpdateServer { + const NAME: &'static str = "vald.v1.Update"; + } +} +/// Generated server implementations. +pub mod upsert_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 UpsertServer. + #[async_trait] + pub trait Upsert: Send + Sync + 'static { + async fn upsert( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the StreamUpsert method. + type StreamUpsertStream: futures_core::Stream< + Item = std::result::Result< + super::super::super::payload::v1::object::StreamLocation, + tonic::Status, + >, + > + + Send + + 'static; + /** A method to insert/update multiple vectors by bidirectional streaming. +*/ + async fn stream_upsert( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /** A method to insert/update multiple vectors in a single request. +*/ + async fn multi_upsert( + &self, + request: tonic::Request< + super::super::super::payload::v1::upsert::MultiRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct UpsertServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl UpsertServer { + 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 UpsertServer + where + T: Upsert, + 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() { + "/vald.v1.Upsert/Upsert" => { + #[allow(non_camel_case_types)] + struct UpsertSvc(pub Arc); + impl< + T: Upsert, + > tonic::server::UnaryService< + super::super::super::payload::v1::upsert::Request, + > for UpsertSvc { + type Response = super::super::super::payload::v1::object::Location; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::upsert::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) + } + "/vald.v1.Upsert/StreamUpsert" => { + #[allow(non_camel_case_types)] + struct StreamUpsertSvc(pub Arc); + impl< + T: Upsert, + > tonic::server::StreamingService< + super::super::super::payload::v1::upsert::Request, + > for StreamUpsertSvc { + type Response = super::super::super::payload::v1::object::StreamLocation; + type ResponseStream = T::StreamUpsertStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming< + super::super::super::payload::v1::upsert::Request, + >, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_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 = StreamUpsertSvc(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.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/vald.v1.Upsert/MultiUpsert" => { + #[allow(non_camel_case_types)] + struct MultiUpsertSvc(pub Arc); + impl< + T: Upsert, + > tonic::server::UnaryService< + super::super::super::payload::v1::upsert::MultiRequest, + > for MultiUpsertSvc { + type Response = super::super::super::payload::v1::object::Locations; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::payload::v1::upsert::MultiRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).multi_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 = MultiUpsertSvc(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 UpsertServer { + 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 UpsertServer { + const NAME: &'static str = "vald.v1.Upsert"; + } +} diff --git a/vald-client-rs/Cargo.toml b/vald-client-rs/Cargo.toml new file mode 100644 index 00000000000..bea1a882e3f --- /dev/null +++ b/vald-client-rs/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "vald-client-rs" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +prost = "0.12.3" +tonic = "0.10.2" +tonic-types = "0.10.2" diff --git a/vald-client-rs/src/core.v1.tonic.rs b/vald-client-rs/src/core.v1.tonic.rs new file mode 100644 index 00000000000..b5a09ae22b8 --- /dev/null +++ b/vald-client-rs/src/core.v1.tonic.rs @@ -0,0 +1,218 @@ +// @generated +/// Generated client implementations. +pub mod agent_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 AgentClient { + inner: tonic::client::Grpc, + } + impl AgentClient { + /// 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 AgentClient + 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, + ) -> AgentClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + AgentClient::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 create_index( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::control::CreateIndexRequest, + >, + ) -> 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( + "/core.v1.Agent/CreateIndex", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("core.v1.Agent", "CreateIndex")); + self.inner.unary(req, path, codec).await + } + pub async fn save_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("/core.v1.Agent/SaveIndex"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("core.v1.Agent", "SaveIndex")); + self.inner.unary(req, path, codec).await + } + /** Represent the creating and saving index RPC. +*/ + pub async fn create_and_save_index( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::control::CreateIndexRequest, + >, + ) -> 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( + "/core.v1.Agent/CreateAndSaveIndex", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("core.v1.Agent", "CreateAndSaveIndex")); + self.inner.unary(req, path, codec).await + } + /** Represent the RPC to get the agent index information. +*/ + pub async fn index_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("/core.v1.Agent/IndexInfo"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("core.v1.Agent", "IndexInfo")); + self.inner.unary(req, path, codec).await + } + /** Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process +*/ + pub async fn get_timestamp( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::object::GetTimestampRequest, + >, + ) -> 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( + "/core.v1.Agent/GetTimestamp", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("core.v1.Agent", "GetTimestamp")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/vald-client-rs/src/discoverer.v1.tonic.rs b/vald-client-rs/src/discoverer.v1.tonic.rs new file mode 100644 index 00000000000..abc5f2746ae --- /dev/null +++ b/vald-client-rs/src/discoverer.v1.tonic.rs @@ -0,0 +1,173 @@ +// @generated +/// Generated client implementations. +pub mod discoverer_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 DiscovererClient { + inner: tonic::client::Grpc, + } + impl DiscovererClient { + /// 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 DiscovererClient + 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, + ) -> DiscovererClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + DiscovererClient::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 pods( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> 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( + "/discoverer.v1.Discoverer/Pods", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("discoverer.v1.Discoverer", "Pods")); + self.inner.unary(req, path, codec).await + } + /** Represent the RPC to get the node information. +*/ + pub async fn nodes( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> 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( + "/discoverer.v1.Discoverer/Nodes", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("discoverer.v1.Discoverer", "Nodes")); + self.inner.unary(req, path, codec).await + } + /** Represent the RPC to get the readreplica svc information. +*/ + pub async fn services( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::discoverer::Request, + >, + ) -> 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( + "/discoverer.v1.Discoverer/Services", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("discoverer.v1.Discoverer", "Services")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/vald-client-rs/src/filter.egress.v1.tonic.rs b/vald-client-rs/src/filter.egress.v1.tonic.rs new file mode 100644 index 00000000000..0266653131f --- /dev/null +++ b/vald-client-rs/src/filter.egress.v1.tonic.rs @@ -0,0 +1,148 @@ +// @generated +/// Generated client implementations. +pub mod filter_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /** Represent the egress filter service. +*/ + #[derive(Debug, Clone)] + pub struct FilterClient { + inner: tonic::client::Grpc, + } + impl FilterClient { + /// 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 FilterClient + 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, + ) -> FilterClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + FilterClient::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 + } + /** Represent the RPC to filter the distance. +*/ + pub async fn filter_distance( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::payload::v1::object::Distance, + >, + ) -> 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( + "/filter.egress.v1.Filter/FilterDistance", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("filter.egress.v1.Filter", "FilterDistance")); + self.inner.unary(req, path, codec).await + } + /** Represent the RPC to filter the vector. +*/ + pub async fn filter_vector( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::payload::v1::object::Vector, + >, + ) -> 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( + "/filter.egress.v1.Filter/FilterVector", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("filter.egress.v1.Filter", "FilterVector")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/vald-client-rs/src/filter.ingress.v1.tonic.rs b/vald-client-rs/src/filter.ingress.v1.tonic.rs new file mode 100644 index 00000000000..feb4896156b --- /dev/null +++ b/vald-client-rs/src/filter.ingress.v1.tonic.rs @@ -0,0 +1,148 @@ +// @generated +/// Generated client implementations. +pub mod filter_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /** Represent the ingress filter service. +*/ + #[derive(Debug, Clone)] + pub struct FilterClient { + inner: tonic::client::Grpc, + } + impl FilterClient { + /// 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 FilterClient + 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, + ) -> FilterClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + FilterClient::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 + } + /** Represent the RPC to generate the vector. +*/ + pub async fn gen_vector( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::payload::v1::object::Blob, + >, + ) -> 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( + "/filter.ingress.v1.Filter/GenVector", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("filter.ingress.v1.Filter", "GenVector")); + self.inner.unary(req, path, codec).await + } + /** Represent the RPC to filter the vector. +*/ + pub async fn filter_vector( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::payload::v1::object::Vector, + >, + ) -> 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( + "/filter.ingress.v1.Filter/FilterVector", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("filter.ingress.v1.Filter", "FilterVector")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/vald-client-rs/src/lib.rs b/vald-client-rs/src/lib.rs new file mode 100644 index 00000000000..6fd5290d8c3 --- /dev/null +++ b/vald-client-rs/src/lib.rs @@ -0,0 +1,25 @@ +pub mod google { + pub mod rpc { + pub type Status = tonic_types::Status; + } +} + +pub mod payload { + pub mod v1 { + include!("payload.v1.rs"); + } +} + +pub mod vald { + pub mod v1 { + include!("vald.v1.tonic.rs"); + } +} + +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + use super::vald::*; + } +} diff --git a/vald-client-rs/src/manager.index.v1.tonic.rs b/vald-client-rs/src/manager.index.v1.tonic.rs new file mode 100644 index 00000000000..d81387ba9b8 --- /dev/null +++ b/vald-client-rs/src/manager.index.v1.tonic.rs @@ -0,0 +1,115 @@ +// @generated +/// Generated client implementations. +pub mod index_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 IndexClient { + inner: tonic::client::Grpc, + } + impl IndexClient { + /// 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 IndexClient + 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, + ) -> IndexClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + IndexClient::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 index_info( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::payload::v1::Empty, + >, + ) -> 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( + "/manager.index.v1.Index/IndexInfo", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("manager.index.v1.Index", "IndexInfo")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/vald-client-rs/src/payload.v1.rs b/vald-client-rs/src/payload.v1.rs new file mode 100644 index 00000000000..bd136dd9e4d --- /dev/null +++ b/vald-client-rs/src/payload.v1.rs @@ -0,0 +1,998 @@ +// @generated +/// Search related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Search { +} +/// Nested message and enum types in `Search`. +pub mod search { + /// Represent a search request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be searched. + #[prost(float, repeated, packed="false", tag="1")] + pub vector: ::prost::alloc::vec::Vec, + /// The configuration of the search request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple search request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple search request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent a search by ID request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct IdRequest { + /// The vector ID to be searched. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The configuration of the search request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple search by ID request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiIdRequest { + /// Represent the multiple search by ID request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent a search by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be searched. + #[prost(bytes="vec", tag="1")] + pub object: ::prost::alloc::vec::Vec, + /// The configuration of the search request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter configuration. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple search by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent the multiple search by binary object request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent search configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// Unique request ID. + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, + /// Maximum number of result to be returned. + #[prost(uint32, tag="2")] + pub num: u32, + /// Search radius. + #[prost(float, tag="3")] + pub radius: f32, + /// Search coefficient. + #[prost(float, tag="4")] + pub epsilon: f32, + /// Search timeout in nanoseconds. + #[prost(int64, tag="5")] + pub timeout: i64, + /// Ingress filter configurations. + #[prost(message, optional, tag="6")] + pub ingress_filters: ::core::option::Option, + /// Egress filter configurations. + #[prost(message, optional, tag="7")] + pub egress_filters: ::core::option::Option, + /// Minimum number of result to be returned. + #[prost(uint32, tag="8")] + pub min_num: u32, + /// Aggregation Algorithm + #[prost(enumeration="AggregationAlgorithm", tag="9")] + pub aggregation_algorithm: i32, + } + /// Represent a search response. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Response { + /// The unique request ID. + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, + /// Search results. + #[prost(message, repeated, tag="2")] + pub results: ::prost::alloc::vec::Vec, + } + /// Represent multiple search responses. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Responses { + /// Represent the multiple search response content. + #[prost(message, repeated, tag="1")] + pub responses: ::prost::alloc::vec::Vec, + } + /// Represent stream search response. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamResponse { + #[prost(oneof="stream_response::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamResponse`. + pub mod stream_response { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// Represent the search response. + #[prost(message, tag="1")] + Response(super::Response), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// AggregationAlgorithm is enum of each aggregation algorithms + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum AggregationAlgorithm { + Unknown = 0, + ConcurrentQueue = 1, + SortSlice = 2, + SortPoolSlice = 3, + PairingHeap = 4, + } + impl AggregationAlgorithm { + /// 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 { + AggregationAlgorithm::Unknown => "Unknown", + AggregationAlgorithm::ConcurrentQueue => "ConcurrentQueue", + AggregationAlgorithm::SortSlice => "SortSlice", + AggregationAlgorithm::SortPoolSlice => "SortPoolSlice", + AggregationAlgorithm::PairingHeap => "PairingHeap", + } + } + /// 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), + "ConcurrentQueue" => Some(Self::ConcurrentQueue), + "SortSlice" => Some(Self::SortSlice), + "SortPoolSlice" => Some(Self::SortPoolSlice), + "PairingHeap" => Some(Self::PairingHeap), + _ => None, + } + } + } +} +/// Filter related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Filter { +} +/// Nested message and enum types in `Filter`. +pub mod filter { + /// Represent the target filter server. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Target { + /// The target hostname. + #[prost(string, tag="1")] + pub host: ::prost::alloc::string::String, + /// The target port. + #[prost(uint32, tag="2")] + pub port: u32, + } + /// Represent filter configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// Represent the filter target configuration. + #[prost(message, repeated, tag="1")] + pub targets: ::prost::alloc::vec::Vec, + } +} +/// Insert related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Insert { +} +/// Nested message and enum types in `Insert`. +pub mod insert { + /// Represent the insert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be inserted. + #[prost(message, optional, tag="1")] + pub vector: ::core::option::Option, + /// The configuration of the insert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple insert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent multiple insert request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the insert by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be inserted. + #[prost(message, optional, tag="1")] + pub object: ::core::option::Option, + /// The configuration of the insert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter configurations. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple insert by binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent multiple insert by object content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent insert configurations. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during insert operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Filter configurations. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + /// Insert timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + } +} +/// Update related messages +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Update { +} +/// Nested message and enum types in `Update`. +pub mod update { + /// Represent the update request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be updated. + #[prost(message, optional, tag="1")] + pub vector: ::core::option::Option, + /// The configuration of the update request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple update request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple update request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the update binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be updated. + #[prost(message, optional, tag="1")] + pub object: ::core::option::Option, + /// The configuration of the update request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter target. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple update binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent the multiple update object request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the update configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during update operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Filter configuration. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + /// Update timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + /// A flag to disable balanced update (split remove -> insert operation) + /// during update operation. + #[prost(bool, tag="4")] + pub disable_balanced_update: bool, + } +} +/// Upsert related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Upsert { +} +/// Nested message and enum types in `Upsert`. +pub mod upsert { + /// Represent the upsert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The vector to be upserted. + #[prost(message, optional, tag="1")] + pub vector: ::core::option::Option, + /// The configuration of the upsert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent mthe ultiple upsert request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple upsert request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the upsert binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ObjectRequest { + /// The binary object to be upserted. + #[prost(message, optional, tag="1")] + pub object: ::core::option::Option, + /// The configuration of the upsert request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + /// Filter target. + #[prost(message, optional, tag="3")] + pub vectorizer: ::core::option::Option, + } + /// Represent the multiple upsert binary object request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiObjectRequest { + /// Represent the multiple upsert object request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the upsert configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during upsert operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Filter configuration. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + /// Upsert timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + /// A flag to disable balanced update (split remove -> insert operation) + /// during update operation. + #[prost(bool, tag="4")] + pub disable_balanced_update: bool, + } +} +/// Remove related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Remove { +} +/// Nested message and enum types in `Remove`. +pub mod remove { + /// Represent the remove request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The object ID to be removed. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// The configuration of the remove request. + #[prost(message, optional, tag="2")] + pub config: ::core::option::Option, + } + /// Represent the multiple remove request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MultiRequest { + /// Represent the multiple remove request content. + #[prost(message, repeated, tag="1")] + pub requests: ::prost::alloc::vec::Vec, + } + /// Represent the remove request based on timestamp. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct TimestampRequest { + /// The timestamp comparison list. If more than one is specified, the `AND` search is applied. + #[prost(message, repeated, tag="1")] + pub timestamps: ::prost::alloc::vec::Vec, + } + /// Represent the timestamp comparison. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Timestamp { + /// The timestamp. + #[prost(int64, tag="1")] + pub timestamp: i64, + /// The conditional operator. + #[prost(enumeration="timestamp::Operator", tag="2")] + pub operator: i32, + } + /// Nested message and enum types in `Timestamp`. + pub mod timestamp { + /// Operator is enum of each conditional operator. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Operator { + /// The timestamp is equal to the specified value in the request. + Eq = 0, + /// The timestamp is not equal to the specified value in the request. + Ne = 1, + /// The timestamp is greater than or equal to the specified value in the request. + Ge = 2, + /// The timestamp is greater than the specified value in the request. + Gt = 3, + /// The timestamp is less than or equal to the specified value in the request. + Le = 4, + /// The timestamp is less than the specified value in the request. + Lt = 5, + } + impl Operator { + /// 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 { + Operator::Eq => "Eq", + Operator::Ne => "Ne", + Operator::Ge => "Ge", + Operator::Gt => "Gt", + Operator::Le => "Le", + Operator::Lt => "Lt", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Eq" => Some(Self::Eq), + "Ne" => Some(Self::Ne), + "Ge" => Some(Self::Ge), + "Gt" => Some(Self::Gt), + "Le" => Some(Self::Le), + "Lt" => Some(Self::Lt), + _ => None, + } + } + } + } + /// Represent the remove configuration. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Config { + /// A flag to skip exist check during upsert operation. + #[prost(bool, tag="1")] + pub skip_strict_exist_check: bool, + /// Remove timestamp. + #[prost(int64, tag="3")] + pub timestamp: i64, + } +} +/// Common messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Object { +} +/// Nested message and enum types in `Object`. +pub mod object { + /// Represent a request to fetch raw vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct VectorRequest { + /// The vector ID to be fetched. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// Filter configurations. + #[prost(message, optional, tag="2")] + pub filters: ::core::option::Option, + } + /// Represent the ID and distance pair. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Distance { + /// The vector ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The distance. + #[prost(float, tag="2")] + pub distance: f32, + } + /// Represent stream response of distances. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamDistance { + #[prost(oneof="stream_distance::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamDistance`. + pub mod stream_distance { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The distance. + #[prost(message, tag="1")] + Distance(super::Distance), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent the vector ID. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Id { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + } + /// Represent multiple vector IDs. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct IDs { + #[prost(string, repeated, tag="1")] + pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } + /// Represent a vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Vector { + /// The vector ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The vector. + #[prost(float, repeated, packed="false", tag="2")] + pub vector: ::prost::alloc::vec::Vec, + /// timestamp represents when this vector inserted. + #[prost(int64, tag="3")] + pub timestamp: i64, + } + /// Represent a request to fetch vector meta data. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct GetTimestampRequest { + /// The vector ID to be fetched. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + } + /// Represent a vector meta data. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Timestamp { + /// The vector ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// timestamp represents when this vector inserted. + #[prost(int64, tag="2")] + pub timestamp: i64, + } + /// Represent multiple vectors. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Vectors { + #[prost(message, repeated, tag="1")] + pub vectors: ::prost::alloc::vec::Vec, + } + /// Represent stream response of the vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamVector { + #[prost(oneof="stream_vector::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamVector`. + pub mod stream_vector { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The vector. + #[prost(message, tag="1")] + Vector(super::Vector), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent reshape vector. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ReshapeVector { + /// The binary object. + #[prost(bytes="vec", tag="1")] + pub object: ::prost::alloc::vec::Vec, + /// The new shape. + #[prost(int32, repeated, tag="2")] + pub shape: ::prost::alloc::vec::Vec, + } + /// Represent the binary object. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Blob { + /// The object ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The binary object. + #[prost(bytes="vec", tag="2")] + pub object: ::prost::alloc::vec::Vec, + } + /// Represent stream response of binary objects. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamBlob { + #[prost(oneof="stream_blob::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamBlob`. + pub mod stream_blob { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The binary object. + #[prost(message, tag="1")] + Blob(super::Blob), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent the vector location. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Location { + /// The name of the location. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The UUID of the vector. + #[prost(string, tag="2")] + pub uuid: ::prost::alloc::string::String, + /// The IP list. + #[prost(string, repeated, tag="3")] + pub ips: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } + /// Represent the stream response of the vector location. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct StreamLocation { + #[prost(oneof="stream_location::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `StreamLocation`. + pub mod stream_location { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The vector location. + #[prost(message, tag="1")] + Location(super::Location), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::google::rpc::Status), + } + } + /// Represent multiple vector locations. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Locations { + #[prost(message, repeated, tag="1")] + pub locations: ::prost::alloc::vec::Vec, + } + /// Represent the list object vector stream request and response. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct List { + } + /// Nested message and enum types in `List`. + pub mod list { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Response { + #[prost(oneof="response::Payload", tags="1, 2")] + pub payload: ::core::option::Option, + } + /// Nested message and enum types in `Response`. + pub mod response { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Payload { + /// The vector + #[prost(message, tag="1")] + Vector(super::super::Vector), + /// The RPC error status. + #[prost(message, tag="2")] + Status(super::super::super::super::super::google::rpc::Status), + } + } + } +} +/// Control related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Control { +} +/// Nested message and enum types in `Control`. +pub mod control { + /// Represent the create index request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct CreateIndexRequest { + /// The pool size of the create index operation. + #[prost(uint32, tag="1")] + pub pool_size: u32, + } +} +/// Discoverer related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Discoverer { +} +/// Nested message and enum types in `Discoverer`. +pub mod discoverer { + /// Represent the dicoverer request. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + /// The agent name to be discovered. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The namespace to be discovered. + #[prost(string, tag="2")] + pub namespace: ::prost::alloc::string::String, + /// The node to be discovered. + #[prost(string, tag="3")] + pub node: ::prost::alloc::string::String, + } +} +/// Info related messages. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Info { +} +/// Nested message and enum types in `Info`. +pub mod info { + /// Represent the index information messages. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Index { + } + /// Nested message and enum types in `Index`. + pub mod index { + /// Represent the index count message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Count { + /// The stored index count. + #[prost(uint32, tag="1")] + pub stored: u32, + /// The uncommitted index count. + #[prost(uint32, tag="2")] + pub uncommitted: u32, + /// The indexing index count. + #[prost(bool, tag="3")] + pub indexing: bool, + /// The saving index count. + #[prost(bool, tag="4")] + pub saving: bool, + } + /// Represent the UUID message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Uuid { + } + /// Nested message and enum types in `UUID`. + pub mod uuid { + /// The committed UUID. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Committed { + #[prost(string, tag="1")] + pub uuid: ::prost::alloc::string::String, + } + /// The uncommitted UUID. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Uncommitted { + #[prost(string, tag="1")] + pub uuid: ::prost::alloc::string::String, + } + } + } + /// Represent the pod information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Pod { + /// The app name of the pod on the label. + #[prost(string, tag="1")] + pub app_name: ::prost::alloc::string::String, + /// The name of the pod. + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + /// The namespace of the pod. + #[prost(string, tag="3")] + pub namespace: ::prost::alloc::string::String, + /// The IP of the pod. + #[prost(string, tag="4")] + pub ip: ::prost::alloc::string::String, + /// The CPU information of the pod. + #[prost(message, optional, tag="5")] + pub cpu: ::core::option::Option, + /// The memory information of the pod. + #[prost(message, optional, tag="6")] + pub memory: ::core::option::Option, + /// The node information of the pod. + #[prost(message, optional, tag="7")] + pub node: ::core::option::Option, + } + /// Represent the node information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Node { + /// The name of the node. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The internal IP address of the node. + #[prost(string, tag="2")] + pub internal_addr: ::prost::alloc::string::String, + /// The external IP address of the node. + #[prost(string, tag="3")] + pub external_addr: ::prost::alloc::string::String, + /// The CPU information of the node. + #[prost(message, optional, tag="4")] + pub cpu: ::core::option::Option, + /// The memory information of the node. + #[prost(message, optional, tag="5")] + pub memory: ::core::option::Option, + /// The pod information of the node. + #[prost(message, optional, tag="6")] + pub pods: ::core::option::Option, + } + /// Represent the service information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Service { + /// The name of the svc. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The cluster ip of the svc. + #[prost(string, tag="2")] + pub cluster_ip: ::prost::alloc::string::String, + /// The cluster ips of the svc. + #[prost(string, repeated, tag="3")] + pub cluster_ips: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The port of the svc. + #[prost(message, repeated, tag="4")] + pub ports: ::prost::alloc::vec::Vec, + /// The labels of the service. + #[prost(message, optional, tag="5")] + pub labels: ::core::option::Option, + /// The annotations of the service. + #[prost(message, optional, tag="6")] + pub annotations: ::core::option::Option, + } + /// Represets the service port information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ServicePort { + /// The name of the port. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The port number + #[prost(int32, tag="2")] + pub port: i32, + } + /// Represent the kubernetes labels. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Labels { + #[prost(map="string, string", tag="1")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + } + /// Represent the kubernetes annotations. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Annotations { + #[prost(map="string, string", tag="1")] + pub annotations: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + } + /// Represent the CPU information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Cpu { + /// The CPU resource limit. + #[prost(double, tag="1")] + pub limit: f64, + /// The CPU resource requested. + #[prost(double, tag="2")] + pub request: f64, + /// The CPU usage. + #[prost(double, tag="3")] + pub usage: f64, + } + /// Represent the memory information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Memory { + /// The memory limit. + #[prost(double, tag="1")] + pub limit: f64, + /// The memory requested. + #[prost(double, tag="2")] + pub request: f64, + /// The memory usage. + #[prost(double, tag="3")] + pub usage: f64, + } + /// Represent the multiple pod information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Pods { + /// The multiple pod information. + #[prost(message, repeated, tag="1")] + pub pods: ::prost::alloc::vec::Vec, + } + /// Represent the multiple node information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Nodes { + /// The multiple node information. + #[prost(message, repeated, tag="1")] + pub nodes: ::prost::alloc::vec::Vec, + } + /// Represent the multiple service information message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Services { + /// The multiple service information. + #[prost(message, repeated, tag="1")] + pub services: ::prost::alloc::vec::Vec, + } + /// Represent the multiple IP message. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct IPs { + #[prost(string, repeated, tag="1")] + pub ip: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } +} +/// Represent an empty message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Empty { +} +// @@protoc_insertion_point(module) diff --git a/vald-client-rs/src/rpc.v1.rs b/vald-client-rs/src/rpc.v1.rs new file mode 100644 index 00000000000..7924d6d4db9 --- /dev/null +++ b/vald-client-rs/src/rpc.v1.rs @@ -0,0 +1,302 @@ +// @generated +/// Describes the cause of the error with structured details. +/// +/// Example of an error when contacting the "pubsub.googleapis.com" API when it +/// is not enabled: +/// +/// { "reason": "API_DISABLED" +/// "domain": "googleapis.com" +/// "metadata": { +/// "resource": "projects/123", +/// "service": "pubsub.googleapis.com" +/// } +/// } +/// +/// This response indicates that the pubsub.googleapis.com API is not enabled. +/// +/// Example of an error that is returned when attempting to create a Spanner +/// instance in a region that is out of stock: +/// +/// { "reason": "STOCKOUT" +/// "domain": "spanner.googleapis.com", +/// "metadata": { +/// "availableRegions": "us-central1,us-east2" +/// } +/// } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ErrorInfo { + /// The reason of the error. This is a constant value that identifies the + /// proximate cause of the error. Error reasons are unique within a particular + /// domain of errors. This should be at most 63 characters and match a + /// regular expression of `\[A-Z][A-Z0-9_]+[A-Z0-9\]`, which represents + /// UPPER_SNAKE_CASE. + #[prost(string, tag="1")] + pub reason: ::prost::alloc::string::String, + /// The logical grouping to which the "reason" belongs. The error domain + /// is typically the registered service name of the tool or product that + /// generates the error. Example: "pubsub.googleapis.com". If the error is + /// generated by some common infrastructure, the error domain must be a + /// globally unique value that identifies the infrastructure. For Google API + /// infrastructure, the error domain is "googleapis.com". + #[prost(string, tag="2")] + pub domain: ::prost::alloc::string::String, + /// Additional structured details about this error. + /// + /// Keys should match /\[a-zA-Z0-9-_\]/ and be limited to 64 characters in + /// length. When identifying the current value of an exceeded limit, the units + /// should be contained in the key, not the value. For example, rather than + /// {"instanceLimit": "100/request"}, should be returned as, + /// {"instanceLimitPerRequest": "100"}, if the client exceeds the number of + /// instances that can be created in a single (batch) request. + #[prost(map="string, string", tag="3")] + pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, +} +/// Describes when the clients can retry a failed request. Clients could ignore +/// the recommendation here or retry when this information is missing from error +/// responses. +/// +/// It's always recommended that clients should use exponential backoff when +/// retrying. +/// +/// Clients should wait until `retry_delay` amount of time has passed since +/// receiving the error response before retrying. If retrying requests also +/// fail, clients should use an exponential backoff scheme to gradually increase +/// the delay between retries based on `retry_delay`, until either a maximum +/// number of retries have been reached or a maximum retry delay cap has been +/// reached. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RetryInfo { + /// Clients should wait at least this long between retrying the same request. + #[prost(message, optional, tag="1")] + pub retry_delay: ::core::option::Option<::prost_types::Duration>, +} +/// Describes additional debugging info. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DebugInfo { + /// The stack trace entries indicating where the error occurred. + #[prost(string, repeated, tag="1")] + pub stack_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Additional debugging information provided by the server. + #[prost(string, tag="2")] + pub detail: ::prost::alloc::string::String, +} +/// Describes how a quota check failed. +/// +/// For example if a daily limit was exceeded for the calling project, +/// a service could respond with a QuotaFailure detail containing the project +/// id and the description of the quota limit that was exceeded. If the +/// calling project hasn't enabled the service in the developer console, then +/// a service could respond with the project id and set `service_disabled` +/// to true. +/// +/// Also see RetryInfo and Help types for other details about handling a +/// quota failure. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuotaFailure { + /// Describes all quota violations. + #[prost(message, repeated, tag="1")] + pub violations: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `QuotaFailure`. +pub mod quota_failure { + /// A message type used to describe a single quota violation. For example, a + /// daily quota or a custom quota that was exceeded. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Violation { + /// The subject on which the quota check failed. + /// For example, "clientip:" or "project:". + #[prost(string, tag="1")] + pub subject: ::prost::alloc::string::String, + /// A description of how the quota check failed. Clients can use this + /// description to find more about the quota configuration in the service's + /// public documentation, or find the relevant quota limit to adjust through + /// developer console. + /// + /// For example: "Service disabled" or "Daily Limit for read operations + /// exceeded". + #[prost(string, tag="2")] + pub description: ::prost::alloc::string::String, + } +} +/// Describes what preconditions have failed. +/// +/// For example, if an RPC failed because it required the Terms of Service to be +/// acknowledged, it could list the terms of service violation in the +/// PreconditionFailure message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PreconditionFailure { + /// Describes all precondition violations. + #[prost(message, repeated, tag="1")] + pub violations: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `PreconditionFailure`. +pub mod precondition_failure { + /// A message type used to describe a single precondition failure. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Violation { + /// The type of PreconditionFailure. We recommend using a service-specific + /// enum type to define the supported precondition violation subjects. For + /// example, "TOS" for "Terms of Service violation". + #[prost(string, tag="1")] + pub r#type: ::prost::alloc::string::String, + /// The subject, relative to the type, that failed. + /// For example, "google.com/cloud" relative to the "TOS" type would indicate + /// which terms of service is being referenced. + #[prost(string, tag="2")] + pub subject: ::prost::alloc::string::String, + /// A description of how the precondition failed. Developers can use this + /// description to understand how to fix the failure. + /// + /// For example: "Terms of service not accepted". + #[prost(string, tag="3")] + pub description: ::prost::alloc::string::String, + } +} +/// Describes violations in a client request. This error type focuses on the +/// syntactic aspects of the request. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BadRequest { + /// Describes all violations in a client request. + #[prost(message, repeated, tag="1")] + pub field_violations: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `BadRequest`. +pub mod bad_request { + /// A message type used to describe a single bad request field. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct FieldViolation { + /// A path that leads to a field in the request body. The value will be a + /// sequence of dot-separated identifiers that identify a protocol buffer + /// field. + /// + /// Consider the following: + /// + /// message CreateContactRequest { + /// message EmailAddress { + /// enum Type { + /// TYPE_UNSPECIFIED = 0; + /// HOME = 1; + /// WORK = 2; + /// } + /// + /// optional string email = 1; + /// repeated EmailType type = 2; + /// } + /// + /// string full_name = 1; + /// repeated EmailAddress email_addresses = 2; + /// } + /// + /// In this example, in proto `field` could take one of the following values: + /// + /// * `full_name` for a violation in the `full_name` value + /// * `email_addresses\[1\].email` for a violation in the `email` field of the + /// first `email_addresses` message + /// * `email_addresses\[3].type[2\]` for a violation in the second `type` + /// value in the third `email_addresses` message. + /// + /// In JSON, the same values are represented as: + /// + /// * `fullName` for a violation in the `fullName` value + /// * `emailAddresses\[1\].email` for a violation in the `email` field of the + /// first `emailAddresses` message + /// * `emailAddresses\[3].type[2\]` for a violation in the second `type` + /// value in the third `emailAddresses` message. + #[prost(string, tag="1")] + pub field: ::prost::alloc::string::String, + /// A description of why the request element is bad. + #[prost(string, tag="2")] + pub description: ::prost::alloc::string::String, + } +} +/// Contains metadata about the request that clients can attach when filing a bug +/// or providing other forms of feedback. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RequestInfo { + /// An opaque string that should only be interpreted by the service generating + /// it. For example, it can be used to identify requests in the service's logs. + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, + /// Any data that was used to serve this request. For example, an encrypted + /// stack trace that can be sent back to the service provider for debugging. + #[prost(string, tag="2")] + pub serving_data: ::prost::alloc::string::String, +} +/// Describes the resource that is being accessed. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResourceInfo { + /// A name for the type of resource being accessed, e.g. "sql table", + /// "cloud storage bucket", "file", "Google calendar"; or the type URL + /// of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + #[prost(string, tag="1")] + pub resource_type: ::prost::alloc::string::String, + /// The name of the resource being accessed. For example, a shared calendar + /// name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + /// error is + /// \[google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED\]. + #[prost(string, tag="2")] + pub resource_name: ::prost::alloc::string::String, + /// The owner of the resource (optional). + /// For example, "user:" or "project:". + #[prost(string, tag="3")] + pub owner: ::prost::alloc::string::String, + /// Describes what error is encountered when accessing this resource. + /// For example, updating a cloud project may require the `writer` permission + /// on the developer console project. + #[prost(string, tag="4")] + pub description: ::prost::alloc::string::String, +} +/// Provides links to documentation or for performing an out of band action. +/// +/// For example, if a quota check failed with an error indicating the calling +/// project hasn't enabled the accessed service, this can contain a URL pointing +/// directly to the right place in the developer console to flip the bit. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Help { + /// URL(s) pointing to additional information on handling the current error. + #[prost(message, repeated, tag="1")] + pub links: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `Help`. +pub mod help { + /// Describes a URL link. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Link { + /// Describes what the link offers. + #[prost(string, tag="1")] + pub description: ::prost::alloc::string::String, + /// The URL of the link. + #[prost(string, tag="2")] + pub url: ::prost::alloc::string::String, + } +} +/// Provides a localized error message that is safe to return to the user +/// which can be attached to an RPC error. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LocalizedMessage { + /// The locale used following the specification defined at + /// + /// Examples are: "en-US", "fr-CH", "es-MX" + #[prost(string, tag="1")] + pub locale: ::prost::alloc::string::String, + /// The localized error message in the above locale. + #[prost(string, tag="2")] + pub message: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/vald-client-rs/src/sidecar.v1.tonic.rs b/vald-client-rs/src/sidecar.v1.tonic.rs new file mode 100644 index 00000000000..231085be2c7 --- /dev/null +++ b/vald-client-rs/src/sidecar.v1.tonic.rs @@ -0,0 +1,88 @@ +// @generated +/// Generated client implementations. +pub mod sidecar_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 SidecarClient { + inner: tonic::client::Grpc, + } + impl SidecarClient { + /// 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 SidecarClient + 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, + ) -> SidecarClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + SidecarClient::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 + } + } +} diff --git a/vald-client-rs/src/vald.v1.tonic.rs b/vald-client-rs/src/vald.v1.tonic.rs new file mode 100644 index 00000000000..a17ffc91558 --- /dev/null +++ b/vald-client-rs/src/vald.v1.tonic.rs @@ -0,0 +1,1821 @@ +// @generated +/// Generated client implementations. +pub mod filter_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 FilterClient { + inner: tonic::client::Grpc, + } + impl FilterClient { + /// 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 FilterClient + 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, + ) -> FilterClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + FilterClient::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 search_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::ObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/SearchObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "SearchObject")); + self.inner.unary(req, path, codec).await + } + /** A method to search multiple objects. +*/ + pub async fn multi_search_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::MultiObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/MultiSearchObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "MultiSearchObject")); + self.inner.unary(req, path, codec).await + } + /** A method to search object by bidirectional streaming. +*/ + pub async fn stream_search_object( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::search::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::search::StreamResponse, + >, + >, + 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( + "/vald.v1.Filter/StreamSearchObject", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "StreamSearchObject")); + self.inner.streaming(req, path, codec).await + } + /** A method insert object. +*/ + pub async fn insert_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::insert::ObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/InsertObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "InsertObject")); + self.inner.unary(req, path, codec).await + } + /** Represent the streaming RPC to insert object by bidirectional streaming. +*/ + pub async fn stream_insert_object( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::insert::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamLocation, + >, + >, + 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( + "/vald.v1.Filter/StreamInsertObject", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "StreamInsertObject")); + self.inner.streaming(req, path, codec).await + } + /** A method to insert multiple objects. +*/ + pub async fn multi_insert_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::insert::MultiObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/MultiInsertObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "MultiInsertObject")); + self.inner.unary(req, path, codec).await + } + /** A method to update object. +*/ + pub async fn update_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::update::ObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/UpdateObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "UpdateObject")); + self.inner.unary(req, path, codec).await + } + /** A method to update object by bidirectional streaming. +*/ + pub async fn stream_update_object( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::update::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamLocation, + >, + >, + 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( + "/vald.v1.Filter/StreamUpdateObject", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "StreamUpdateObject")); + self.inner.streaming(req, path, codec).await + } + /** A method to update multiple objects. +*/ + pub async fn multi_update_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::update::MultiObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/MultiUpdateObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "MultiUpdateObject")); + self.inner.unary(req, path, codec).await + } + /** A method to upsert object. +*/ + pub async fn upsert_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::upsert::ObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/UpsertObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "UpsertObject")); + self.inner.unary(req, path, codec).await + } + /** A method to upsert object by bidirectional streaming. +*/ + pub async fn stream_upsert_object( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::upsert::ObjectRequest, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamLocation, + >, + >, + 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( + "/vald.v1.Filter/StreamUpsertObject", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "StreamUpsertObject")); + self.inner.streaming(req, path, codec).await + } + /** A method to upsert multiple objects. +*/ + pub async fn multi_upsert_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::upsert::MultiObjectRequest, + >, + ) -> 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( + "/vald.v1.Filter/MultiUpsertObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Filter", "MultiUpsertObject")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod insert_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 InsertClient { + inner: tonic::client::Grpc, + } + impl InsertClient { + /// 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 InsertClient + 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, + ) -> InsertClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + InsertClient::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 insert( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::insert::Request, + >, + ) -> 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("/vald.v1.Insert/Insert"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Insert", "Insert")); + self.inner.unary(req, path, codec).await + } + /** A method to add new multiple vectors by bidirectional streaming. +*/ + pub async fn stream_insert( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::insert::Request, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamLocation, + >, + >, + 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( + "/vald.v1.Insert/StreamInsert", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Insert", "StreamInsert")); + self.inner.streaming(req, path, codec).await + } + /** A method to add new multiple vectors in a single request. +*/ + pub async fn multi_insert( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::insert::MultiRequest, + >, + ) -> 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( + "/vald.v1.Insert/MultiInsert", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Insert", "MultiInsert")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod object_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 ObjectClient { + inner: tonic::client::Grpc, + } + impl ObjectClient { + /// 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 ObjectClient + 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, + ) -> ObjectClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + ObjectClient::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 exists( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::object::Id, + >, + ) -> 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("/vald.v1.Object/Exists"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Object", "Exists")); + self.inner.unary(req, path, codec).await + } + /** A method to fetch a vector. +*/ + pub async fn get_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::object::VectorRequest, + >, + ) -> 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("/vald.v1.Object/GetObject"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Object", "GetObject")); + self.inner.unary(req, path, codec).await + } + /** A method to fetch vectors by bidirectional streaming. +*/ + pub async fn stream_get_object( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::object::VectorRequest, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamVector, + >, + >, + 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( + "/vald.v1.Object/StreamGetObject", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Object", "StreamGetObject")); + self.inner.streaming(req, path, codec).await + } + /** A method to get all the vectors with server streaming +*/ + pub async fn stream_list_object( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::object::list::Request, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::list::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( + "/vald.v1.Object/StreamListObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Object", "StreamListObject")); + self.inner.server_streaming(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod remove_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 RemoveClient { + inner: tonic::client::Grpc, + } + impl RemoveClient { + /// 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 RemoveClient + 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, + ) -> RemoveClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + RemoveClient::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 remove( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::remove::Request, + >, + ) -> 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("/vald.v1.Remove/Remove"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Remove", "Remove")); + self.inner.unary(req, path, codec).await + } + /** A method to remove an indexed vector based on timestamp. +*/ + pub async fn remove_by_timestamp( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::remove::TimestampRequest, + >, + ) -> 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( + "/vald.v1.Remove/RemoveByTimestamp", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Remove", "RemoveByTimestamp")); + self.inner.unary(req, path, codec).await + } + /** A method to remove multiple indexed vectors by bidirectional streaming. +*/ + pub async fn stream_remove( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::remove::Request, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamLocation, + >, + >, + 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( + "/vald.v1.Remove/StreamRemove", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Remove", "StreamRemove")); + self.inner.streaming(req, path, codec).await + } + /** A method to remove multiple indexed vectors in a single request. +*/ + pub async fn multi_remove( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::remove::MultiRequest, + >, + ) -> 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( + "/vald.v1.Remove/MultiRemove", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Remove", "MultiRemove")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod search_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 SearchClient { + inner: tonic::client::Grpc, + } + impl SearchClient { + /// 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 SearchClient + 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, + ) -> SearchClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + SearchClient::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 search( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::Request, + >, + ) -> 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("/vald.v1.Search/Search"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Search", "Search")); + self.inner.unary(req, path, codec).await + } + /** A method to search indexed vectors by ID. +*/ + pub async fn search_by_id( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::IdRequest, + >, + ) -> 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( + "/vald.v1.Search/SearchByID", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Search", "SearchByID")); + self.inner.unary(req, path, codec).await + } + /** A method to search indexed vectors by multiple vectors. +*/ + pub async fn stream_search( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::search::Request, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::search::StreamResponse, + >, + >, + 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( + "/vald.v1.Search/StreamSearch", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "StreamSearch")); + self.inner.streaming(req, path, codec).await + } + /** A method to search indexed vectors by multiple IDs. +*/ + pub async fn stream_search_by_id( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::search::IdRequest, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::search::StreamResponse, + >, + >, + 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( + "/vald.v1.Search/StreamSearchByID", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "StreamSearchByID")); + self.inner.streaming(req, path, codec).await + } + /** A method to search indexed vectors by multiple vectors in a single request. +*/ + pub async fn multi_search( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::MultiRequest, + >, + ) -> 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( + "/vald.v1.Search/MultiSearch", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "MultiSearch")); + self.inner.unary(req, path, codec).await + } + /** A method to search indexed vectors by multiple IDs in a single request. +*/ + pub async fn multi_search_by_id( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::MultiIdRequest, + >, + ) -> 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( + "/vald.v1.Search/MultiSearchByID", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "MultiSearchByID")); + self.inner.unary(req, path, codec).await + } + /** A method to linear search indexed vectors by a raw vector. +*/ + pub async fn linear_search( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::Request, + >, + ) -> 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( + "/vald.v1.Search/LinearSearch", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "LinearSearch")); + self.inner.unary(req, path, codec).await + } + /** A method to linear search indexed vectors by ID. +*/ + pub async fn linear_search_by_id( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::IdRequest, + >, + ) -> 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( + "/vald.v1.Search/LinearSearchByID", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "LinearSearchByID")); + self.inner.unary(req, path, codec).await + } + /** A method to linear search indexed vectors by multiple vectors. +*/ + pub async fn stream_linear_search( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::search::Request, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::search::StreamResponse, + >, + >, + 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( + "/vald.v1.Search/StreamLinearSearch", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "StreamLinearSearch")); + self.inner.streaming(req, path, codec).await + } + /** A method to linear search indexed vectors by multiple IDs. +*/ + pub async fn stream_linear_search_by_id( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::search::IdRequest, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::search::StreamResponse, + >, + >, + 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( + "/vald.v1.Search/StreamLinearSearchByID", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "StreamLinearSearchByID")); + self.inner.streaming(req, path, codec).await + } + /** A method to linear search indexed vectors by multiple vectors in a single + request. +*/ + pub async fn multi_linear_search( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::MultiRequest, + >, + ) -> 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( + "/vald.v1.Search/MultiLinearSearch", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "MultiLinearSearch")); + self.inner.unary(req, path, codec).await + } + /** A method to linear search indexed vectors by multiple IDs in a single + request. +*/ + pub async fn multi_linear_search_by_id( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::search::MultiIdRequest, + >, + ) -> 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( + "/vald.v1.Search/MultiLinearSearchByID", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Search", "MultiLinearSearchByID")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod update_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 UpdateClient { + inner: tonic::client::Grpc, + } + impl UpdateClient { + /// 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 UpdateClient + 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, + ) -> UpdateClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + UpdateClient::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 update( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::update::Request, + >, + ) -> 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("/vald.v1.Update/Update"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Update", "Update")); + self.inner.unary(req, path, codec).await + } + /** A method to update multiple indexed vectors by bidirectional streaming. +*/ + pub async fn stream_update( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::update::Request, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamLocation, + >, + >, + 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( + "/vald.v1.Update/StreamUpdate", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Update", "StreamUpdate")); + self.inner.streaming(req, path, codec).await + } + /** A method to update multiple indexed vectors in a single request. +*/ + pub async fn multi_update( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::update::MultiRequest, + >, + ) -> 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( + "/vald.v1.Update/MultiUpdate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Update", "MultiUpdate")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod upsert_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 UpsertClient { + inner: tonic::client::Grpc, + } + impl UpsertClient { + /// 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 UpsertClient + 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, + ) -> UpsertClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + UpsertClient::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< + super::super::super::payload::v1::upsert::Request, + >, + ) -> 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("/vald.v1.Upsert/Upsert"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("vald.v1.Upsert", "Upsert")); + self.inner.unary(req, path, codec).await + } + /** A method to insert/update multiple vectors by bidirectional streaming. +*/ + pub async fn stream_upsert( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::super::super::payload::v1::upsert::Request, + >, + ) -> std::result::Result< + tonic::Response< + tonic::codec::Streaming< + super::super::super::payload::v1::object::StreamLocation, + >, + >, + 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( + "/vald.v1.Upsert/StreamUpsert", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Upsert", "StreamUpsert")); + self.inner.streaming(req, path, codec).await + } + /** A method to insert/update multiple vectors in a single request. +*/ + pub async fn multi_upsert( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::payload::v1::upsert::MultiRequest, + >, + ) -> 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( + "/vald.v1.Upsert/MultiUpsert", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("vald.v1.Upsert", "MultiUpsert")); + self.inner.unary(req, path, codec).await + } + } +}