├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE.md ├── README.md ├── src └── lib.rs └── tests └── integration-test.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /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.24.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler2" 16 | version = "2.0.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.4.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 25 | 26 | [[package]] 27 | name = "backtrace" 28 | version = "0.3.74" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" 31 | dependencies = [ 32 | "addr2line", 33 | "cfg-if", 34 | "libc", 35 | "miniz_oxide", 36 | "object", 37 | "rustc-demangle", 38 | "windows-targets 0.52.6", 39 | ] 40 | 41 | [[package]] 42 | name = "base64" 43 | version = "0.21.7" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 46 | 47 | [[package]] 48 | name = "bitflags" 49 | version = "1.3.2" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 52 | 53 | [[package]] 54 | name = "bitflags" 55 | version = "2.6.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 58 | 59 | [[package]] 60 | name = "bumpalo" 61 | version = "3.16.0" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 64 | 65 | [[package]] 66 | name = "bytes" 67 | version = "1.8.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" 70 | 71 | [[package]] 72 | name = "cc" 73 | version = "1.1.37" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" 76 | dependencies = [ 77 | "shlex", 78 | ] 79 | 80 | [[package]] 81 | name = "cfg-if" 82 | version = "1.0.0" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 85 | 86 | [[package]] 87 | name = "core-foundation" 88 | version = "0.9.4" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 91 | dependencies = [ 92 | "core-foundation-sys", 93 | "libc", 94 | ] 95 | 96 | [[package]] 97 | name = "core-foundation-sys" 98 | version = "0.8.7" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 101 | 102 | [[package]] 103 | name = "displaydoc" 104 | version = "0.2.5" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 107 | dependencies = [ 108 | "proc-macro2", 109 | "quote", 110 | "syn", 111 | ] 112 | 113 | [[package]] 114 | name = "encoding_rs" 115 | version = "0.8.35" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 118 | dependencies = [ 119 | "cfg-if", 120 | ] 121 | 122 | [[package]] 123 | name = "equivalent" 124 | version = "1.0.1" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 127 | 128 | [[package]] 129 | name = "errno" 130 | version = "0.3.9" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 133 | dependencies = [ 134 | "libc", 135 | "windows-sys 0.52.0", 136 | ] 137 | 138 | [[package]] 139 | name = "fastrand" 140 | version = "2.2.0" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" 143 | 144 | [[package]] 145 | name = "fnv" 146 | version = "1.0.7" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 149 | 150 | [[package]] 151 | name = "foreign-types" 152 | version = "0.3.2" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 155 | dependencies = [ 156 | "foreign-types-shared", 157 | ] 158 | 159 | [[package]] 160 | name = "foreign-types-shared" 161 | version = "0.1.1" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 164 | 165 | [[package]] 166 | name = "form_urlencoded" 167 | version = "1.2.1" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 170 | dependencies = [ 171 | "percent-encoding", 172 | ] 173 | 174 | [[package]] 175 | name = "futures-channel" 176 | version = "0.3.31" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 179 | dependencies = [ 180 | "futures-core", 181 | ] 182 | 183 | [[package]] 184 | name = "futures-core" 185 | version = "0.3.31" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 188 | 189 | [[package]] 190 | name = "futures-sink" 191 | version = "0.3.31" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 194 | 195 | [[package]] 196 | name = "futures-task" 197 | version = "0.3.31" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 200 | 201 | [[package]] 202 | name = "futures-util" 203 | version = "0.3.31" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 206 | dependencies = [ 207 | "futures-core", 208 | "futures-task", 209 | "pin-project-lite", 210 | "pin-utils", 211 | ] 212 | 213 | [[package]] 214 | name = "gimli" 215 | version = "0.31.1" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 218 | 219 | [[package]] 220 | name = "h2" 221 | version = "0.3.26" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" 224 | dependencies = [ 225 | "bytes", 226 | "fnv", 227 | "futures-core", 228 | "futures-sink", 229 | "futures-util", 230 | "http", 231 | "indexmap", 232 | "slab", 233 | "tokio", 234 | "tokio-util", 235 | "tracing", 236 | ] 237 | 238 | [[package]] 239 | name = "hashbrown" 240 | version = "0.15.1" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" 243 | 244 | [[package]] 245 | name = "hermit-abi" 246 | version = "0.3.9" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 249 | 250 | [[package]] 251 | name = "http" 252 | version = "0.2.12" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" 255 | dependencies = [ 256 | "bytes", 257 | "fnv", 258 | "itoa", 259 | ] 260 | 261 | [[package]] 262 | name = "http-body" 263 | version = "0.4.6" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" 266 | dependencies = [ 267 | "bytes", 268 | "http", 269 | "pin-project-lite", 270 | ] 271 | 272 | [[package]] 273 | name = "httparse" 274 | version = "1.9.5" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" 277 | 278 | [[package]] 279 | name = "httpdate" 280 | version = "1.0.3" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 283 | 284 | [[package]] 285 | name = "hyper" 286 | version = "0.14.31" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" 289 | dependencies = [ 290 | "bytes", 291 | "futures-channel", 292 | "futures-core", 293 | "futures-util", 294 | "h2", 295 | "http", 296 | "http-body", 297 | "httparse", 298 | "httpdate", 299 | "itoa", 300 | "pin-project-lite", 301 | "socket2", 302 | "tokio", 303 | "tower-service", 304 | "tracing", 305 | "want", 306 | ] 307 | 308 | [[package]] 309 | name = "hyper-tls" 310 | version = "0.5.0" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 313 | dependencies = [ 314 | "bytes", 315 | "hyper", 316 | "native-tls", 317 | "tokio", 318 | "tokio-native-tls", 319 | ] 320 | 321 | [[package]] 322 | name = "icu_collections" 323 | version = "1.5.0" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" 326 | dependencies = [ 327 | "displaydoc", 328 | "yoke", 329 | "zerofrom", 330 | "zerovec", 331 | ] 332 | 333 | [[package]] 334 | name = "icu_locid" 335 | version = "1.5.0" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" 338 | dependencies = [ 339 | "displaydoc", 340 | "litemap", 341 | "tinystr", 342 | "writeable", 343 | "zerovec", 344 | ] 345 | 346 | [[package]] 347 | name = "icu_locid_transform" 348 | version = "1.5.0" 349 | source = "registry+https://github.com/rust-lang/crates.io-index" 350 | checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" 351 | dependencies = [ 352 | "displaydoc", 353 | "icu_locid", 354 | "icu_locid_transform_data", 355 | "icu_provider", 356 | "tinystr", 357 | "zerovec", 358 | ] 359 | 360 | [[package]] 361 | name = "icu_locid_transform_data" 362 | version = "1.5.0" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" 365 | 366 | [[package]] 367 | name = "icu_normalizer" 368 | version = "1.5.0" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" 371 | dependencies = [ 372 | "displaydoc", 373 | "icu_collections", 374 | "icu_normalizer_data", 375 | "icu_properties", 376 | "icu_provider", 377 | "smallvec", 378 | "utf16_iter", 379 | "utf8_iter", 380 | "write16", 381 | "zerovec", 382 | ] 383 | 384 | [[package]] 385 | name = "icu_normalizer_data" 386 | version = "1.5.0" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" 389 | 390 | [[package]] 391 | name = "icu_properties" 392 | version = "1.5.1" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" 395 | dependencies = [ 396 | "displaydoc", 397 | "icu_collections", 398 | "icu_locid_transform", 399 | "icu_properties_data", 400 | "icu_provider", 401 | "tinystr", 402 | "zerovec", 403 | ] 404 | 405 | [[package]] 406 | name = "icu_properties_data" 407 | version = "1.5.0" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" 410 | 411 | [[package]] 412 | name = "icu_provider" 413 | version = "1.5.0" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" 416 | dependencies = [ 417 | "displaydoc", 418 | "icu_locid", 419 | "icu_provider_macros", 420 | "stable_deref_trait", 421 | "tinystr", 422 | "writeable", 423 | "yoke", 424 | "zerofrom", 425 | "zerovec", 426 | ] 427 | 428 | [[package]] 429 | name = "icu_provider_macros" 430 | version = "1.5.0" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" 433 | dependencies = [ 434 | "proc-macro2", 435 | "quote", 436 | "syn", 437 | ] 438 | 439 | [[package]] 440 | name = "idna" 441 | version = "1.0.3" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" 444 | dependencies = [ 445 | "idna_adapter", 446 | "smallvec", 447 | "utf8_iter", 448 | ] 449 | 450 | [[package]] 451 | name = "idna_adapter" 452 | version = "1.2.0" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" 455 | dependencies = [ 456 | "icu_normalizer", 457 | "icu_properties", 458 | ] 459 | 460 | [[package]] 461 | name = "indexmap" 462 | version = "2.6.0" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" 465 | dependencies = [ 466 | "equivalent", 467 | "hashbrown", 468 | ] 469 | 470 | [[package]] 471 | name = "ipapi" 472 | version = "0.1.0" 473 | dependencies = [ 474 | "reqwest", 475 | "serde", 476 | "serde_json", 477 | "tokio", 478 | ] 479 | 480 | [[package]] 481 | name = "ipnet" 482 | version = "2.10.1" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" 485 | 486 | [[package]] 487 | name = "itoa" 488 | version = "1.0.11" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 491 | 492 | [[package]] 493 | name = "js-sys" 494 | version = "0.3.72" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" 497 | dependencies = [ 498 | "wasm-bindgen", 499 | ] 500 | 501 | [[package]] 502 | name = "libc" 503 | version = "0.2.162" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" 506 | 507 | [[package]] 508 | name = "linux-raw-sys" 509 | version = "0.4.14" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 512 | 513 | [[package]] 514 | name = "litemap" 515 | version = "0.7.3" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" 518 | 519 | [[package]] 520 | name = "lock_api" 521 | version = "0.4.12" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 524 | dependencies = [ 525 | "autocfg", 526 | "scopeguard", 527 | ] 528 | 529 | [[package]] 530 | name = "log" 531 | version = "0.4.22" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 534 | 535 | [[package]] 536 | name = "memchr" 537 | version = "2.7.4" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 540 | 541 | [[package]] 542 | name = "mime" 543 | version = "0.3.17" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 546 | 547 | [[package]] 548 | name = "miniz_oxide" 549 | version = "0.8.0" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" 552 | dependencies = [ 553 | "adler2", 554 | ] 555 | 556 | [[package]] 557 | name = "mio" 558 | version = "1.0.2" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" 561 | dependencies = [ 562 | "hermit-abi", 563 | "libc", 564 | "wasi", 565 | "windows-sys 0.52.0", 566 | ] 567 | 568 | [[package]] 569 | name = "native-tls" 570 | version = "0.2.12" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" 573 | dependencies = [ 574 | "libc", 575 | "log", 576 | "openssl", 577 | "openssl-probe", 578 | "openssl-sys", 579 | "schannel", 580 | "security-framework", 581 | "security-framework-sys", 582 | "tempfile", 583 | ] 584 | 585 | [[package]] 586 | name = "object" 587 | version = "0.36.5" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" 590 | dependencies = [ 591 | "memchr", 592 | ] 593 | 594 | [[package]] 595 | name = "once_cell" 596 | version = "1.20.2" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" 599 | 600 | [[package]] 601 | name = "openssl" 602 | version = "0.10.68" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" 605 | dependencies = [ 606 | "bitflags 2.6.0", 607 | "cfg-if", 608 | "foreign-types", 609 | "libc", 610 | "once_cell", 611 | "openssl-macros", 612 | "openssl-sys", 613 | ] 614 | 615 | [[package]] 616 | name = "openssl-macros" 617 | version = "0.1.1" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 620 | dependencies = [ 621 | "proc-macro2", 622 | "quote", 623 | "syn", 624 | ] 625 | 626 | [[package]] 627 | name = "openssl-probe" 628 | version = "0.1.5" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 631 | 632 | [[package]] 633 | name = "openssl-sys" 634 | version = "0.9.104" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" 637 | dependencies = [ 638 | "cc", 639 | "libc", 640 | "pkg-config", 641 | "vcpkg", 642 | ] 643 | 644 | [[package]] 645 | name = "parking_lot" 646 | version = "0.12.3" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 649 | dependencies = [ 650 | "lock_api", 651 | "parking_lot_core", 652 | ] 653 | 654 | [[package]] 655 | name = "parking_lot_core" 656 | version = "0.9.10" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 659 | dependencies = [ 660 | "cfg-if", 661 | "libc", 662 | "redox_syscall", 663 | "smallvec", 664 | "windows-targets 0.52.6", 665 | ] 666 | 667 | [[package]] 668 | name = "percent-encoding" 669 | version = "2.3.1" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 672 | 673 | [[package]] 674 | name = "pin-project-lite" 675 | version = "0.2.15" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" 678 | 679 | [[package]] 680 | name = "pin-utils" 681 | version = "0.1.0" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 684 | 685 | [[package]] 686 | name = "pkg-config" 687 | version = "0.3.31" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" 690 | 691 | [[package]] 692 | name = "proc-macro2" 693 | version = "1.0.89" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" 696 | dependencies = [ 697 | "unicode-ident", 698 | ] 699 | 700 | [[package]] 701 | name = "quote" 702 | version = "1.0.37" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 705 | dependencies = [ 706 | "proc-macro2", 707 | ] 708 | 709 | [[package]] 710 | name = "redox_syscall" 711 | version = "0.5.7" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" 714 | dependencies = [ 715 | "bitflags 2.6.0", 716 | ] 717 | 718 | [[package]] 719 | name = "reqwest" 720 | version = "0.11.27" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" 723 | dependencies = [ 724 | "base64", 725 | "bytes", 726 | "encoding_rs", 727 | "futures-core", 728 | "futures-util", 729 | "h2", 730 | "http", 731 | "http-body", 732 | "hyper", 733 | "hyper-tls", 734 | "ipnet", 735 | "js-sys", 736 | "log", 737 | "mime", 738 | "native-tls", 739 | "once_cell", 740 | "percent-encoding", 741 | "pin-project-lite", 742 | "rustls-pemfile", 743 | "serde", 744 | "serde_json", 745 | "serde_urlencoded", 746 | "sync_wrapper", 747 | "system-configuration", 748 | "tokio", 749 | "tokio-native-tls", 750 | "tower-service", 751 | "url", 752 | "wasm-bindgen", 753 | "wasm-bindgen-futures", 754 | "web-sys", 755 | "winreg", 756 | ] 757 | 758 | [[package]] 759 | name = "rustc-demangle" 760 | version = "0.1.24" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 763 | 764 | [[package]] 765 | name = "rustix" 766 | version = "0.38.40" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" 769 | dependencies = [ 770 | "bitflags 2.6.0", 771 | "errno", 772 | "libc", 773 | "linux-raw-sys", 774 | "windows-sys 0.52.0", 775 | ] 776 | 777 | [[package]] 778 | name = "rustls-pemfile" 779 | version = "1.0.4" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" 782 | dependencies = [ 783 | "base64", 784 | ] 785 | 786 | [[package]] 787 | name = "ryu" 788 | version = "1.0.18" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 791 | 792 | [[package]] 793 | name = "schannel" 794 | version = "0.1.26" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" 797 | dependencies = [ 798 | "windows-sys 0.59.0", 799 | ] 800 | 801 | [[package]] 802 | name = "scopeguard" 803 | version = "1.2.0" 804 | source = "registry+https://github.com/rust-lang/crates.io-index" 805 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 806 | 807 | [[package]] 808 | name = "security-framework" 809 | version = "2.11.1" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 812 | dependencies = [ 813 | "bitflags 2.6.0", 814 | "core-foundation", 815 | "core-foundation-sys", 816 | "libc", 817 | "security-framework-sys", 818 | ] 819 | 820 | [[package]] 821 | name = "security-framework-sys" 822 | version = "2.12.1" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" 825 | dependencies = [ 826 | "core-foundation-sys", 827 | "libc", 828 | ] 829 | 830 | [[package]] 831 | name = "serde" 832 | version = "1.0.214" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" 835 | dependencies = [ 836 | "serde_derive", 837 | ] 838 | 839 | [[package]] 840 | name = "serde_derive" 841 | version = "1.0.214" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" 844 | dependencies = [ 845 | "proc-macro2", 846 | "quote", 847 | "syn", 848 | ] 849 | 850 | [[package]] 851 | name = "serde_json" 852 | version = "1.0.132" 853 | source = "registry+https://github.com/rust-lang/crates.io-index" 854 | checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" 855 | dependencies = [ 856 | "itoa", 857 | "memchr", 858 | "ryu", 859 | "serde", 860 | ] 861 | 862 | [[package]] 863 | name = "serde_urlencoded" 864 | version = "0.7.1" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 867 | dependencies = [ 868 | "form_urlencoded", 869 | "itoa", 870 | "ryu", 871 | "serde", 872 | ] 873 | 874 | [[package]] 875 | name = "shlex" 876 | version = "1.3.0" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 879 | 880 | [[package]] 881 | name = "signal-hook-registry" 882 | version = "1.4.2" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 885 | dependencies = [ 886 | "libc", 887 | ] 888 | 889 | [[package]] 890 | name = "slab" 891 | version = "0.4.9" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 894 | dependencies = [ 895 | "autocfg", 896 | ] 897 | 898 | [[package]] 899 | name = "smallvec" 900 | version = "1.13.2" 901 | source = "registry+https://github.com/rust-lang/crates.io-index" 902 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 903 | 904 | [[package]] 905 | name = "socket2" 906 | version = "0.5.7" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 909 | dependencies = [ 910 | "libc", 911 | "windows-sys 0.52.0", 912 | ] 913 | 914 | [[package]] 915 | name = "stable_deref_trait" 916 | version = "1.2.0" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 919 | 920 | [[package]] 921 | name = "syn" 922 | version = "2.0.87" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" 925 | dependencies = [ 926 | "proc-macro2", 927 | "quote", 928 | "unicode-ident", 929 | ] 930 | 931 | [[package]] 932 | name = "sync_wrapper" 933 | version = "0.1.2" 934 | source = "registry+https://github.com/rust-lang/crates.io-index" 935 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 936 | 937 | [[package]] 938 | name = "synstructure" 939 | version = "0.13.1" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" 942 | dependencies = [ 943 | "proc-macro2", 944 | "quote", 945 | "syn", 946 | ] 947 | 948 | [[package]] 949 | name = "system-configuration" 950 | version = "0.5.1" 951 | source = "registry+https://github.com/rust-lang/crates.io-index" 952 | checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" 953 | dependencies = [ 954 | "bitflags 1.3.2", 955 | "core-foundation", 956 | "system-configuration-sys", 957 | ] 958 | 959 | [[package]] 960 | name = "system-configuration-sys" 961 | version = "0.5.0" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" 964 | dependencies = [ 965 | "core-foundation-sys", 966 | "libc", 967 | ] 968 | 969 | [[package]] 970 | name = "tempfile" 971 | version = "3.14.0" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" 974 | dependencies = [ 975 | "cfg-if", 976 | "fastrand", 977 | "once_cell", 978 | "rustix", 979 | "windows-sys 0.59.0", 980 | ] 981 | 982 | [[package]] 983 | name = "tinystr" 984 | version = "0.7.6" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" 987 | dependencies = [ 988 | "displaydoc", 989 | "zerovec", 990 | ] 991 | 992 | [[package]] 993 | name = "tokio" 994 | version = "1.41.1" 995 | source = "registry+https://github.com/rust-lang/crates.io-index" 996 | checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" 997 | dependencies = [ 998 | "backtrace", 999 | "bytes", 1000 | "libc", 1001 | "mio", 1002 | "parking_lot", 1003 | "pin-project-lite", 1004 | "signal-hook-registry", 1005 | "socket2", 1006 | "tokio-macros", 1007 | "windows-sys 0.52.0", 1008 | ] 1009 | 1010 | [[package]] 1011 | name = "tokio-macros" 1012 | version = "2.4.0" 1013 | source = "registry+https://github.com/rust-lang/crates.io-index" 1014 | checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" 1015 | dependencies = [ 1016 | "proc-macro2", 1017 | "quote", 1018 | "syn", 1019 | ] 1020 | 1021 | [[package]] 1022 | name = "tokio-native-tls" 1023 | version = "0.3.1" 1024 | source = "registry+https://github.com/rust-lang/crates.io-index" 1025 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1026 | dependencies = [ 1027 | "native-tls", 1028 | "tokio", 1029 | ] 1030 | 1031 | [[package]] 1032 | name = "tokio-util" 1033 | version = "0.7.12" 1034 | source = "registry+https://github.com/rust-lang/crates.io-index" 1035 | checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" 1036 | dependencies = [ 1037 | "bytes", 1038 | "futures-core", 1039 | "futures-sink", 1040 | "pin-project-lite", 1041 | "tokio", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "tower-service" 1046 | version = "0.3.3" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1049 | 1050 | [[package]] 1051 | name = "tracing" 1052 | version = "0.1.40" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1055 | dependencies = [ 1056 | "pin-project-lite", 1057 | "tracing-core", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "tracing-core" 1062 | version = "0.1.32" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1065 | dependencies = [ 1066 | "once_cell", 1067 | ] 1068 | 1069 | [[package]] 1070 | name = "try-lock" 1071 | version = "0.2.5" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1074 | 1075 | [[package]] 1076 | name = "unicode-ident" 1077 | version = "1.0.13" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" 1080 | 1081 | [[package]] 1082 | name = "url" 1083 | version = "2.5.3" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" 1086 | dependencies = [ 1087 | "form_urlencoded", 1088 | "idna", 1089 | "percent-encoding", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "utf16_iter" 1094 | version = "1.0.5" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" 1097 | 1098 | [[package]] 1099 | name = "utf8_iter" 1100 | version = "1.0.4" 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" 1102 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 1103 | 1104 | [[package]] 1105 | name = "vcpkg" 1106 | version = "0.2.15" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1109 | 1110 | [[package]] 1111 | name = "want" 1112 | version = "0.3.1" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1115 | dependencies = [ 1116 | "try-lock", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "wasi" 1121 | version = "0.11.0+wasi-snapshot-preview1" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1124 | 1125 | [[package]] 1126 | name = "wasm-bindgen" 1127 | version = "0.2.95" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" 1130 | dependencies = [ 1131 | "cfg-if", 1132 | "once_cell", 1133 | "wasm-bindgen-macro", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "wasm-bindgen-backend" 1138 | version = "0.2.95" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" 1141 | dependencies = [ 1142 | "bumpalo", 1143 | "log", 1144 | "once_cell", 1145 | "proc-macro2", 1146 | "quote", 1147 | "syn", 1148 | "wasm-bindgen-shared", 1149 | ] 1150 | 1151 | [[package]] 1152 | name = "wasm-bindgen-futures" 1153 | version = "0.4.45" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" 1156 | dependencies = [ 1157 | "cfg-if", 1158 | "js-sys", 1159 | "wasm-bindgen", 1160 | "web-sys", 1161 | ] 1162 | 1163 | [[package]] 1164 | name = "wasm-bindgen-macro" 1165 | version = "0.2.95" 1166 | source = "registry+https://github.com/rust-lang/crates.io-index" 1167 | checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" 1168 | dependencies = [ 1169 | "quote", 1170 | "wasm-bindgen-macro-support", 1171 | ] 1172 | 1173 | [[package]] 1174 | name = "wasm-bindgen-macro-support" 1175 | version = "0.2.95" 1176 | source = "registry+https://github.com/rust-lang/crates.io-index" 1177 | checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" 1178 | dependencies = [ 1179 | "proc-macro2", 1180 | "quote", 1181 | "syn", 1182 | "wasm-bindgen-backend", 1183 | "wasm-bindgen-shared", 1184 | ] 1185 | 1186 | [[package]] 1187 | name = "wasm-bindgen-shared" 1188 | version = "0.2.95" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" 1191 | 1192 | [[package]] 1193 | name = "web-sys" 1194 | version = "0.3.72" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" 1197 | dependencies = [ 1198 | "js-sys", 1199 | "wasm-bindgen", 1200 | ] 1201 | 1202 | [[package]] 1203 | name = "windows-sys" 1204 | version = "0.48.0" 1205 | source = "registry+https://github.com/rust-lang/crates.io-index" 1206 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1207 | dependencies = [ 1208 | "windows-targets 0.48.5", 1209 | ] 1210 | 1211 | [[package]] 1212 | name = "windows-sys" 1213 | version = "0.52.0" 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" 1215 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1216 | dependencies = [ 1217 | "windows-targets 0.52.6", 1218 | ] 1219 | 1220 | [[package]] 1221 | name = "windows-sys" 1222 | version = "0.59.0" 1223 | source = "registry+https://github.com/rust-lang/crates.io-index" 1224 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1225 | dependencies = [ 1226 | "windows-targets 0.52.6", 1227 | ] 1228 | 1229 | [[package]] 1230 | name = "windows-targets" 1231 | version = "0.48.5" 1232 | source = "registry+https://github.com/rust-lang/crates.io-index" 1233 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1234 | dependencies = [ 1235 | "windows_aarch64_gnullvm 0.48.5", 1236 | "windows_aarch64_msvc 0.48.5", 1237 | "windows_i686_gnu 0.48.5", 1238 | "windows_i686_msvc 0.48.5", 1239 | "windows_x86_64_gnu 0.48.5", 1240 | "windows_x86_64_gnullvm 0.48.5", 1241 | "windows_x86_64_msvc 0.48.5", 1242 | ] 1243 | 1244 | [[package]] 1245 | name = "windows-targets" 1246 | version = "0.52.6" 1247 | source = "registry+https://github.com/rust-lang/crates.io-index" 1248 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1249 | dependencies = [ 1250 | "windows_aarch64_gnullvm 0.52.6", 1251 | "windows_aarch64_msvc 0.52.6", 1252 | "windows_i686_gnu 0.52.6", 1253 | "windows_i686_gnullvm", 1254 | "windows_i686_msvc 0.52.6", 1255 | "windows_x86_64_gnu 0.52.6", 1256 | "windows_x86_64_gnullvm 0.52.6", 1257 | "windows_x86_64_msvc 0.52.6", 1258 | ] 1259 | 1260 | [[package]] 1261 | name = "windows_aarch64_gnullvm" 1262 | version = "0.48.5" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1265 | 1266 | [[package]] 1267 | name = "windows_aarch64_gnullvm" 1268 | version = "0.52.6" 1269 | source = "registry+https://github.com/rust-lang/crates.io-index" 1270 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1271 | 1272 | [[package]] 1273 | name = "windows_aarch64_msvc" 1274 | version = "0.48.5" 1275 | source = "registry+https://github.com/rust-lang/crates.io-index" 1276 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1277 | 1278 | [[package]] 1279 | name = "windows_aarch64_msvc" 1280 | version = "0.52.6" 1281 | source = "registry+https://github.com/rust-lang/crates.io-index" 1282 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1283 | 1284 | [[package]] 1285 | name = "windows_i686_gnu" 1286 | version = "0.48.5" 1287 | source = "registry+https://github.com/rust-lang/crates.io-index" 1288 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1289 | 1290 | [[package]] 1291 | name = "windows_i686_gnu" 1292 | version = "0.52.6" 1293 | source = "registry+https://github.com/rust-lang/crates.io-index" 1294 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1295 | 1296 | [[package]] 1297 | name = "windows_i686_gnullvm" 1298 | version = "0.52.6" 1299 | source = "registry+https://github.com/rust-lang/crates.io-index" 1300 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1301 | 1302 | [[package]] 1303 | name = "windows_i686_msvc" 1304 | version = "0.48.5" 1305 | source = "registry+https://github.com/rust-lang/crates.io-index" 1306 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1307 | 1308 | [[package]] 1309 | name = "windows_i686_msvc" 1310 | version = "0.52.6" 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" 1312 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1313 | 1314 | [[package]] 1315 | name = "windows_x86_64_gnu" 1316 | version = "0.48.5" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1319 | 1320 | [[package]] 1321 | name = "windows_x86_64_gnu" 1322 | version = "0.52.6" 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" 1324 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1325 | 1326 | [[package]] 1327 | name = "windows_x86_64_gnullvm" 1328 | version = "0.48.5" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1331 | 1332 | [[package]] 1333 | name = "windows_x86_64_gnullvm" 1334 | version = "0.52.6" 1335 | source = "registry+https://github.com/rust-lang/crates.io-index" 1336 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1337 | 1338 | [[package]] 1339 | name = "windows_x86_64_msvc" 1340 | version = "0.48.5" 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" 1342 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1343 | 1344 | [[package]] 1345 | name = "windows_x86_64_msvc" 1346 | version = "0.52.6" 1347 | source = "registry+https://github.com/rust-lang/crates.io-index" 1348 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1349 | 1350 | [[package]] 1351 | name = "winreg" 1352 | version = "0.50.0" 1353 | source = "registry+https://github.com/rust-lang/crates.io-index" 1354 | checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" 1355 | dependencies = [ 1356 | "cfg-if", 1357 | "windows-sys 0.48.0", 1358 | ] 1359 | 1360 | [[package]] 1361 | name = "write16" 1362 | version = "1.0.0" 1363 | source = "registry+https://github.com/rust-lang/crates.io-index" 1364 | checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" 1365 | 1366 | [[package]] 1367 | name = "writeable" 1368 | version = "0.5.5" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" 1371 | 1372 | [[package]] 1373 | name = "yoke" 1374 | version = "0.7.4" 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" 1376 | checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" 1377 | dependencies = [ 1378 | "serde", 1379 | "stable_deref_trait", 1380 | "yoke-derive", 1381 | "zerofrom", 1382 | ] 1383 | 1384 | [[package]] 1385 | name = "yoke-derive" 1386 | version = "0.7.4" 1387 | source = "registry+https://github.com/rust-lang/crates.io-index" 1388 | checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" 1389 | dependencies = [ 1390 | "proc-macro2", 1391 | "quote", 1392 | "syn", 1393 | "synstructure", 1394 | ] 1395 | 1396 | [[package]] 1397 | name = "zerofrom" 1398 | version = "0.1.4" 1399 | source = "registry+https://github.com/rust-lang/crates.io-index" 1400 | checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" 1401 | dependencies = [ 1402 | "zerofrom-derive", 1403 | ] 1404 | 1405 | [[package]] 1406 | name = "zerofrom-derive" 1407 | version = "0.1.4" 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" 1409 | checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" 1410 | dependencies = [ 1411 | "proc-macro2", 1412 | "quote", 1413 | "syn", 1414 | "synstructure", 1415 | ] 1416 | 1417 | [[package]] 1418 | name = "zerovec" 1419 | version = "0.10.4" 1420 | source = "registry+https://github.com/rust-lang/crates.io-index" 1421 | checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" 1422 | dependencies = [ 1423 | "yoke", 1424 | "zerofrom", 1425 | "zerovec-derive", 1426 | ] 1427 | 1428 | [[package]] 1429 | name = "zerovec-derive" 1430 | version = "0.10.3" 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" 1432 | checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" 1433 | dependencies = [ 1434 | "proc-macro2", 1435 | "quote", 1436 | "syn", 1437 | ] 1438 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ipapi" 3 | version = "0.1.0" 4 | authors = ["IPQuery "] 5 | edition = "2021" 6 | description = "A Rust library to query IP addresses using ipquery.io API" 7 | license = "MIT" 8 | repository = "https://github.com/ipqwery/ipapi" 9 | homepage = "https://github.com/ipqwery/ipapi" 10 | documentation = "https://docs.rs/ipapi" 11 | keywords = ["ip", "query", "ipquery", "networking", "api"] 12 | categories = ["network-programming"] 13 | readme = "README.md" 14 | 15 | [dependencies] 16 | reqwest = { version = "0.11", features = ["json"] } 17 | serde = { version = "1.0", features = ["derive"] } 18 | tokio = { version = "1.0", features = ["full"] } 19 | serde_json = "1.0" 20 | 21 | [dev-dependencies] 22 | tokio = { version = "1.0", features = ["full"] } 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) <2024> IPQuery.io 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ipapi 2 | 3 | A Rust library to query IP addresses using the [ipquery.io](https://ipquery.io) API. 4 | 5 | ## Features 6 | 7 | - Query details for a specific IP address 8 | - Bulk query multiple IP addresses 9 | - Fetch your own public IP address 10 | 11 | ## Installation 12 | 13 | To use this crate, add the following to your `Cargo.toml`: 14 | 15 | ```toml 16 | [dependencies] 17 | ipapi = "0.1.0" 18 | tokio = { version = "1.0", features = ["full"] } 19 | ``` 20 | 21 | ## Usage 22 | 23 | ### Query a Specific IP Address 24 | 25 | The `query_ip` function retrieves information about a specific IP address, including its ISP, location, and risk data. 26 | 27 | ```rust 28 | use ipapi::query_ip; 29 | use tokio; 30 | 31 | #[tokio::main] 32 | async fn main() { 33 | let ip_info = query_ip("8.8.8.8").await.unwrap(); 34 | println!("{:#?}", ip_info); 35 | } 36 | ``` 37 | 38 | #### Output Example 39 | ```plaintext 40 | IPInfo { 41 | ip: "8.8.8.8", 42 | isp: Some(ISPInfo { asn: Some("AS15169"), org: Some("Google LLC"), isp: Some("Google LLC") }), 43 | location: Some(LocationInfo { 44 | country: Some("United States"), 45 | country_code: Some("US"), 46 | city: Some("Mountain View"), 47 | state: Some("California"), 48 | zipcode: Some("94035"), 49 | latitude: Some(37.386), 50 | longitude: Some(-122.0838), 51 | timezone: Some("America/Los_Angeles"), 52 | localtime: Some("2024-11-09T12:45:32"), 53 | }), 54 | risk: Some(RiskInfo { 55 | is_mobile: Some(false), 56 | is_vpn: Some(false), 57 | is_tor: Some(false), 58 | is_proxy: Some(false), 59 | is_datacenter: Some(true), 60 | risk_score: Some(0), 61 | }), 62 | } 63 | ``` 64 | 65 | ### Bulk Query Multiple IP Addresses 66 | 67 | The `query_bulk` function allows you to query information for multiple IP addresses at once. 68 | 69 | ```rust 70 | use ipapi::query_bulk; 71 | use tokio; 72 | 73 | #[tokio::main] 74 | async fn main() { 75 | let ip_infos = query_bulk(&["8.8.8.8", "1.1.1.1"]).await.unwrap(); 76 | for info in ip_infos { 77 | println!("{:#?}", info); 78 | } 79 | } 80 | ``` 81 | 82 | #### Output Example 83 | ```plaintext 84 | IPInfo { 85 | ip: "8.8.8.8", 86 | ... 87 | } 88 | IPInfo { 89 | ip: "1.1.1.1", 90 | ... 91 | } 92 | ``` 93 | 94 | ### Fetch Your Own Public IP Address 95 | 96 | The `query_own_ip` function retrieves the public IP address of the current machine. 97 | 98 | ```rust 99 | use ipapi::query_own_ip; 100 | use tokio; 101 | 102 | #[tokio::main] 103 | async fn main() { 104 | let ip = query_own_ip().await.unwrap(); 105 | println!("Your IP Address: {}", ip); 106 | } 107 | ``` 108 | 109 | #### Output Example 110 | ```plaintext 111 | Your IP Address: 203.0.113.45 112 | ``` 113 | 114 | ## API Documentation 115 | 116 | ### 1. `query_ip` 117 | 118 | #### Signature 119 | ```rust 120 | pub async fn query_ip(ip: &str) -> Result 121 | ``` 122 | 123 | #### Description 124 | Fetches detailed information about a specific IP address, including its ISP, location, and risk information. 125 | 126 | #### Parameters 127 | - `ip`: A string slice representing the IP address to query. 128 | 129 | #### Returns 130 | - `Ok(IPInfo)` on success, containing details about the IP address. 131 | - `Err(reqwest::Error)` if the network request or JSON deserialization fails. 132 | 133 | #### Example 134 | ```rust 135 | let result = query_ip("8.8.8.8").await?; 136 | println!("{:?}", result); 137 | ``` 138 | 139 | --- 140 | 141 | ### 2. `query_bulk` 142 | 143 | #### Signature 144 | ```rust 145 | pub async fn query_bulk(ips: &[&str]) -> Result, reqwest::Error> 146 | ``` 147 | 148 | #### Description 149 | Fetches information for multiple IP addresses at once. Useful for batch processing. 150 | 151 | #### Parameters 152 | - `ips`: A slice of string slices representing the list of IP addresses to query. 153 | 154 | #### Returns 155 | - `Ok(Vec)` on success, containing details for each IP address. 156 | - `Err(reqwest::Error)` if the network request or JSON deserialization fails. 157 | 158 | #### Example 159 | ```rust 160 | let ips = ["8.8.8.8", "1.1.1.1"]; 161 | let results = query_bulk(&ips).await?; 162 | println!("{:?}", results); 163 | ``` 164 | 165 | --- 166 | 167 | ### 3. `query_own_ip` 168 | 169 | #### Signature 170 | ```rust 171 | pub async fn query_own_ip() -> Result 172 | ``` 173 | 174 | #### Description 175 | Fetches the public IP address of the current machine. Useful for determining your own IP address. 176 | 177 | #### Returns 178 | - `Ok(String)` containing the public IP address. 179 | - `Err(reqwest::Error)` if the network request fails. 180 | 181 | #### Example 182 | ```rust 183 | let ip = query_own_ip().await?; 184 | println!("Your IP Address: {}", ip); 185 | ``` 186 | 187 | --- 188 | 189 | ## Running Tests 190 | 191 | To run the tests for this crate: 192 | 193 | ```bash 194 | cargo test 195 | ``` 196 | 197 | ## Contributing 198 | 199 | Contributions are welcome! Feel free to open issues or submit pull requests on the [GitHub repository](https://github.com/ipqwery/ipapi). 200 | 201 | ## License 202 | 203 | This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. 204 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | //! # ipapi 2 | //! 3 | //! A Rust library to query IP addresses using the ipquery.io API. 4 | //! 5 | //! ## Features 6 | //! - Query details for a specific IP address 7 | //! - Bulk query multiple IP addresses 8 | //! - Fetch your own public IP address 9 | //! 10 | //! ## Example Usage 11 | //! 12 | //! ```rust 13 | //! use ipapi::{query_ip, query_bulk, query_own_ip}; 14 | //! use tokio; 15 | //! 16 | //! #[tokio::main] 17 | //! async fn main() { 18 | //! // Query a specific IP 19 | //! let ip_info = query_ip("8.8.8.8").await.unwrap(); 20 | //! println!("{:?}", ip_info); 21 | //! } 22 | //! ``` 23 | //! 24 | //! ## License 25 | //! This project is licensed under the MIT License. 26 | 27 | use reqwest::Error; 28 | use serde::{Deserialize, Serialize}; 29 | 30 | /// The base URL for the ipquery.io API. 31 | const BASE_URL: &str = "https://api.ipquery.io/"; 32 | 33 | /// Represents information about an ISP (Internet Service Provider). 34 | #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)] 35 | pub struct ISPInfo { 36 | /// The Autonomous System Number (ASN) of the ISP. 37 | pub asn: Option, 38 | /// The organization associated with the ISP. 39 | pub org: Option, 40 | /// The name of the ISP. 41 | pub isp: Option, 42 | } 43 | 44 | /// Represents information about the geographical location of an IP address. 45 | #[derive(Debug, Deserialize, Serialize, PartialEq)] 46 | pub struct LocationInfo { 47 | /// The country name. 48 | pub country: Option, 49 | /// The ISO country code. 50 | pub country_code: Option, 51 | /// The city name. 52 | pub city: Option, 53 | /// The state or region. 54 | pub state: Option, 55 | /// The postal or ZIP code. 56 | pub zipcode: Option, 57 | /// The latitude of the location. 58 | pub latitude: Option, 59 | /// The longitude of the location. 60 | pub longitude: Option, 61 | /// The timezone of the location. 62 | pub timezone: Option, 63 | /// The local time in the specified timezone. 64 | pub localtime: Option, 65 | } 66 | 67 | /// Represents information about potential risks associated with an IP address. 68 | #[derive(Debug, Deserialize, Serialize, PartialEq, Eq)] 69 | pub struct RiskInfo { 70 | /// Indicates if the IP is associated with a mobile network. 71 | pub is_mobile: Option, 72 | /// Indicates if the IP is using a VPN. 73 | pub is_vpn: Option, 74 | /// Indicates if the IP is part of the Tor network. 75 | pub is_tor: Option, 76 | /// Indicates if the IP is using a proxy. 77 | pub is_proxy: Option, 78 | /// Indicates if the IP is associated with a data center. 79 | pub is_datacenter: Option, 80 | /// A score indicating the risk level (0-100). 81 | pub risk_score: Option, 82 | } 83 | 84 | /// Represents the full set of information returned by the API for an IP address. 85 | #[derive(Debug, Deserialize, Serialize, PartialEq)] 86 | pub struct IPInfo { 87 | /// The queried IP address. 88 | pub ip: String, 89 | /// Information about the ISP. 90 | pub isp: Option, 91 | /// Information about the location. 92 | pub location: Option, 93 | /// Information about the risk level. 94 | pub risk: Option, 95 | } 96 | 97 | /// Fetches the IP information for a given IP address. 98 | /// 99 | /// # Arguments 100 | /// 101 | /// * `ip` - A string slice representing the IP address to query. 102 | /// 103 | /// # Example 104 | /// 105 | /// ```rust 106 | /// use ipapi::query_ip; 107 | /// use tokio; 108 | /// 109 | /// #[tokio::main] 110 | /// async fn main() { 111 | /// let ip_info = query_ip("8.8.8.8").await.unwrap(); 112 | /// println!("{:?}", ip_info); 113 | /// } 114 | /// ``` 115 | /// 116 | /// # Errors 117 | /// 118 | /// Returns an error if the network request fails or the response cannot be deserialized. 119 | pub async fn query_ip(ip: &str) -> Result { 120 | let url = format!("{}{}", BASE_URL, ip); 121 | let response = reqwest::get(&url).await?.json::().await?; 122 | Ok(response) 123 | } 124 | 125 | /// Fetches information for multiple IP addresses. 126 | /// 127 | /// # Arguments 128 | /// 129 | /// * `ips` - A slice of string slices representing the list of IP addresses to query. 130 | /// 131 | /// # Example 132 | /// 133 | /// ```rust 134 | /// use ipapi::query_bulk; 135 | /// use tokio; 136 | /// 137 | /// #[tokio::main] 138 | /// async fn main() { 139 | /// let ip_infos = query_bulk(&["8.8.8.8", "1.1.1.1"]).await.unwrap(); 140 | /// println!("{:?}", ip_infos); 141 | /// } 142 | /// ``` 143 | /// 144 | /// # Errors 145 | /// 146 | /// Returns an error if the network request fails or the response cannot be deserialized. 147 | pub async fn query_bulk(ips: &[&str]) -> Result, Error> { 148 | if ips.is_empty() { 149 | return Ok(vec![]); 150 | } 151 | let mut ip_list = ips.join(","); 152 | if ips.len() == 1 { 153 | ip_list.push(','); 154 | } 155 | let url = format!("{}{}", BASE_URL, ip_list); 156 | let response = reqwest::get(&url).await?.json::>().await?; 157 | Ok(response) 158 | } 159 | 160 | /// Fetches the IP address of the current machine. 161 | /// 162 | /// # Example 163 | /// 164 | /// ```rust 165 | /// use ipapi::query_own_ip; 166 | /// use tokio; 167 | /// 168 | /// #[tokio::main] 169 | /// async fn main() { 170 | /// let ip = query_own_ip().await.unwrap(); 171 | /// println!("Your IP Address: {}", ip); 172 | /// } 173 | /// ``` 174 | /// 175 | /// # Errors 176 | /// 177 | /// Returns an error if the network request fails. 178 | pub async fn query_own_ip() -> Result { 179 | let response = reqwest::get(BASE_URL).await?.text().await?; 180 | Ok(response) 181 | } 182 | -------------------------------------------------------------------------------- /tests/integration-test.rs: -------------------------------------------------------------------------------- 1 | use ipapi::{query_ip, query_bulk, query_own_ip}; 2 | 3 | #[tokio::test] 4 | async fn test_query_ip() { 5 | let result = query_ip("8.8.8.8").await; 6 | assert!(result.is_ok()); 7 | let ip_info = result.unwrap(); 8 | assert_eq!(ip_info.ip, "8.8.8.8"); 9 | assert!(ip_info.isp.is_some()); 10 | assert!(ip_info.location.is_some()); 11 | assert!(ip_info.risk.is_some()); 12 | } 13 | 14 | #[tokio::test] 15 | async fn test_query_bulk() { 16 | let ips = ["8.8.8.8", "1.1.1.1"]; 17 | let result = query_bulk(&ips).await; 18 | assert!(result.is_ok()); 19 | let ip_infos = result.unwrap(); 20 | assert_eq!(ip_infos.len(), 2); 21 | assert_eq!(ip_infos[0].ip, "8.8.8.8"); 22 | assert_eq!(ip_infos[1].ip, "1.1.1.1"); 23 | } 24 | 25 | #[tokio::test] 26 | async fn test_query_bulk_single_ip() { 27 | let ips = ["8.8.8.8"]; 28 | let result = query_bulk(&ips).await; 29 | assert!(result.is_ok()); 30 | let ip_infos = result.unwrap(); 31 | assert_eq!(ip_infos.len(), 1); 32 | assert_eq!(ip_infos[0].ip, "8.8.8.8"); 33 | } 34 | 35 | #[tokio::test] 36 | async fn test_query_bulk_no_ip() { 37 | let ips = []; 38 | let result = query_bulk(&ips).await; 39 | assert!(result.is_ok()); 40 | let ip_infos = result.unwrap(); 41 | assert!(ip_infos.is_empty()); 42 | } 43 | 44 | #[tokio::test] 45 | async fn test_query_own_ip() { 46 | let result = query_own_ip().await; 47 | assert!(result.is_ok()); 48 | let ip = result.unwrap(); 49 | assert!(!ip.is_empty()); 50 | } 51 | --------------------------------------------------------------------------------