├── .github └── workflows │ └── ci.yml ├── .gitignore ├── CMakeLists.txt ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── build.rs ├── example ├── CMakeLists.txt ├── raw.cpp └── txn.cpp ├── include └── tikv_client.h ├── src ├── lib.rs └── tikv_client.cpp └── tikvcppConfig.cmake.in /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | branches: 4 | - master 5 | push: 6 | branches: 7 | - master 8 | 9 | name: CI 10 | 11 | jobs: 12 | build: 13 | name: build 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Rust Cache 18 | uses: Swatinem/rust-cache@v1.4.0 19 | - name: cmake build 20 | run: cmake -S . -B build && cmake --build build 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | build 3 | .vscode 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(tikvcpp VERSION 0.1.0) 4 | set (CMAKE_CXX_STANDARD 17) 5 | 6 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 7 | set(CARGO_CMD cargo build --verbose --target-dir=${CMAKE_CURRENT_BINARY_DIR}) 8 | set(TARGET_DIR "debug") 9 | else () 10 | set(CARGO_CMD cargo build --release --target-dir=${CMAKE_CURRENT_BINARY_DIR}) 11 | set(TARGET_DIR "release") 12 | endif () 13 | 14 | set(RUST_PART_LIB "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}/libtikvrust.a") 15 | set(RUST_PART_CXX "${CMAKE_CURRENT_BINARY_DIR}/cxxbridge/client-cpp/src/lib.rs.cc") 16 | set(RUST_PART_H "${CMAKE_CURRENT_BINARY_DIR}/cxxbridge/client-cpp/src/lib.rs.h") 17 | add_custom_command( 18 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml ${CMAKE_CURRENT_SOURCE_DIR}/src/lib.rs ${CMAKE_CURRENT_SOURCE_DIR}/build.rs 19 | OUTPUT ${RUST_PART_LIB} ${RUST_PART_CXX} ${RUST_PART_H} 20 | COMMAND CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} RUSTFLAGS="${RUST_FLAGS}" ${CARGO_CMD} 21 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 22 | ) 23 | 24 | include_directories( 25 | ${CMAKE_CURRENT_BINARY_DIR}/cxxbridge/client-cpp/src 26 | ${CMAKE_SOURCE_DIR}/include 27 | ) 28 | add_library(tikvcpp STATIC src/tikv_client.cpp ${RUST_PART_CXX}) 29 | set_target_properties(tikvcpp PROPERTIES PUBLIC_HEADER "${CMAKE_SOURCE_DIR}/include/tikv_client.h;${RUST_PART_H}") 30 | 31 | include(CMakePackageConfigHelpers) 32 | write_basic_package_version_file( 33 | tikvcppConfigVersion.cmake 34 | VERSION ${PACKAGE_VERSION} 35 | COMPATIBILITY AnyNewerVersion 36 | ) 37 | 38 | install(TARGETS tikvcpp 39 | EXPORT tikvcppTargets 40 | LIBRARY DESTINATION lib 41 | PUBLIC_HEADER DESTINATION include/tikv 42 | ) 43 | 44 | install(FILES ${RUST_PART_LIB} DESTINATION lib) 45 | 46 | install(EXPORT tikvcppTargets 47 | FILE tikvcppTargets.cmake 48 | NAMESPACE tikvcpp:: 49 | DESTINATION lib/cmake/tikvcpp 50 | ) 51 | 52 | configure_file(tikvcppConfig.cmake.in tikvcppConfig.cmake @ONLY) 53 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tikvcppConfig.cmake" 54 | "${CMAKE_CURRENT_BINARY_DIR}/tikvcppConfigVersion.cmake" 55 | DESTINATION lib/cmake/tikvcpp 56 | ) 57 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.20.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.0.2" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "anyhow" 31 | version = "1.0.72" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" 34 | 35 | [[package]] 36 | name = "async-recursion" 37 | version = "0.3.2" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" 40 | dependencies = [ 41 | "proc-macro2", 42 | "quote", 43 | "syn 1.0.109", 44 | ] 45 | 46 | [[package]] 47 | name = "async-stream" 48 | version = "0.3.5" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" 51 | dependencies = [ 52 | "async-stream-impl", 53 | "futures-core", 54 | "pin-project-lite", 55 | ] 56 | 57 | [[package]] 58 | name = "async-stream-impl" 59 | version = "0.3.5" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" 62 | dependencies = [ 63 | "proc-macro2", 64 | "quote", 65 | "syn 2.0.27", 66 | ] 67 | 68 | [[package]] 69 | name = "async-trait" 70 | version = "0.1.72" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" 73 | dependencies = [ 74 | "proc-macro2", 75 | "quote", 76 | "syn 2.0.27", 77 | ] 78 | 79 | [[package]] 80 | name = "atty" 81 | version = "0.2.14" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 84 | dependencies = [ 85 | "hermit-abi 0.1.19", 86 | "libc", 87 | "winapi", 88 | ] 89 | 90 | [[package]] 91 | name = "autocfg" 92 | version = "1.1.0" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 95 | 96 | [[package]] 97 | name = "axum" 98 | version = "0.6.19" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "a6a1de45611fdb535bfde7b7de4fd54f4fd2b17b1737c0a59b69bf9b92074b8c" 101 | dependencies = [ 102 | "async-trait", 103 | "axum-core", 104 | "bitflags 1.3.2", 105 | "bytes", 106 | "futures-util", 107 | "http", 108 | "http-body", 109 | "hyper", 110 | "itoa", 111 | "matchit", 112 | "memchr", 113 | "mime", 114 | "percent-encoding", 115 | "pin-project-lite", 116 | "rustversion", 117 | "serde", 118 | "sync_wrapper", 119 | "tower", 120 | "tower-layer", 121 | "tower-service", 122 | ] 123 | 124 | [[package]] 125 | name = "axum-core" 126 | version = "0.3.4" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" 129 | dependencies = [ 130 | "async-trait", 131 | "bytes", 132 | "futures-util", 133 | "http", 134 | "http-body", 135 | "mime", 136 | "rustversion", 137 | "tower-layer", 138 | "tower-service", 139 | ] 140 | 141 | [[package]] 142 | name = "backtrace" 143 | version = "0.3.68" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" 146 | dependencies = [ 147 | "addr2line", 148 | "cc", 149 | "cfg-if", 150 | "libc", 151 | "miniz_oxide", 152 | "object", 153 | "rustc-demangle", 154 | ] 155 | 156 | [[package]] 157 | name = "base64" 158 | version = "0.21.2" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" 161 | 162 | [[package]] 163 | name = "bitflags" 164 | version = "1.3.2" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 167 | 168 | [[package]] 169 | name = "bitflags" 170 | version = "2.3.3" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" 173 | 174 | [[package]] 175 | name = "bumpalo" 176 | version = "3.13.0" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" 179 | 180 | [[package]] 181 | name = "byteorder" 182 | version = "1.4.3" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 185 | 186 | [[package]] 187 | name = "bytes" 188 | version = "1.4.0" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 191 | 192 | [[package]] 193 | name = "cc" 194 | version = "1.0.79" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 197 | 198 | [[package]] 199 | name = "cfg-if" 200 | version = "1.0.0" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 203 | 204 | [[package]] 205 | name = "client-cpp" 206 | version = "0.1.0" 207 | dependencies = [ 208 | "anyhow", 209 | "cxx", 210 | "cxx-build", 211 | "env_logger", 212 | "futures", 213 | "log", 214 | "tikv-client", 215 | "tokio", 216 | ] 217 | 218 | [[package]] 219 | name = "codespan-reporting" 220 | version = "0.11.1" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 223 | dependencies = [ 224 | "termcolor", 225 | "unicode-width", 226 | ] 227 | 228 | [[package]] 229 | name = "core-foundation" 230 | version = "0.9.3" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 233 | dependencies = [ 234 | "core-foundation-sys", 235 | "libc", 236 | ] 237 | 238 | [[package]] 239 | name = "core-foundation-sys" 240 | version = "0.8.4" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 243 | 244 | [[package]] 245 | name = "cxx" 246 | version = "1.0.102" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "f68e12e817cb19eaab81aaec582b4052d07debd3c3c6b083b9d361db47c7dc9d" 249 | dependencies = [ 250 | "cc", 251 | "cxxbridge-flags", 252 | "cxxbridge-macro", 253 | "link-cplusplus", 254 | ] 255 | 256 | [[package]] 257 | name = "cxx-build" 258 | version = "1.0.102" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "e789217e4ab7cf8cc9ce82253180a9fe331f35f5d339f0ccfe0270b39433f397" 261 | dependencies = [ 262 | "cc", 263 | "codespan-reporting", 264 | "once_cell", 265 | "proc-macro2", 266 | "quote", 267 | "scratch", 268 | "syn 2.0.27", 269 | ] 270 | 271 | [[package]] 272 | name = "cxxbridge-flags" 273 | version = "1.0.102" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "78a19f4c80fd9ab6c882286fa865e92e07688f4387370a209508014ead8751d0" 276 | 277 | [[package]] 278 | name = "cxxbridge-macro" 279 | version = "1.0.102" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "b8fcfa71f66c8563c4fa9dd2bb68368d50267856f831ac5d85367e0805f9606c" 282 | dependencies = [ 283 | "proc-macro2", 284 | "quote", 285 | "syn 2.0.27", 286 | ] 287 | 288 | [[package]] 289 | name = "derive-new" 290 | version = "0.5.9" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" 293 | dependencies = [ 294 | "proc-macro2", 295 | "quote", 296 | "syn 1.0.109", 297 | ] 298 | 299 | [[package]] 300 | name = "either" 301 | version = "1.9.0" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" 304 | 305 | [[package]] 306 | name = "encoding_rs" 307 | version = "0.8.32" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 310 | dependencies = [ 311 | "cfg-if", 312 | ] 313 | 314 | [[package]] 315 | name = "env_logger" 316 | version = "0.8.4" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" 319 | dependencies = [ 320 | "atty", 321 | "humantime", 322 | "log", 323 | "regex", 324 | "termcolor", 325 | ] 326 | 327 | [[package]] 328 | name = "errno" 329 | version = "0.3.1" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 332 | dependencies = [ 333 | "errno-dragonfly", 334 | "libc", 335 | "windows-sys 0.48.0", 336 | ] 337 | 338 | [[package]] 339 | name = "errno-dragonfly" 340 | version = "0.1.2" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 343 | dependencies = [ 344 | "cc", 345 | "libc", 346 | ] 347 | 348 | [[package]] 349 | name = "fail" 350 | version = "0.4.0" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "3be3c61c59fdc91f5dbc3ea31ee8623122ce80057058be560654c5d410d181a6" 353 | dependencies = [ 354 | "lazy_static", 355 | "log", 356 | "rand 0.7.3", 357 | ] 358 | 359 | [[package]] 360 | name = "fastrand" 361 | version = "2.0.0" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" 364 | 365 | [[package]] 366 | name = "fnv" 367 | version = "1.0.7" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 370 | 371 | [[package]] 372 | name = "foreign-types" 373 | version = "0.3.2" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 376 | dependencies = [ 377 | "foreign-types-shared", 378 | ] 379 | 380 | [[package]] 381 | name = "foreign-types-shared" 382 | version = "0.1.1" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 385 | 386 | [[package]] 387 | name = "form_urlencoded" 388 | version = "1.2.0" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 391 | dependencies = [ 392 | "percent-encoding", 393 | ] 394 | 395 | [[package]] 396 | name = "futures" 397 | version = "0.3.28" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" 400 | dependencies = [ 401 | "futures-channel", 402 | "futures-core", 403 | "futures-executor", 404 | "futures-io", 405 | "futures-sink", 406 | "futures-task", 407 | "futures-util", 408 | ] 409 | 410 | [[package]] 411 | name = "futures-channel" 412 | version = "0.3.28" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 415 | dependencies = [ 416 | "futures-core", 417 | "futures-sink", 418 | ] 419 | 420 | [[package]] 421 | name = "futures-core" 422 | version = "0.3.28" 423 | source = "registry+https://github.com/rust-lang/crates.io-index" 424 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 425 | 426 | [[package]] 427 | name = "futures-executor" 428 | version = "0.3.28" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" 431 | dependencies = [ 432 | "futures-core", 433 | "futures-task", 434 | "futures-util", 435 | ] 436 | 437 | [[package]] 438 | name = "futures-io" 439 | version = "0.3.28" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" 442 | 443 | [[package]] 444 | name = "futures-macro" 445 | version = "0.3.28" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" 448 | dependencies = [ 449 | "proc-macro2", 450 | "quote", 451 | "syn 2.0.27", 452 | ] 453 | 454 | [[package]] 455 | name = "futures-sink" 456 | version = "0.3.28" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 459 | 460 | [[package]] 461 | name = "futures-task" 462 | version = "0.3.28" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 465 | 466 | [[package]] 467 | name = "futures-util" 468 | version = "0.3.28" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 471 | dependencies = [ 472 | "futures-channel", 473 | "futures-core", 474 | "futures-io", 475 | "futures-macro", 476 | "futures-sink", 477 | "futures-task", 478 | "memchr", 479 | "pin-project-lite", 480 | "pin-utils", 481 | "slab", 482 | ] 483 | 484 | [[package]] 485 | name = "getrandom" 486 | version = "0.1.16" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 489 | dependencies = [ 490 | "cfg-if", 491 | "libc", 492 | "wasi 0.9.0+wasi-snapshot-preview1", 493 | ] 494 | 495 | [[package]] 496 | name = "getrandom" 497 | version = "0.2.10" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" 500 | dependencies = [ 501 | "cfg-if", 502 | "libc", 503 | "wasi 0.11.0+wasi-snapshot-preview1", 504 | ] 505 | 506 | [[package]] 507 | name = "gimli" 508 | version = "0.27.3" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" 511 | 512 | [[package]] 513 | name = "h2" 514 | version = "0.3.20" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" 517 | dependencies = [ 518 | "bytes", 519 | "fnv", 520 | "futures-core", 521 | "futures-sink", 522 | "futures-util", 523 | "http", 524 | "indexmap", 525 | "slab", 526 | "tokio", 527 | "tokio-util", 528 | "tracing", 529 | ] 530 | 531 | [[package]] 532 | name = "hashbrown" 533 | version = "0.12.3" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 536 | 537 | [[package]] 538 | name = "hermit-abi" 539 | version = "0.1.19" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 542 | dependencies = [ 543 | "libc", 544 | ] 545 | 546 | [[package]] 547 | name = "hermit-abi" 548 | version = "0.3.2" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" 551 | 552 | [[package]] 553 | name = "hex" 554 | version = "0.4.3" 555 | source = "registry+https://github.com/rust-lang/crates.io-index" 556 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 557 | 558 | [[package]] 559 | name = "http" 560 | version = "0.2.9" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 563 | dependencies = [ 564 | "bytes", 565 | "fnv", 566 | "itoa", 567 | ] 568 | 569 | [[package]] 570 | name = "http-body" 571 | version = "0.4.5" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 574 | dependencies = [ 575 | "bytes", 576 | "http", 577 | "pin-project-lite", 578 | ] 579 | 580 | [[package]] 581 | name = "httparse" 582 | version = "1.8.0" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 585 | 586 | [[package]] 587 | name = "httpdate" 588 | version = "1.0.2" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 591 | 592 | [[package]] 593 | name = "humantime" 594 | version = "2.1.0" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 597 | 598 | [[package]] 599 | name = "hyper" 600 | version = "0.14.27" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 603 | dependencies = [ 604 | "bytes", 605 | "futures-channel", 606 | "futures-core", 607 | "futures-util", 608 | "h2", 609 | "http", 610 | "http-body", 611 | "httparse", 612 | "httpdate", 613 | "itoa", 614 | "pin-project-lite", 615 | "socket2", 616 | "tokio", 617 | "tower-service", 618 | "tracing", 619 | "want", 620 | ] 621 | 622 | [[package]] 623 | name = "hyper-timeout" 624 | version = "0.4.1" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" 627 | dependencies = [ 628 | "hyper", 629 | "pin-project-lite", 630 | "tokio", 631 | "tokio-io-timeout", 632 | ] 633 | 634 | [[package]] 635 | name = "hyper-tls" 636 | version = "0.5.0" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 639 | dependencies = [ 640 | "bytes", 641 | "hyper", 642 | "native-tls", 643 | "tokio", 644 | "tokio-native-tls", 645 | ] 646 | 647 | [[package]] 648 | name = "idna" 649 | version = "0.4.0" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 652 | dependencies = [ 653 | "unicode-bidi", 654 | "unicode-normalization", 655 | ] 656 | 657 | [[package]] 658 | name = "indexmap" 659 | version = "1.9.3" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 662 | dependencies = [ 663 | "autocfg", 664 | "hashbrown", 665 | ] 666 | 667 | [[package]] 668 | name = "io-lifetimes" 669 | version = "1.0.11" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" 672 | dependencies = [ 673 | "hermit-abi 0.3.2", 674 | "libc", 675 | "windows-sys 0.48.0", 676 | ] 677 | 678 | [[package]] 679 | name = "ipnet" 680 | version = "2.8.0" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" 683 | 684 | [[package]] 685 | name = "itertools" 686 | version = "0.10.5" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 689 | dependencies = [ 690 | "either", 691 | ] 692 | 693 | [[package]] 694 | name = "itoa" 695 | version = "1.0.9" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 698 | 699 | [[package]] 700 | name = "js-sys" 701 | version = "0.3.64" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 704 | dependencies = [ 705 | "wasm-bindgen", 706 | ] 707 | 708 | [[package]] 709 | name = "lazy_static" 710 | version = "1.4.0" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 713 | 714 | [[package]] 715 | name = "libc" 716 | version = "0.2.147" 717 | source = "registry+https://github.com/rust-lang/crates.io-index" 718 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 719 | 720 | [[package]] 721 | name = "link-cplusplus" 722 | version = "1.0.9" 723 | source = "registry+https://github.com/rust-lang/crates.io-index" 724 | checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" 725 | dependencies = [ 726 | "cc", 727 | ] 728 | 729 | [[package]] 730 | name = "linux-raw-sys" 731 | version = "0.1.4" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" 734 | 735 | [[package]] 736 | name = "linux-raw-sys" 737 | version = "0.4.3" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" 740 | 741 | [[package]] 742 | name = "lock_api" 743 | version = "0.4.10" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" 746 | dependencies = [ 747 | "autocfg", 748 | "scopeguard", 749 | ] 750 | 751 | [[package]] 752 | name = "log" 753 | version = "0.4.19" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 756 | 757 | [[package]] 758 | name = "matchit" 759 | version = "0.7.0" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" 762 | 763 | [[package]] 764 | name = "memchr" 765 | version = "2.5.0" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 768 | 769 | [[package]] 770 | name = "mime" 771 | version = "0.3.17" 772 | source = "registry+https://github.com/rust-lang/crates.io-index" 773 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 774 | 775 | [[package]] 776 | name = "miniz_oxide" 777 | version = "0.7.1" 778 | source = "registry+https://github.com/rust-lang/crates.io-index" 779 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 780 | dependencies = [ 781 | "adler", 782 | ] 783 | 784 | [[package]] 785 | name = "mio" 786 | version = "0.8.8" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 789 | dependencies = [ 790 | "libc", 791 | "wasi 0.11.0+wasi-snapshot-preview1", 792 | "windows-sys 0.48.0", 793 | ] 794 | 795 | [[package]] 796 | name = "native-tls" 797 | version = "0.2.11" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 800 | dependencies = [ 801 | "lazy_static", 802 | "libc", 803 | "log", 804 | "openssl", 805 | "openssl-probe", 806 | "openssl-sys", 807 | "schannel", 808 | "security-framework", 809 | "security-framework-sys", 810 | "tempfile", 811 | ] 812 | 813 | [[package]] 814 | name = "num_cpus" 815 | version = "1.16.0" 816 | source = "registry+https://github.com/rust-lang/crates.io-index" 817 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 818 | dependencies = [ 819 | "hermit-abi 0.3.2", 820 | "libc", 821 | ] 822 | 823 | [[package]] 824 | name = "object" 825 | version = "0.31.1" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" 828 | dependencies = [ 829 | "memchr", 830 | ] 831 | 832 | [[package]] 833 | name = "once_cell" 834 | version = "1.18.0" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 837 | 838 | [[package]] 839 | name = "openssl" 840 | version = "0.10.55" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" 843 | dependencies = [ 844 | "bitflags 1.3.2", 845 | "cfg-if", 846 | "foreign-types", 847 | "libc", 848 | "once_cell", 849 | "openssl-macros", 850 | "openssl-sys", 851 | ] 852 | 853 | [[package]] 854 | name = "openssl-macros" 855 | version = "0.1.1" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 858 | dependencies = [ 859 | "proc-macro2", 860 | "quote", 861 | "syn 2.0.27", 862 | ] 863 | 864 | [[package]] 865 | name = "openssl-probe" 866 | version = "0.1.5" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 869 | 870 | [[package]] 871 | name = "openssl-sys" 872 | version = "0.9.90" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" 875 | dependencies = [ 876 | "cc", 877 | "libc", 878 | "pkg-config", 879 | "vcpkg", 880 | ] 881 | 882 | [[package]] 883 | name = "parking_lot" 884 | version = "0.12.1" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 887 | dependencies = [ 888 | "lock_api", 889 | "parking_lot_core", 890 | ] 891 | 892 | [[package]] 893 | name = "parking_lot_core" 894 | version = "0.9.8" 895 | source = "registry+https://github.com/rust-lang/crates.io-index" 896 | checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" 897 | dependencies = [ 898 | "cfg-if", 899 | "libc", 900 | "redox_syscall", 901 | "smallvec", 902 | "windows-targets 0.48.1", 903 | ] 904 | 905 | [[package]] 906 | name = "percent-encoding" 907 | version = "2.3.0" 908 | source = "registry+https://github.com/rust-lang/crates.io-index" 909 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 910 | 911 | [[package]] 912 | name = "pin-project" 913 | version = "1.1.2" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" 916 | dependencies = [ 917 | "pin-project-internal", 918 | ] 919 | 920 | [[package]] 921 | name = "pin-project-internal" 922 | version = "1.1.2" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" 925 | dependencies = [ 926 | "proc-macro2", 927 | "quote", 928 | "syn 2.0.27", 929 | ] 930 | 931 | [[package]] 932 | name = "pin-project-lite" 933 | version = "0.2.10" 934 | source = "registry+https://github.com/rust-lang/crates.io-index" 935 | checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" 936 | 937 | [[package]] 938 | name = "pin-utils" 939 | version = "0.1.0" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 942 | 943 | [[package]] 944 | name = "pkg-config" 945 | version = "0.3.27" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" 948 | 949 | [[package]] 950 | name = "ppv-lite86" 951 | version = "0.2.17" 952 | source = "registry+https://github.com/rust-lang/crates.io-index" 953 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 954 | 955 | [[package]] 956 | name = "proc-macro2" 957 | version = "1.0.66" 958 | source = "registry+https://github.com/rust-lang/crates.io-index" 959 | checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 960 | dependencies = [ 961 | "unicode-ident", 962 | ] 963 | 964 | [[package]] 965 | name = "procfs" 966 | version = "0.14.2" 967 | source = "registry+https://github.com/rust-lang/crates.io-index" 968 | checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" 969 | dependencies = [ 970 | "bitflags 1.3.2", 971 | "byteorder", 972 | "hex", 973 | "lazy_static", 974 | "rustix 0.36.15", 975 | ] 976 | 977 | [[package]] 978 | name = "prometheus" 979 | version = "0.13.3" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" 982 | dependencies = [ 983 | "cfg-if", 984 | "fnv", 985 | "lazy_static", 986 | "libc", 987 | "memchr", 988 | "parking_lot", 989 | "procfs", 990 | "protobuf", 991 | "reqwest", 992 | "thiserror", 993 | ] 994 | 995 | [[package]] 996 | name = "prost" 997 | version = "0.11.9" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" 1000 | dependencies = [ 1001 | "bytes", 1002 | "prost-derive", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "prost-derive" 1007 | version = "0.11.9" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" 1010 | dependencies = [ 1011 | "anyhow", 1012 | "itertools", 1013 | "proc-macro2", 1014 | "quote", 1015 | "syn 1.0.109", 1016 | ] 1017 | 1018 | [[package]] 1019 | name = "protobuf" 1020 | version = "2.28.0" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" 1023 | 1024 | [[package]] 1025 | name = "quote" 1026 | version = "1.0.32" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" 1029 | dependencies = [ 1030 | "proc-macro2", 1031 | ] 1032 | 1033 | [[package]] 1034 | name = "rand" 1035 | version = "0.7.3" 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" 1037 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1038 | dependencies = [ 1039 | "getrandom 0.1.16", 1040 | "libc", 1041 | "rand_chacha 0.2.2", 1042 | "rand_core 0.5.1", 1043 | "rand_hc", 1044 | ] 1045 | 1046 | [[package]] 1047 | name = "rand" 1048 | version = "0.8.5" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1051 | dependencies = [ 1052 | "libc", 1053 | "rand_chacha 0.3.1", 1054 | "rand_core 0.6.4", 1055 | ] 1056 | 1057 | [[package]] 1058 | name = "rand_chacha" 1059 | version = "0.2.2" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1062 | dependencies = [ 1063 | "ppv-lite86", 1064 | "rand_core 0.5.1", 1065 | ] 1066 | 1067 | [[package]] 1068 | name = "rand_chacha" 1069 | version = "0.3.1" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1072 | dependencies = [ 1073 | "ppv-lite86", 1074 | "rand_core 0.6.4", 1075 | ] 1076 | 1077 | [[package]] 1078 | name = "rand_core" 1079 | version = "0.5.1" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1082 | dependencies = [ 1083 | "getrandom 0.1.16", 1084 | ] 1085 | 1086 | [[package]] 1087 | name = "rand_core" 1088 | version = "0.6.4" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1091 | dependencies = [ 1092 | "getrandom 0.2.10", 1093 | ] 1094 | 1095 | [[package]] 1096 | name = "rand_hc" 1097 | version = "0.2.0" 1098 | source = "registry+https://github.com/rust-lang/crates.io-index" 1099 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1100 | dependencies = [ 1101 | "rand_core 0.5.1", 1102 | ] 1103 | 1104 | [[package]] 1105 | name = "redox_syscall" 1106 | version = "0.3.5" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 1109 | dependencies = [ 1110 | "bitflags 1.3.2", 1111 | ] 1112 | 1113 | [[package]] 1114 | name = "regex" 1115 | version = "1.9.1" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" 1118 | dependencies = [ 1119 | "aho-corasick", 1120 | "memchr", 1121 | "regex-automata", 1122 | "regex-syntax", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "regex-automata" 1127 | version = "0.3.3" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" 1130 | dependencies = [ 1131 | "aho-corasick", 1132 | "memchr", 1133 | "regex-syntax", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "regex-syntax" 1138 | version = "0.7.4" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" 1141 | 1142 | [[package]] 1143 | name = "reqwest" 1144 | version = "0.11.18" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" 1147 | dependencies = [ 1148 | "base64", 1149 | "bytes", 1150 | "encoding_rs", 1151 | "futures-core", 1152 | "futures-util", 1153 | "h2", 1154 | "http", 1155 | "http-body", 1156 | "hyper", 1157 | "hyper-tls", 1158 | "ipnet", 1159 | "js-sys", 1160 | "log", 1161 | "mime", 1162 | "native-tls", 1163 | "once_cell", 1164 | "percent-encoding", 1165 | "pin-project-lite", 1166 | "serde", 1167 | "serde_json", 1168 | "serde_urlencoded", 1169 | "tokio", 1170 | "tokio-native-tls", 1171 | "tower-service", 1172 | "url", 1173 | "wasm-bindgen", 1174 | "wasm-bindgen-futures", 1175 | "web-sys", 1176 | "winreg", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "ring" 1181 | version = "0.16.20" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 1184 | dependencies = [ 1185 | "cc", 1186 | "libc", 1187 | "once_cell", 1188 | "spin", 1189 | "untrusted", 1190 | "web-sys", 1191 | "winapi", 1192 | ] 1193 | 1194 | [[package]] 1195 | name = "rustc-demangle" 1196 | version = "0.1.23" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 1199 | 1200 | [[package]] 1201 | name = "rustix" 1202 | version = "0.36.15" 1203 | source = "registry+https://github.com/rust-lang/crates.io-index" 1204 | checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" 1205 | dependencies = [ 1206 | "bitflags 1.3.2", 1207 | "errno", 1208 | "io-lifetimes", 1209 | "libc", 1210 | "linux-raw-sys 0.1.4", 1211 | "windows-sys 0.45.0", 1212 | ] 1213 | 1214 | [[package]] 1215 | name = "rustix" 1216 | version = "0.38.4" 1217 | source = "registry+https://github.com/rust-lang/crates.io-index" 1218 | checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" 1219 | dependencies = [ 1220 | "bitflags 2.3.3", 1221 | "errno", 1222 | "libc", 1223 | "linux-raw-sys 0.4.3", 1224 | "windows-sys 0.48.0", 1225 | ] 1226 | 1227 | [[package]] 1228 | name = "rustls" 1229 | version = "0.21.5" 1230 | source = "registry+https://github.com/rust-lang/crates.io-index" 1231 | checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" 1232 | dependencies = [ 1233 | "log", 1234 | "ring", 1235 | "rustls-webpki", 1236 | "sct", 1237 | ] 1238 | 1239 | [[package]] 1240 | name = "rustls-pemfile" 1241 | version = "1.0.3" 1242 | source = "registry+https://github.com/rust-lang/crates.io-index" 1243 | checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" 1244 | dependencies = [ 1245 | "base64", 1246 | ] 1247 | 1248 | [[package]] 1249 | name = "rustls-webpki" 1250 | version = "0.101.1" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" 1253 | dependencies = [ 1254 | "ring", 1255 | "untrusted", 1256 | ] 1257 | 1258 | [[package]] 1259 | name = "rustversion" 1260 | version = "1.0.14" 1261 | source = "registry+https://github.com/rust-lang/crates.io-index" 1262 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1263 | 1264 | [[package]] 1265 | name = "ryu" 1266 | version = "1.0.15" 1267 | source = "registry+https://github.com/rust-lang/crates.io-index" 1268 | checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" 1269 | 1270 | [[package]] 1271 | name = "schannel" 1272 | version = "0.1.22" 1273 | source = "registry+https://github.com/rust-lang/crates.io-index" 1274 | checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" 1275 | dependencies = [ 1276 | "windows-sys 0.48.0", 1277 | ] 1278 | 1279 | [[package]] 1280 | name = "scopeguard" 1281 | version = "1.2.0" 1282 | source = "registry+https://github.com/rust-lang/crates.io-index" 1283 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1284 | 1285 | [[package]] 1286 | name = "scratch" 1287 | version = "1.0.7" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" 1290 | 1291 | [[package]] 1292 | name = "sct" 1293 | version = "0.7.0" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" 1296 | dependencies = [ 1297 | "ring", 1298 | "untrusted", 1299 | ] 1300 | 1301 | [[package]] 1302 | name = "security-framework" 1303 | version = "2.9.2" 1304 | source = "registry+https://github.com/rust-lang/crates.io-index" 1305 | checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" 1306 | dependencies = [ 1307 | "bitflags 1.3.2", 1308 | "core-foundation", 1309 | "core-foundation-sys", 1310 | "libc", 1311 | "security-framework-sys", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "security-framework-sys" 1316 | version = "2.9.1" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" 1319 | dependencies = [ 1320 | "core-foundation-sys", 1321 | "libc", 1322 | ] 1323 | 1324 | [[package]] 1325 | name = "semver" 1326 | version = "1.0.18" 1327 | source = "registry+https://github.com/rust-lang/crates.io-index" 1328 | checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" 1329 | 1330 | [[package]] 1331 | name = "serde" 1332 | version = "1.0.175" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" 1335 | 1336 | [[package]] 1337 | name = "serde_derive" 1338 | version = "1.0.175" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" 1341 | dependencies = [ 1342 | "proc-macro2", 1343 | "quote", 1344 | "syn 2.0.27", 1345 | ] 1346 | 1347 | [[package]] 1348 | name = "serde_json" 1349 | version = "1.0.103" 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" 1351 | checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" 1352 | dependencies = [ 1353 | "itoa", 1354 | "ryu", 1355 | "serde", 1356 | ] 1357 | 1358 | [[package]] 1359 | name = "serde_urlencoded" 1360 | version = "0.7.1" 1361 | source = "registry+https://github.com/rust-lang/crates.io-index" 1362 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1363 | dependencies = [ 1364 | "form_urlencoded", 1365 | "itoa", 1366 | "ryu", 1367 | "serde", 1368 | ] 1369 | 1370 | [[package]] 1371 | name = "signal-hook-registry" 1372 | version = "1.4.1" 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" 1374 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1375 | dependencies = [ 1376 | "libc", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "slab" 1381 | version = "0.4.8" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 1384 | dependencies = [ 1385 | "autocfg", 1386 | ] 1387 | 1388 | [[package]] 1389 | name = "smallvec" 1390 | version = "1.11.0" 1391 | source = "registry+https://github.com/rust-lang/crates.io-index" 1392 | checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" 1393 | 1394 | [[package]] 1395 | name = "socket2" 1396 | version = "0.4.9" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 1399 | dependencies = [ 1400 | "libc", 1401 | "winapi", 1402 | ] 1403 | 1404 | [[package]] 1405 | name = "spin" 1406 | version = "0.5.2" 1407 | source = "registry+https://github.com/rust-lang/crates.io-index" 1408 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 1409 | 1410 | [[package]] 1411 | name = "syn" 1412 | version = "1.0.109" 1413 | source = "registry+https://github.com/rust-lang/crates.io-index" 1414 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1415 | dependencies = [ 1416 | "proc-macro2", 1417 | "quote", 1418 | "unicode-ident", 1419 | ] 1420 | 1421 | [[package]] 1422 | name = "syn" 1423 | version = "2.0.27" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" 1426 | dependencies = [ 1427 | "proc-macro2", 1428 | "quote", 1429 | "unicode-ident", 1430 | ] 1431 | 1432 | [[package]] 1433 | name = "sync_wrapper" 1434 | version = "0.1.2" 1435 | source = "registry+https://github.com/rust-lang/crates.io-index" 1436 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1437 | 1438 | [[package]] 1439 | name = "tempfile" 1440 | version = "3.7.0" 1441 | source = "registry+https://github.com/rust-lang/crates.io-index" 1442 | checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" 1443 | dependencies = [ 1444 | "cfg-if", 1445 | "fastrand", 1446 | "redox_syscall", 1447 | "rustix 0.38.4", 1448 | "windows-sys 0.48.0", 1449 | ] 1450 | 1451 | [[package]] 1452 | name = "termcolor" 1453 | version = "1.2.0" 1454 | source = "registry+https://github.com/rust-lang/crates.io-index" 1455 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 1456 | dependencies = [ 1457 | "winapi-util", 1458 | ] 1459 | 1460 | [[package]] 1461 | name = "thiserror" 1462 | version = "1.0.44" 1463 | source = "registry+https://github.com/rust-lang/crates.io-index" 1464 | checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" 1465 | dependencies = [ 1466 | "thiserror-impl", 1467 | ] 1468 | 1469 | [[package]] 1470 | name = "thiserror-impl" 1471 | version = "1.0.44" 1472 | source = "registry+https://github.com/rust-lang/crates.io-index" 1473 | checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" 1474 | dependencies = [ 1475 | "proc-macro2", 1476 | "quote", 1477 | "syn 2.0.27", 1478 | ] 1479 | 1480 | [[package]] 1481 | name = "tikv-client" 1482 | version = "0.2.0" 1483 | source = "git+https://github.com/tikv/client-rust.git?rev=abf22ba#abf22ba680f1b5bbdf8c716aa2d3ec03b6a3c146" 1484 | dependencies = [ 1485 | "async-recursion", 1486 | "async-trait", 1487 | "derive-new", 1488 | "either", 1489 | "fail", 1490 | "futures", 1491 | "lazy_static", 1492 | "log", 1493 | "pin-project", 1494 | "prometheus", 1495 | "prost", 1496 | "rand 0.8.5", 1497 | "regex", 1498 | "semver", 1499 | "serde", 1500 | "serde_derive", 1501 | "thiserror", 1502 | "tokio", 1503 | "tonic", 1504 | ] 1505 | 1506 | [[package]] 1507 | name = "tinyvec" 1508 | version = "1.6.0" 1509 | source = "registry+https://github.com/rust-lang/crates.io-index" 1510 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1511 | dependencies = [ 1512 | "tinyvec_macros", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "tinyvec_macros" 1517 | version = "0.1.1" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1520 | 1521 | [[package]] 1522 | name = "tokio" 1523 | version = "1.29.1" 1524 | source = "registry+https://github.com/rust-lang/crates.io-index" 1525 | checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" 1526 | dependencies = [ 1527 | "autocfg", 1528 | "backtrace", 1529 | "bytes", 1530 | "libc", 1531 | "mio", 1532 | "num_cpus", 1533 | "parking_lot", 1534 | "pin-project-lite", 1535 | "signal-hook-registry", 1536 | "socket2", 1537 | "tokio-macros", 1538 | "windows-sys 0.48.0", 1539 | ] 1540 | 1541 | [[package]] 1542 | name = "tokio-io-timeout" 1543 | version = "1.2.0" 1544 | source = "registry+https://github.com/rust-lang/crates.io-index" 1545 | checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" 1546 | dependencies = [ 1547 | "pin-project-lite", 1548 | "tokio", 1549 | ] 1550 | 1551 | [[package]] 1552 | name = "tokio-macros" 1553 | version = "2.1.0" 1554 | source = "registry+https://github.com/rust-lang/crates.io-index" 1555 | checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 1556 | dependencies = [ 1557 | "proc-macro2", 1558 | "quote", 1559 | "syn 2.0.27", 1560 | ] 1561 | 1562 | [[package]] 1563 | name = "tokio-native-tls" 1564 | version = "0.3.1" 1565 | source = "registry+https://github.com/rust-lang/crates.io-index" 1566 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1567 | dependencies = [ 1568 | "native-tls", 1569 | "tokio", 1570 | ] 1571 | 1572 | [[package]] 1573 | name = "tokio-rustls" 1574 | version = "0.24.1" 1575 | source = "registry+https://github.com/rust-lang/crates.io-index" 1576 | checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" 1577 | dependencies = [ 1578 | "rustls", 1579 | "tokio", 1580 | ] 1581 | 1582 | [[package]] 1583 | name = "tokio-stream" 1584 | version = "0.1.14" 1585 | source = "registry+https://github.com/rust-lang/crates.io-index" 1586 | checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" 1587 | dependencies = [ 1588 | "futures-core", 1589 | "pin-project-lite", 1590 | "tokio", 1591 | ] 1592 | 1593 | [[package]] 1594 | name = "tokio-util" 1595 | version = "0.7.8" 1596 | source = "registry+https://github.com/rust-lang/crates.io-index" 1597 | checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 1598 | dependencies = [ 1599 | "bytes", 1600 | "futures-core", 1601 | "futures-sink", 1602 | "pin-project-lite", 1603 | "tokio", 1604 | "tracing", 1605 | ] 1606 | 1607 | [[package]] 1608 | name = "tonic" 1609 | version = "0.9.2" 1610 | source = "registry+https://github.com/rust-lang/crates.io-index" 1611 | checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" 1612 | dependencies = [ 1613 | "async-stream", 1614 | "async-trait", 1615 | "axum", 1616 | "base64", 1617 | "bytes", 1618 | "futures-core", 1619 | "futures-util", 1620 | "h2", 1621 | "http", 1622 | "http-body", 1623 | "hyper", 1624 | "hyper-timeout", 1625 | "percent-encoding", 1626 | "pin-project", 1627 | "prost", 1628 | "rustls-pemfile", 1629 | "tokio", 1630 | "tokio-rustls", 1631 | "tokio-stream", 1632 | "tower", 1633 | "tower-layer", 1634 | "tower-service", 1635 | "tracing", 1636 | ] 1637 | 1638 | [[package]] 1639 | name = "tower" 1640 | version = "0.4.13" 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" 1642 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1643 | dependencies = [ 1644 | "futures-core", 1645 | "futures-util", 1646 | "indexmap", 1647 | "pin-project", 1648 | "pin-project-lite", 1649 | "rand 0.8.5", 1650 | "slab", 1651 | "tokio", 1652 | "tokio-util", 1653 | "tower-layer", 1654 | "tower-service", 1655 | "tracing", 1656 | ] 1657 | 1658 | [[package]] 1659 | name = "tower-layer" 1660 | version = "0.3.2" 1661 | source = "registry+https://github.com/rust-lang/crates.io-index" 1662 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1663 | 1664 | [[package]] 1665 | name = "tower-service" 1666 | version = "0.3.2" 1667 | source = "registry+https://github.com/rust-lang/crates.io-index" 1668 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1669 | 1670 | [[package]] 1671 | name = "tracing" 1672 | version = "0.1.37" 1673 | source = "registry+https://github.com/rust-lang/crates.io-index" 1674 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1675 | dependencies = [ 1676 | "cfg-if", 1677 | "pin-project-lite", 1678 | "tracing-attributes", 1679 | "tracing-core", 1680 | ] 1681 | 1682 | [[package]] 1683 | name = "tracing-attributes" 1684 | version = "0.1.26" 1685 | source = "registry+https://github.com/rust-lang/crates.io-index" 1686 | checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" 1687 | dependencies = [ 1688 | "proc-macro2", 1689 | "quote", 1690 | "syn 2.0.27", 1691 | ] 1692 | 1693 | [[package]] 1694 | name = "tracing-core" 1695 | version = "0.1.31" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 1698 | dependencies = [ 1699 | "once_cell", 1700 | ] 1701 | 1702 | [[package]] 1703 | name = "try-lock" 1704 | version = "0.2.4" 1705 | source = "registry+https://github.com/rust-lang/crates.io-index" 1706 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 1707 | 1708 | [[package]] 1709 | name = "unicode-bidi" 1710 | version = "0.3.13" 1711 | source = "registry+https://github.com/rust-lang/crates.io-index" 1712 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 1713 | 1714 | [[package]] 1715 | name = "unicode-ident" 1716 | version = "1.0.11" 1717 | source = "registry+https://github.com/rust-lang/crates.io-index" 1718 | checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" 1719 | 1720 | [[package]] 1721 | name = "unicode-normalization" 1722 | version = "0.1.22" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1725 | dependencies = [ 1726 | "tinyvec", 1727 | ] 1728 | 1729 | [[package]] 1730 | name = "unicode-width" 1731 | version = "0.1.10" 1732 | source = "registry+https://github.com/rust-lang/crates.io-index" 1733 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 1734 | 1735 | [[package]] 1736 | name = "untrusted" 1737 | version = "0.7.1" 1738 | source = "registry+https://github.com/rust-lang/crates.io-index" 1739 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 1740 | 1741 | [[package]] 1742 | name = "url" 1743 | version = "2.4.0" 1744 | source = "registry+https://github.com/rust-lang/crates.io-index" 1745 | checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" 1746 | dependencies = [ 1747 | "form_urlencoded", 1748 | "idna", 1749 | "percent-encoding", 1750 | ] 1751 | 1752 | [[package]] 1753 | name = "vcpkg" 1754 | version = "0.2.15" 1755 | source = "registry+https://github.com/rust-lang/crates.io-index" 1756 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1757 | 1758 | [[package]] 1759 | name = "want" 1760 | version = "0.3.1" 1761 | source = "registry+https://github.com/rust-lang/crates.io-index" 1762 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1763 | dependencies = [ 1764 | "try-lock", 1765 | ] 1766 | 1767 | [[package]] 1768 | name = "wasi" 1769 | version = "0.9.0+wasi-snapshot-preview1" 1770 | source = "registry+https://github.com/rust-lang/crates.io-index" 1771 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1772 | 1773 | [[package]] 1774 | name = "wasi" 1775 | version = "0.11.0+wasi-snapshot-preview1" 1776 | source = "registry+https://github.com/rust-lang/crates.io-index" 1777 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1778 | 1779 | [[package]] 1780 | name = "wasm-bindgen" 1781 | version = "0.2.87" 1782 | source = "registry+https://github.com/rust-lang/crates.io-index" 1783 | checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 1784 | dependencies = [ 1785 | "cfg-if", 1786 | "wasm-bindgen-macro", 1787 | ] 1788 | 1789 | [[package]] 1790 | name = "wasm-bindgen-backend" 1791 | version = "0.2.87" 1792 | source = "registry+https://github.com/rust-lang/crates.io-index" 1793 | checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 1794 | dependencies = [ 1795 | "bumpalo", 1796 | "log", 1797 | "once_cell", 1798 | "proc-macro2", 1799 | "quote", 1800 | "syn 2.0.27", 1801 | "wasm-bindgen-shared", 1802 | ] 1803 | 1804 | [[package]] 1805 | name = "wasm-bindgen-futures" 1806 | version = "0.4.37" 1807 | source = "registry+https://github.com/rust-lang/crates.io-index" 1808 | checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" 1809 | dependencies = [ 1810 | "cfg-if", 1811 | "js-sys", 1812 | "wasm-bindgen", 1813 | "web-sys", 1814 | ] 1815 | 1816 | [[package]] 1817 | name = "wasm-bindgen-macro" 1818 | version = "0.2.87" 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" 1820 | checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 1821 | dependencies = [ 1822 | "quote", 1823 | "wasm-bindgen-macro-support", 1824 | ] 1825 | 1826 | [[package]] 1827 | name = "wasm-bindgen-macro-support" 1828 | version = "0.2.87" 1829 | source = "registry+https://github.com/rust-lang/crates.io-index" 1830 | checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 1831 | dependencies = [ 1832 | "proc-macro2", 1833 | "quote", 1834 | "syn 2.0.27", 1835 | "wasm-bindgen-backend", 1836 | "wasm-bindgen-shared", 1837 | ] 1838 | 1839 | [[package]] 1840 | name = "wasm-bindgen-shared" 1841 | version = "0.2.87" 1842 | source = "registry+https://github.com/rust-lang/crates.io-index" 1843 | checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 1844 | 1845 | [[package]] 1846 | name = "web-sys" 1847 | version = "0.3.64" 1848 | source = "registry+https://github.com/rust-lang/crates.io-index" 1849 | checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" 1850 | dependencies = [ 1851 | "js-sys", 1852 | "wasm-bindgen", 1853 | ] 1854 | 1855 | [[package]] 1856 | name = "winapi" 1857 | version = "0.3.9" 1858 | source = "registry+https://github.com/rust-lang/crates.io-index" 1859 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1860 | dependencies = [ 1861 | "winapi-i686-pc-windows-gnu", 1862 | "winapi-x86_64-pc-windows-gnu", 1863 | ] 1864 | 1865 | [[package]] 1866 | name = "winapi-i686-pc-windows-gnu" 1867 | version = "0.4.0" 1868 | source = "registry+https://github.com/rust-lang/crates.io-index" 1869 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1870 | 1871 | [[package]] 1872 | name = "winapi-util" 1873 | version = "0.1.5" 1874 | source = "registry+https://github.com/rust-lang/crates.io-index" 1875 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1876 | dependencies = [ 1877 | "winapi", 1878 | ] 1879 | 1880 | [[package]] 1881 | name = "winapi-x86_64-pc-windows-gnu" 1882 | version = "0.4.0" 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" 1884 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1885 | 1886 | [[package]] 1887 | name = "windows-sys" 1888 | version = "0.45.0" 1889 | source = "registry+https://github.com/rust-lang/crates.io-index" 1890 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1891 | dependencies = [ 1892 | "windows-targets 0.42.2", 1893 | ] 1894 | 1895 | [[package]] 1896 | name = "windows-sys" 1897 | version = "0.48.0" 1898 | source = "registry+https://github.com/rust-lang/crates.io-index" 1899 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1900 | dependencies = [ 1901 | "windows-targets 0.48.1", 1902 | ] 1903 | 1904 | [[package]] 1905 | name = "windows-targets" 1906 | version = "0.42.2" 1907 | source = "registry+https://github.com/rust-lang/crates.io-index" 1908 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 1909 | dependencies = [ 1910 | "windows_aarch64_gnullvm 0.42.2", 1911 | "windows_aarch64_msvc 0.42.2", 1912 | "windows_i686_gnu 0.42.2", 1913 | "windows_i686_msvc 0.42.2", 1914 | "windows_x86_64_gnu 0.42.2", 1915 | "windows_x86_64_gnullvm 0.42.2", 1916 | "windows_x86_64_msvc 0.42.2", 1917 | ] 1918 | 1919 | [[package]] 1920 | name = "windows-targets" 1921 | version = "0.48.1" 1922 | source = "registry+https://github.com/rust-lang/crates.io-index" 1923 | checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" 1924 | dependencies = [ 1925 | "windows_aarch64_gnullvm 0.48.0", 1926 | "windows_aarch64_msvc 0.48.0", 1927 | "windows_i686_gnu 0.48.0", 1928 | "windows_i686_msvc 0.48.0", 1929 | "windows_x86_64_gnu 0.48.0", 1930 | "windows_x86_64_gnullvm 0.48.0", 1931 | "windows_x86_64_msvc 0.48.0", 1932 | ] 1933 | 1934 | [[package]] 1935 | name = "windows_aarch64_gnullvm" 1936 | version = "0.42.2" 1937 | source = "registry+https://github.com/rust-lang/crates.io-index" 1938 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 1939 | 1940 | [[package]] 1941 | name = "windows_aarch64_gnullvm" 1942 | version = "0.48.0" 1943 | source = "registry+https://github.com/rust-lang/crates.io-index" 1944 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 1945 | 1946 | [[package]] 1947 | name = "windows_aarch64_msvc" 1948 | version = "0.42.2" 1949 | source = "registry+https://github.com/rust-lang/crates.io-index" 1950 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 1951 | 1952 | [[package]] 1953 | name = "windows_aarch64_msvc" 1954 | version = "0.48.0" 1955 | source = "registry+https://github.com/rust-lang/crates.io-index" 1956 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1957 | 1958 | [[package]] 1959 | name = "windows_i686_gnu" 1960 | version = "0.42.2" 1961 | source = "registry+https://github.com/rust-lang/crates.io-index" 1962 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 1963 | 1964 | [[package]] 1965 | name = "windows_i686_gnu" 1966 | version = "0.48.0" 1967 | source = "registry+https://github.com/rust-lang/crates.io-index" 1968 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1969 | 1970 | [[package]] 1971 | name = "windows_i686_msvc" 1972 | version = "0.42.2" 1973 | source = "registry+https://github.com/rust-lang/crates.io-index" 1974 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 1975 | 1976 | [[package]] 1977 | name = "windows_i686_msvc" 1978 | version = "0.48.0" 1979 | source = "registry+https://github.com/rust-lang/crates.io-index" 1980 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1981 | 1982 | [[package]] 1983 | name = "windows_x86_64_gnu" 1984 | version = "0.42.2" 1985 | source = "registry+https://github.com/rust-lang/crates.io-index" 1986 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 1987 | 1988 | [[package]] 1989 | name = "windows_x86_64_gnu" 1990 | version = "0.48.0" 1991 | source = "registry+https://github.com/rust-lang/crates.io-index" 1992 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1993 | 1994 | [[package]] 1995 | name = "windows_x86_64_gnullvm" 1996 | version = "0.42.2" 1997 | source = "registry+https://github.com/rust-lang/crates.io-index" 1998 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 1999 | 2000 | [[package]] 2001 | name = "windows_x86_64_gnullvm" 2002 | version = "0.48.0" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 2005 | 2006 | [[package]] 2007 | name = "windows_x86_64_msvc" 2008 | version = "0.42.2" 2009 | source = "registry+https://github.com/rust-lang/crates.io-index" 2010 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 2011 | 2012 | [[package]] 2013 | name = "windows_x86_64_msvc" 2014 | version = "0.48.0" 2015 | source = "registry+https://github.com/rust-lang/crates.io-index" 2016 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 2017 | 2018 | [[package]] 2019 | name = "winreg" 2020 | version = "0.10.1" 2021 | source = "registry+https://github.com/rust-lang/crates.io-index" 2022 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 2023 | dependencies = [ 2024 | "winapi", 2025 | ] 2026 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-cpp" 3 | version = "0.1.0" 4 | authors = ["The TiKV Project Authors"] 5 | edition = "2018" 6 | 7 | [lib] 8 | name = "tikvrust" 9 | crate-type = ["staticlib"] 10 | 11 | [dependencies] 12 | anyhow = "1" 13 | cxx = "1.0.18" 14 | futures = "0.3" 15 | log = "0.4" 16 | env_logger = "0.8" 17 | tokio = { version = "1.28.2", features = ["full"] } 18 | tikv-client = { git = "https://github.com/tikv/client-rust.git", rev = "abf22ba" } 19 | 20 | [build-dependencies] 21 | cxx-build = "1.0.18" 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TiKV Client for C++ 2 | 3 | TiKV client for C++. So far, it only supports synchronous API. 4 | 5 | It's built on top of 6 | [TiKV Client in Rust](https://github.com/tikv/client-rust) via [cxx](https://github.com/dtolnay/cxx). 7 | 8 | This client is still in the stage of prove-of-concept and under heavy development. 9 | 10 | ## Prepare 11 | 12 | ```bash 13 | # install rust environment 14 | curl https://sh.rustup.rs -sSf | sh 15 | ``` 16 | 17 | ## Build 18 | 19 | ```bash 20 | ## compile in build directory 21 | cmake -S . -B build && cmake --build build 22 | ## install to /usr/local 23 | sudo cmake --install build 24 | ``` 25 | 26 | 27 | ## Run example 28 | 29 | ```bash 30 | # run with tikv-server 31 | tiup playground nightly 32 | 33 | cd examples && cmake -S . -B build && cmake --build build 34 | # run raw example 35 | ./build/raw 36 | ``` 37 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let _build = cxx_build::bridge("src/lib.rs"); 3 | 4 | println!("cargo:rerun-if-changed=src/lib.rs"); 5 | } 6 | -------------------------------------------------------------------------------- /example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(Example) 2 | cmake_minimum_required(VERSION 3.5) 3 | set (CMAKE_CXX_STANDARD 17) 4 | 5 | # using local repository 6 | find_package(tikvcpp 0.1.0) 7 | 8 | add_executable(raw raw.cpp) 9 | target_link_libraries(raw tikvcpp tikvrust pthread dl ssl crypto) 10 | add_executable(txn txn.cpp) 11 | target_link_libraries(txn tikvcpp tikvrust pthread dl ssl crypto) 12 | -------------------------------------------------------------------------------- /example/raw.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. 2 | 3 | #include 4 | #include 5 | 6 | int main() { 7 | auto client = tikv_client::RawKVClient({"127.0.0.1:2379"}); 8 | 9 | const std::uint32_t kTimeoutMs = 10; 10 | client.put("k1", "v1", kTimeoutMs); 11 | 12 | auto val = client.get("k1",kTimeoutMs); 13 | if (val) { 14 | std::cout << "get key: \n(k1:" << *val << ")" << std::endl; 15 | } else { 16 | std::cout << "key not found" << std::endl; 17 | } 18 | 19 | client.batch_put({{"k2","v2"},{"k3","v3"},{"k4","v4"},{"k5","v5"}}, kTimeoutMs); 20 | 21 | const std::uint32_t kLimit = 20; 22 | // scan [k1,k6), limit 20, timeout 10ms 23 | auto kv_pairs = client.scan("k1","k6", kLimit ,kTimeoutMs); 24 | std::cout<<"scan[\"k1\",\"k6\"):"<key << ": " << iter->value << ") "; 27 | } 28 | std::cout << std::endl; 29 | 30 | // delete [k3,k5), so [k1,k6) should be [k1,k3) + [k5,k6) 31 | std::cout<<"scan[\"k1\",\"k6\") after delete:"<key << ": " << iter->value << ") "; 36 | } 37 | std::cout << std::endl; 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /example/txn.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. 2 | 3 | #include 4 | #include 5 | 6 | int main() { 7 | auto client = tikv_client::TransactionClient({"127.0.0.1:2379"}); 8 | auto txn = client.begin(); 9 | 10 | txn.put("k1", "v2"); 11 | 12 | auto val = txn.get("k1"); 13 | if (val) { 14 | std::cout << "get key k1:" << *val << std::endl; 15 | } else { 16 | std::cout << "key not found" << std::endl; 17 | } 18 | 19 | auto kv_pairs = txn.scan("k1", Bound::Included, "", Bound::Unbounded, 10); 20 | for (auto iter = kv_pairs.begin(); iter != kv_pairs.end(); ++iter) { 21 | std::cout << "scan:" << iter->key << ": " << iter->value << std::endl; 22 | } 23 | 24 | txn.commit(); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /include/tikv_client.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. 2 | 3 | #ifndef _TIKV_CLIENT_H_ 4 | #define _TIKV_CLIENT_H_ 5 | 6 | #include "lib.rs.h" 7 | #include 8 | #include 9 | 10 | namespace tikv_client { 11 | 12 | struct KvPair final { 13 | std::string key; 14 | std::string value; 15 | 16 | KvPair(std::string &&key, std::string &&value); 17 | ffi::KvPair to_ffi(); 18 | }; 19 | 20 | class Transaction { 21 | public: 22 | Transaction(::rust::cxxbridge1::Box txn); 23 | std::optional get(const std::string &key); 24 | std::optional get_for_update(const std::string &key); 25 | std::vector batch_get(const std::vector &keys); 26 | std::vector batch_get_for_update(const std::vector &keys); 27 | std::vector scan(const std::string &start, Bound start_bound, const std::string &end, Bound end_bound, std::uint32_t limit); 28 | std::vector scan_keys(const std::string &start, Bound start_bound, const std::string &end, Bound end_bound, std::uint32_t limit); 29 | void put(const std::string &key, const std::string &value); 30 | void batch_put(const std::vector &kvs); 31 | void remove(const std::string &key); 32 | void commit(); 33 | private: 34 | ::rust::cxxbridge1::Box _txn; 35 | }; 36 | 37 | class TransactionClient { 38 | public: 39 | TransactionClient(const std::vector &pd_endpoints); 40 | Transaction begin(); 41 | Transaction begin_pessimistic(); 42 | private: 43 | ::rust::cxxbridge1::Box _client; 44 | }; 45 | 46 | class RawKVClient { 47 | public: 48 | RawKVClient(const std::vector &pd_endpoints); 49 | std::optional get(const std::string &key,const std::uint64_t timeout); 50 | void put(const std::string &key, const std::string &value, const std::uint64_t timeout); 51 | void batch_put(const std::vector &kvs, const std::uint64_t timeout); 52 | void remove(const std::string &key, const std::uint64_t timeout); 53 | void remove_range(const std::string &start_key, const std::string &end_key, const std::uint64_t timeout); 54 | std::vector scan(const std::string &startKey, const std::string &endKey, std::uint32_t limit, const std::uint64_t timeout); 55 | 56 | private: 57 | ::rust::cxxbridge1::Box _client; 58 | }; 59 | 60 | } // namespace tikv_client 61 | 62 | #endif //_TIKV_CLIENT_H_ 63 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. 2 | 3 | use core::panic; 4 | use std::ops; 5 | 6 | use anyhow::Result; 7 | use cxx::{CxxString, CxxVector}; 8 | use futures::executor::block_on; 9 | use tokio::{ 10 | runtime::Runtime, 11 | time::{timeout, Duration}, 12 | }; 13 | 14 | use self::ffi::*; 15 | 16 | #[cxx::bridge] 17 | mod ffi { 18 | struct Key { 19 | key: Vec, 20 | } 21 | 22 | #[namespace = "ffi"] 23 | struct KvPair { 24 | key: Vec, 25 | value: Vec, 26 | } 27 | 28 | struct OptionalValue { 29 | is_none: bool, 30 | value: Vec, 31 | } 32 | 33 | enum Bound { 34 | Included, 35 | Excluded, 36 | Unbounded, 37 | } 38 | 39 | #[namespace = "tikv_client_glue"] 40 | extern "Rust" { 41 | type TransactionClient; 42 | type Transaction; 43 | type RawKVClient; 44 | 45 | fn raw_client_new(pd_endpoints: &CxxVector) -> Result>; 46 | 47 | fn raw_get(client: &RawKVClient, key: &CxxString, timeout_ms: u64) 48 | -> Result; 49 | 50 | fn raw_put( 51 | cli: &RawKVClient, 52 | key: &CxxString, 53 | val: &CxxString, 54 | timeout_ms: u64, 55 | ) -> Result<()>; 56 | 57 | fn raw_scan( 58 | cli: &RawKVClient, 59 | start: &CxxString, 60 | end: &CxxString, 61 | limit: u32, 62 | timeout_ms: u64, 63 | ) -> Result>; 64 | 65 | fn raw_delete(cli: &RawKVClient, key: &CxxString, timeout_ms: u64) -> Result<()>; 66 | 67 | fn raw_delete_range( 68 | cli: &RawKVClient, 69 | startKey: &CxxString, 70 | endKey: &CxxString, 71 | timeout_ms: u64, 72 | ) -> Result<()>; 73 | 74 | fn raw_batch_put( 75 | cli: &RawKVClient, 76 | pairs: &CxxVector, 77 | timeout_ms: u64, 78 | ) -> Result<()>; 79 | 80 | fn transaction_client_new( 81 | pd_endpoints: &CxxVector, 82 | ) -> Result>; 83 | 84 | fn transaction_client_begin(client: &TransactionClient) -> Result>; 85 | 86 | fn transaction_client_begin_pessimistic( 87 | client: &TransactionClient, 88 | ) -> Result>; 89 | 90 | fn transaction_get(transaction: &mut Transaction, key: &CxxString) 91 | -> Result; 92 | 93 | fn transaction_get_for_update( 94 | transaction: &mut Transaction, 95 | key: &CxxString, 96 | ) -> Result; 97 | 98 | fn transaction_batch_get( 99 | transaction: &mut Transaction, 100 | keys: &CxxVector, 101 | ) -> Result>; 102 | 103 | fn transaction_batch_get_for_update( 104 | transaction: &mut Transaction, 105 | keys: &CxxVector, 106 | ) -> Result>; 107 | 108 | fn transaction_scan( 109 | transaction: &mut Transaction, 110 | start: &CxxString, 111 | start_bound: Bound, 112 | end: &CxxString, 113 | end_bound: Bound, 114 | limit: u32, 115 | ) -> Result>; 116 | 117 | fn transaction_scan_keys( 118 | transaction: &mut Transaction, 119 | start: &CxxString, 120 | start_bound: Bound, 121 | end: &CxxString, 122 | end_bound: Bound, 123 | limit: u32, 124 | ) -> Result>; 125 | 126 | fn transaction_put( 127 | transaction: &mut Transaction, 128 | key: &CxxString, 129 | val: &CxxString, 130 | ) -> Result<()>; 131 | 132 | fn transaction_delete(transaction: &mut Transaction, key: &CxxString) -> Result<()>; 133 | 134 | fn transaction_commit(transaction: &mut Transaction) -> Result<()>; 135 | } 136 | } 137 | 138 | #[repr(transparent)] 139 | struct TransactionClient { 140 | inner: tikv_client::TransactionClient, 141 | } 142 | 143 | struct RawKVClient { 144 | pub rt: tokio::runtime::Runtime, 145 | inner: tikv_client::RawClient, 146 | } 147 | 148 | #[repr(transparent)] 149 | struct Transaction { 150 | inner: tikv_client::Transaction, 151 | } 152 | 153 | fn raw_client_new(pd_endpoints: &CxxVector) -> Result> { 154 | env_logger::builder() 155 | .filter_level(log::LevelFilter::Info) 156 | .init(); 157 | let runtime = Runtime::new().unwrap(); 158 | 159 | let pd_endpoints = pd_endpoints 160 | .iter() 161 | .map(|str| str.to_str().map(ToOwned::to_owned)) 162 | .collect::, _>>()?; 163 | 164 | Ok(Box::new(RawKVClient { 165 | inner: runtime.block_on(tikv_client::RawClient::new(pd_endpoints))?, 166 | rt: runtime, 167 | })) 168 | } 169 | 170 | fn transaction_client_new(pd_endpoints: &CxxVector) -> Result> { 171 | env_logger::init(); 172 | 173 | let pd_endpoints = pd_endpoints 174 | .iter() 175 | .map(|str| str.to_str().map(ToOwned::to_owned)) 176 | .collect::, _>>()?; 177 | 178 | Ok(Box::new(TransactionClient { 179 | inner: block_on(tikv_client::TransactionClient::new(pd_endpoints))?, 180 | })) 181 | } 182 | 183 | fn transaction_client_begin(client: &TransactionClient) -> Result> { 184 | Ok(Box::new(Transaction { 185 | inner: block_on(client.inner.begin_optimistic())?, 186 | })) 187 | } 188 | 189 | fn transaction_client_begin_pessimistic(client: &TransactionClient) -> Result> { 190 | Ok(Box::new(Transaction { 191 | inner: block_on(client.inner.begin_pessimistic())?, 192 | })) 193 | } 194 | 195 | fn raw_get(cli: &RawKVClient, key: &CxxString, timeout_ms: u64) -> Result { 196 | cli.rt.block_on(async { 197 | let result = timeout( 198 | Duration::from_millis(timeout_ms), 199 | cli.inner.get(key.as_bytes().to_vec()), 200 | ) 201 | .await??; 202 | match result { 203 | Some(value) => Ok(OptionalValue { 204 | is_none: false, 205 | value, 206 | }), 207 | None => Ok(OptionalValue { 208 | is_none: true, 209 | value: Vec::new(), 210 | }), 211 | } 212 | }) 213 | } 214 | 215 | fn raw_put(cli: &RawKVClient, key: &CxxString, val: &CxxString, timeout_ms: u64) -> Result<()> { 216 | cli.rt.block_on(async { 217 | timeout( 218 | Duration::from_millis(timeout_ms), 219 | cli.inner 220 | .put(key.as_bytes().to_vec(), val.as_bytes().to_vec()), 221 | ) 222 | .await??; 223 | Ok(()) 224 | }) 225 | } 226 | 227 | fn raw_scan( 228 | cli: &RawKVClient, 229 | start: &CxxString, 230 | end: &CxxString, 231 | limit: u32, 232 | timeout_ms: u64, 233 | ) -> Result> { 234 | cli.rt.block_on(async { 235 | let rg = to_bound_range(start, Bound::Included, end, Bound::Excluded); 236 | let result = 237 | timeout(Duration::from_millis(timeout_ms), cli.inner.scan(rg, limit)).await??; 238 | let pairs = result 239 | .into_iter() 240 | .map(|tikv_client::KvPair(key, value)| KvPair { 241 | key: key.into(), 242 | value, 243 | }) 244 | .collect(); 245 | Ok(pairs) 246 | }) 247 | } 248 | 249 | fn raw_delete(cli: &RawKVClient, key: &CxxString, timeout_ms: u64) -> Result<()> { 250 | cli.rt.block_on(async { 251 | timeout( 252 | Duration::from_millis(timeout_ms), 253 | cli.inner.delete(key.as_bytes().to_vec()), 254 | ) 255 | .await??; 256 | Ok(()) 257 | }) 258 | } 259 | 260 | fn raw_delete_range( 261 | cli: &RawKVClient, 262 | start_key: &CxxString, 263 | end_key: &CxxString, 264 | timeout_ms: u64, 265 | ) -> Result<()> { 266 | cli.rt.block_on(async { 267 | let rg = to_bound_range(start_key, Bound::Included, end_key, Bound::Excluded); 268 | timeout( 269 | Duration::from_millis(timeout_ms), 270 | cli.inner.delete_range(rg), 271 | ) 272 | .await??; 273 | Ok(()) 274 | }) 275 | } 276 | 277 | fn raw_batch_put(cli: &RawKVClient, pairs: &CxxVector, timeout_ms: u64) -> Result<()> { 278 | cli.rt.block_on(async { 279 | let tikv_pairs: Vec = pairs 280 | .iter() 281 | .map(|KvPair { key, value }| -> tikv_client::KvPair { 282 | tikv_client::KvPair(key.to_vec().into(), value.to_vec()) 283 | }) 284 | .collect(); 285 | timeout( 286 | Duration::from_millis(timeout_ms), 287 | cli.inner.batch_put(tikv_pairs), 288 | ) 289 | .await??; 290 | Ok(()) 291 | }) 292 | } 293 | 294 | fn transaction_get(transaction: &mut Transaction, key: &CxxString) -> Result { 295 | match block_on(transaction.inner.get(key.as_bytes().to_vec()))? { 296 | Some(value) => Ok(OptionalValue { 297 | is_none: false, 298 | value, 299 | }), 300 | None => Ok(OptionalValue { 301 | is_none: true, 302 | value: Vec::new(), 303 | }), 304 | } 305 | } 306 | 307 | fn transaction_get_for_update( 308 | transaction: &mut Transaction, 309 | key: &CxxString, 310 | ) -> Result { 311 | match block_on(transaction.inner.get_for_update(key.as_bytes().to_vec()))? { 312 | Some(value) => Ok(OptionalValue { 313 | is_none: false, 314 | value, 315 | }), 316 | None => Ok(OptionalValue { 317 | is_none: true, 318 | value: Vec::new(), 319 | }), 320 | } 321 | } 322 | 323 | fn transaction_batch_get( 324 | transaction: &mut Transaction, 325 | keys: &CxxVector, 326 | ) -> Result> { 327 | let keys = keys.iter().map(|key| key.as_bytes().to_vec()); 328 | let kv_pairs = block_on(transaction.inner.batch_get(keys))? 329 | .map(|tikv_client::KvPair(key, value)| KvPair { 330 | key: key.into(), 331 | value, 332 | }) 333 | .collect(); 334 | Ok(kv_pairs) 335 | } 336 | 337 | fn transaction_batch_get_for_update( 338 | _transaction: &mut Transaction, 339 | _keys: &CxxVector, 340 | ) -> Result> { 341 | // let keys = keys.iter().map(|key| key.as_bytes().to_vec()); 342 | // let kv_pairs = block_on(transaction.inner.batch_get_for_update(keys))? 343 | // .map(|tikv_client::KvPair(key, value)| KvPair { 344 | // key: key.into(), 345 | // value, 346 | // }) 347 | // .collect(); 348 | // Ok(kv_pairs) 349 | unimplemented!("batch_get_for_update is not working properly so far.") 350 | } 351 | 352 | fn transaction_scan( 353 | transaction: &mut Transaction, 354 | start: &CxxString, 355 | start_bound: Bound, 356 | end: &CxxString, 357 | end_bound: Bound, 358 | limit: u32, 359 | ) -> Result> { 360 | let range = to_bound_range(start, start_bound, end, end_bound); 361 | let kv_pairs = block_on(transaction.inner.scan(range, limit))? 362 | .map(|tikv_client::KvPair(key, value)| KvPair { 363 | key: key.into(), 364 | value, 365 | }) 366 | .collect(); 367 | Ok(kv_pairs) 368 | } 369 | 370 | fn transaction_scan_keys( 371 | transaction: &mut Transaction, 372 | start: &CxxString, 373 | start_bound: Bound, 374 | end: &CxxString, 375 | end_bound: Bound, 376 | limit: u32, 377 | ) -> Result> { 378 | let range = to_bound_range(start, start_bound, end, end_bound); 379 | let keys = block_on(transaction.inner.scan_keys(range, limit))? 380 | .map(|key| Key { key: key.into() }) 381 | .collect(); 382 | Ok(keys) 383 | } 384 | 385 | fn transaction_put(transaction: &mut Transaction, key: &CxxString, val: &CxxString) -> Result<()> { 386 | block_on( 387 | transaction 388 | .inner 389 | .put(key.as_bytes().to_vec(), val.as_bytes().to_vec()), 390 | )?; 391 | Ok(()) 392 | } 393 | 394 | fn transaction_delete(transaction: &mut Transaction, key: &CxxString) -> Result<()> { 395 | block_on(transaction.inner.delete(key.as_bytes().to_vec()))?; 396 | Ok(()) 397 | } 398 | 399 | fn transaction_commit(transaction: &mut Transaction) -> Result<()> { 400 | block_on(transaction.inner.commit())?; 401 | Ok(()) 402 | } 403 | 404 | fn to_bound_range( 405 | start: &CxxString, 406 | start_bound: Bound, 407 | end: &CxxString, 408 | end_bound: Bound, 409 | ) -> tikv_client::BoundRange { 410 | let start_bound = match start_bound { 411 | Bound::Included => ops::Bound::Included(start.as_bytes().to_vec()), 412 | Bound::Excluded => ops::Bound::Excluded(start.as_bytes().to_vec()), 413 | Bound::Unbounded => ops::Bound::Unbounded, 414 | _ => panic!("unexpected bound"), 415 | }; 416 | let end_bound = match end_bound { 417 | Bound::Included => ops::Bound::Included(end.as_bytes().to_vec()), 418 | Bound::Excluded => ops::Bound::Excluded(end.as_bytes().to_vec()), 419 | Bound::Unbounded => ops::Bound::Unbounded, 420 | _ => panic!("unexpected bound"), 421 | }; 422 | tikv_client::BoundRange::from((start_bound, end_bound)) 423 | } 424 | -------------------------------------------------------------------------------- /src/tikv_client.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. 2 | 3 | #include "tikv_client.h" 4 | 5 | using namespace std; 6 | using ::rust::cxxbridge1::Box; 7 | 8 | namespace tikv_client { 9 | 10 | KvPair::KvPair(std::string &&key, std::string &&value) 11 | : key(std::move(key)) 12 | , value(std::move(value)) 13 | {} 14 | 15 | ffi::KvPair KvPair::to_ffi() { 16 | ffi::KvPair f_pair; 17 | f_pair.key.reserve(key.size()); 18 | for (const auto &c : this->key) { 19 | f_pair.key.emplace_back(static_cast(c)); 20 | } 21 | f_pair.value.reserve(value.size()); 22 | for (const auto &c : this->value) { 23 | f_pair.value.emplace_back(static_cast(c)); 24 | } 25 | return f_pair; 26 | } 27 | 28 | TransactionClient::TransactionClient(const std::vector &pd_endpoints): 29 | _client(tikv_client_glue::transaction_client_new(pd_endpoints)) {} 30 | 31 | RawKVClient::RawKVClient(const std::vector &pd_endpoints): 32 | _client(tikv_client_glue::raw_client_new(pd_endpoints)) {} 33 | 34 | std::optional RawKVClient::get(const std::string &key, const std::uint64_t timeout) { 35 | auto val = tikv_client_glue::raw_get(*_client,key,timeout); 36 | if (val.is_none) { 37 | return std::nullopt; 38 | } else { 39 | return std::string{val.value.begin(), val.value.end()}; 40 | } 41 | } 42 | 43 | void RawKVClient::put(const std::string &key, const std::string &value, const std::uint64_t timeout) { 44 | tikv_client_glue::raw_put(*_client,key,value,timeout); 45 | } 46 | 47 | void RawKVClient::batch_put(const std::vector &kv_pairs, const std::uint64_t timeout) { 48 | std::vector pairs; 49 | pairs.reserve(kv_pairs.size()); 50 | for (auto pair: kv_pairs) { 51 | pairs.emplace_back(pair.to_ffi()); 52 | } 53 | tikv_client_glue::raw_batch_put(*_client,pairs,timeout); 54 | } 55 | 56 | std::vector RawKVClient::scan(const std::string &startKey, const std::string &endKey, std::uint32_t limit, const std::uint64_t timeout){ 57 | auto kv_pairs = tikv_client_glue::raw_scan(*_client,startKey,endKey,limit,timeout); 58 | std::vector result; 59 | result.reserve(kv_pairs.size()); 60 | for (auto iter = kv_pairs.begin(); iter != kv_pairs.end(); ++iter) { 61 | result.emplace_back( 62 | std::string{(iter->key).begin(), (iter->key).end()}, 63 | std::string{(iter->value).begin(), (iter->value).end()} 64 | ); 65 | } 66 | return result; 67 | } 68 | 69 | void RawKVClient::remove(const std::string &key, const std::uint64_t timeout) { 70 | tikv_client_glue::raw_delete(*_client,key,timeout); 71 | } 72 | 73 | void RawKVClient::remove_range(const std::string &start_key,const std::string &end_key, const std::uint64_t timeout) { 74 | tikv_client_glue::raw_delete_range(*_client,start_key,end_key,timeout); 75 | } 76 | 77 | Transaction TransactionClient::begin() { 78 | return Transaction(transaction_client_begin(*_client)); 79 | } 80 | 81 | Transaction TransactionClient::begin_pessimistic() { 82 | return Transaction(transaction_client_begin_pessimistic(*_client)); 83 | } 84 | 85 | 86 | Transaction::Transaction(Box txn) : _txn(std::move(txn)) {} 87 | 88 | std::optional Transaction::get(const std::string &key) { 89 | auto val = transaction_get(*_txn, key); 90 | if (val.is_none) { 91 | return std::nullopt; 92 | } else { 93 | return std::string{val.value.begin(), val.value.end()}; 94 | } 95 | } 96 | 97 | std::optional Transaction::get_for_update(const std::string &key) { 98 | auto val = transaction_get_for_update(*_txn, key); 99 | if (val.is_none) { 100 | return std::nullopt; 101 | } else { 102 | return std::string{val.value.begin(), val.value.end()}; 103 | } 104 | } 105 | 106 | std::vector Transaction::batch_get(const std::vector &keys) { 107 | auto kv_pairs = transaction_batch_get(*_txn, keys); 108 | std::vector result; 109 | result.reserve(kv_pairs.size()); 110 | for (auto iter = kv_pairs.begin(); iter != kv_pairs.end(); ++iter) { 111 | result.emplace_back( 112 | std::string{(iter->key).begin(), (iter->key).end()}, 113 | std::string{(iter->value).begin(), (iter->value).end()} 114 | ); 115 | } 116 | return result; 117 | } 118 | 119 | std::vector Transaction::batch_get_for_update(const std::vector &keys) { 120 | auto kv_pairs = transaction_batch_get_for_update(*_txn, keys); 121 | std::vector result; 122 | result.reserve(kv_pairs.size()); 123 | for (auto iter = kv_pairs.begin(); iter != kv_pairs.end(); ++iter) { 124 | result.emplace_back( 125 | std::string{(iter->key).begin(), (iter->key).end()}, 126 | std::string{(iter->value).begin(), (iter->value).end()} 127 | ); 128 | } 129 | return result; 130 | } 131 | 132 | 133 | std::vector Transaction::scan(const std::string &start, Bound start_bound, const std::string &end, Bound end_bound, std::uint32_t limit) { 134 | auto kv_pairs = transaction_scan(*_txn, start, start_bound, end, end_bound, limit); 135 | std::vector result; 136 | result.reserve(kv_pairs.size()); 137 | for (auto iter = kv_pairs.begin(); iter != kv_pairs.end(); ++iter) { 138 | result.emplace_back( 139 | std::string{(iter->key).begin(), (iter->key).end()}, 140 | std::string{(iter->value).begin(), (iter->value).end()} 141 | ); 142 | } 143 | return result; 144 | } 145 | 146 | std::vector Transaction::scan_keys(const std::string &start, Bound start_bound, const std::string &end, Bound end_bound, std::uint32_t limit) { 147 | auto keys = transaction_scan_keys(*_txn, start, start_bound, end, end_bound, limit); 148 | std::vector result; 149 | result.reserve(keys.size()); 150 | for (auto iter = keys.begin(); iter != keys.end(); ++iter) { 151 | result.emplace_back(std::string{(iter->key).begin(), (iter->key).end()}); 152 | } 153 | return result; 154 | } 155 | 156 | void Transaction::put(const std::string &key, const std::string &value) { 157 | transaction_put(*_txn, key, value); 158 | } 159 | 160 | void Transaction::batch_put(const std::vector &kvs) { 161 | for (auto iter = kvs.begin(); iter != kvs.end(); ++iter) { 162 | transaction_put(*_txn, iter->key, iter->value); 163 | } 164 | } 165 | 166 | void Transaction::remove(const std::string &key) { 167 | transaction_delete(*_txn, key); 168 | } 169 | 170 | void Transaction::commit() { 171 | transaction_commit(*_txn); 172 | } 173 | 174 | } 175 | -------------------------------------------------------------------------------- /tikvcppConfig.cmake.in: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | 3 | include("${CMAKE_CURRENT_LIST_DIR}/tikvcppTargets.cmake") 4 | --------------------------------------------------------------------------------