Simple command to check if you are within ISS visibility range

Initial commit

+1176
+1
.gitignore
··· 1 + /target
+1042
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 = "autocfg" 22 + version = "1.1.0" 23 + source = "registry+https://github.com/rust-lang/crates.io-index" 24 + checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 25 + 26 + [[package]] 27 + name = "backtrace" 28 + version = "0.3.68" 29 + source = "registry+https://github.com/rust-lang/crates.io-index" 30 + checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" 31 + dependencies = [ 32 + "addr2line", 33 + "cc", 34 + "cfg-if", 35 + "libc", 36 + "miniz_oxide", 37 + "object", 38 + "rustc-demangle", 39 + ] 40 + 41 + [[package]] 42 + name = "base64" 43 + version = "0.21.2" 44 + source = "registry+https://github.com/rust-lang/crates.io-index" 45 + checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" 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.3.3" 56 + source = "registry+https://github.com/rust-lang/crates.io-index" 57 + checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" 58 + 59 + [[package]] 60 + name = "bumpalo" 61 + version = "3.13.0" 62 + source = "registry+https://github.com/rust-lang/crates.io-index" 63 + checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" 64 + 65 + [[package]] 66 + name = "bytes" 67 + version = "1.4.0" 68 + source = "registry+https://github.com/rust-lang/crates.io-index" 69 + checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 70 + 71 + [[package]] 72 + name = "cc" 73 + version = "1.0.79" 74 + source = "registry+https://github.com/rust-lang/crates.io-index" 75 + checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 76 + 77 + [[package]] 78 + name = "cfg-if" 79 + version = "1.0.0" 80 + source = "registry+https://github.com/rust-lang/crates.io-index" 81 + checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 82 + 83 + [[package]] 84 + name = "core-foundation" 85 + version = "0.9.3" 86 + source = "registry+https://github.com/rust-lang/crates.io-index" 87 + checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 88 + dependencies = [ 89 + "core-foundation-sys", 90 + "libc", 91 + ] 92 + 93 + [[package]] 94 + name = "core-foundation-sys" 95 + version = "0.8.4" 96 + source = "registry+https://github.com/rust-lang/crates.io-index" 97 + checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 98 + 99 + [[package]] 100 + name = "encoding_rs" 101 + version = "0.8.32" 102 + source = "registry+https://github.com/rust-lang/crates.io-index" 103 + checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 104 + dependencies = [ 105 + "cfg-if", 106 + ] 107 + 108 + [[package]] 109 + name = "errno" 110 + version = "0.3.1" 111 + source = "registry+https://github.com/rust-lang/crates.io-index" 112 + checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 113 + dependencies = [ 114 + "errno-dragonfly", 115 + "libc", 116 + "windows-sys", 117 + ] 118 + 119 + [[package]] 120 + name = "errno-dragonfly" 121 + version = "0.1.2" 122 + source = "registry+https://github.com/rust-lang/crates.io-index" 123 + checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 124 + dependencies = [ 125 + "cc", 126 + "libc", 127 + ] 128 + 129 + [[package]] 130 + name = "fastrand" 131 + version = "2.0.0" 132 + source = "registry+https://github.com/rust-lang/crates.io-index" 133 + checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" 134 + 135 + [[package]] 136 + name = "fnv" 137 + version = "1.0.7" 138 + source = "registry+https://github.com/rust-lang/crates.io-index" 139 + checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 140 + 141 + [[package]] 142 + name = "foreign-types" 143 + version = "0.3.2" 144 + source = "registry+https://github.com/rust-lang/crates.io-index" 145 + checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 146 + dependencies = [ 147 + "foreign-types-shared", 148 + ] 149 + 150 + [[package]] 151 + name = "foreign-types-shared" 152 + version = "0.1.1" 153 + source = "registry+https://github.com/rust-lang/crates.io-index" 154 + checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 155 + 156 + [[package]] 157 + name = "form_urlencoded" 158 + version = "1.2.0" 159 + source = "registry+https://github.com/rust-lang/crates.io-index" 160 + checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 161 + dependencies = [ 162 + "percent-encoding", 163 + ] 164 + 165 + [[package]] 166 + name = "futures-channel" 167 + version = "0.3.28" 168 + source = "registry+https://github.com/rust-lang/crates.io-index" 169 + checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 170 + dependencies = [ 171 + "futures-core", 172 + ] 173 + 174 + [[package]] 175 + name = "futures-core" 176 + version = "0.3.28" 177 + source = "registry+https://github.com/rust-lang/crates.io-index" 178 + checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 179 + 180 + [[package]] 181 + name = "futures-io" 182 + version = "0.3.28" 183 + source = "registry+https://github.com/rust-lang/crates.io-index" 184 + checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" 185 + 186 + [[package]] 187 + name = "futures-sink" 188 + version = "0.3.28" 189 + source = "registry+https://github.com/rust-lang/crates.io-index" 190 + checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 191 + 192 + [[package]] 193 + name = "futures-task" 194 + version = "0.3.28" 195 + source = "registry+https://github.com/rust-lang/crates.io-index" 196 + checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 197 + 198 + [[package]] 199 + name = "futures-util" 200 + version = "0.3.28" 201 + source = "registry+https://github.com/rust-lang/crates.io-index" 202 + checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 203 + dependencies = [ 204 + "futures-core", 205 + "futures-io", 206 + "futures-task", 207 + "memchr", 208 + "pin-project-lite", 209 + "pin-utils", 210 + "slab", 211 + ] 212 + 213 + [[package]] 214 + name = "gimli" 215 + version = "0.27.3" 216 + source = "registry+https://github.com/rust-lang/crates.io-index" 217 + checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" 218 + 219 + [[package]] 220 + name = "h2" 221 + version = "0.3.20" 222 + source = "registry+https://github.com/rust-lang/crates.io-index" 223 + checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" 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.12.3" 241 + source = "registry+https://github.com/rust-lang/crates.io-index" 242 + checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 243 + 244 + [[package]] 245 + name = "hermit-abi" 246 + version = "0.3.2" 247 + source = "registry+https://github.com/rust-lang/crates.io-index" 248 + checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" 249 + 250 + [[package]] 251 + name = "http" 252 + version = "0.2.9" 253 + source = "registry+https://github.com/rust-lang/crates.io-index" 254 + checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 255 + dependencies = [ 256 + "bytes", 257 + "fnv", 258 + "itoa", 259 + ] 260 + 261 + [[package]] 262 + name = "http-body" 263 + version = "0.4.5" 264 + source = "registry+https://github.com/rust-lang/crates.io-index" 265 + checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 266 + dependencies = [ 267 + "bytes", 268 + "http", 269 + "pin-project-lite", 270 + ] 271 + 272 + [[package]] 273 + name = "httparse" 274 + version = "1.8.0" 275 + source = "registry+https://github.com/rust-lang/crates.io-index" 276 + checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 277 + 278 + [[package]] 279 + name = "httpdate" 280 + version = "1.0.2" 281 + source = "registry+https://github.com/rust-lang/crates.io-index" 282 + checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 283 + 284 + [[package]] 285 + name = "hyper" 286 + version = "0.14.27" 287 + source = "registry+https://github.com/rust-lang/crates.io-index" 288 + checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 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 = "idna" 323 + version = "0.4.0" 324 + source = "registry+https://github.com/rust-lang/crates.io-index" 325 + checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 326 + dependencies = [ 327 + "unicode-bidi", 328 + "unicode-normalization", 329 + ] 330 + 331 + [[package]] 332 + name = "indexmap" 333 + version = "1.9.3" 334 + source = "registry+https://github.com/rust-lang/crates.io-index" 335 + checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 336 + dependencies = [ 337 + "autocfg", 338 + "hashbrown", 339 + ] 340 + 341 + [[package]] 342 + name = "ipnet" 343 + version = "2.8.0" 344 + source = "registry+https://github.com/rust-lang/crates.io-index" 345 + checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" 346 + 347 + [[package]] 348 + name = "iss_locator" 349 + version = "0.1.0" 350 + dependencies = [ 351 + "reqwest", 352 + "serde_json", 353 + ] 354 + 355 + [[package]] 356 + name = "itoa" 357 + version = "1.0.9" 358 + source = "registry+https://github.com/rust-lang/crates.io-index" 359 + checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 360 + 361 + [[package]] 362 + name = "js-sys" 363 + version = "0.3.64" 364 + source = "registry+https://github.com/rust-lang/crates.io-index" 365 + checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 366 + dependencies = [ 367 + "wasm-bindgen", 368 + ] 369 + 370 + [[package]] 371 + name = "lazy_static" 372 + version = "1.4.0" 373 + source = "registry+https://github.com/rust-lang/crates.io-index" 374 + checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 375 + 376 + [[package]] 377 + name = "libc" 378 + version = "0.2.147" 379 + source = "registry+https://github.com/rust-lang/crates.io-index" 380 + checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 381 + 382 + [[package]] 383 + name = "linux-raw-sys" 384 + version = "0.4.3" 385 + source = "registry+https://github.com/rust-lang/crates.io-index" 386 + checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" 387 + 388 + [[package]] 389 + name = "log" 390 + version = "0.4.19" 391 + source = "registry+https://github.com/rust-lang/crates.io-index" 392 + checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 393 + 394 + [[package]] 395 + name = "memchr" 396 + version = "2.5.0" 397 + source = "registry+https://github.com/rust-lang/crates.io-index" 398 + checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 399 + 400 + [[package]] 401 + name = "mime" 402 + version = "0.3.17" 403 + source = "registry+https://github.com/rust-lang/crates.io-index" 404 + checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 405 + 406 + [[package]] 407 + name = "miniz_oxide" 408 + version = "0.7.1" 409 + source = "registry+https://github.com/rust-lang/crates.io-index" 410 + checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 411 + dependencies = [ 412 + "adler", 413 + ] 414 + 415 + [[package]] 416 + name = "mio" 417 + version = "0.8.8" 418 + source = "registry+https://github.com/rust-lang/crates.io-index" 419 + checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 420 + dependencies = [ 421 + "libc", 422 + "wasi", 423 + "windows-sys", 424 + ] 425 + 426 + [[package]] 427 + name = "native-tls" 428 + version = "0.2.11" 429 + source = "registry+https://github.com/rust-lang/crates.io-index" 430 + checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 431 + dependencies = [ 432 + "lazy_static", 433 + "libc", 434 + "log", 435 + "openssl", 436 + "openssl-probe", 437 + "openssl-sys", 438 + "schannel", 439 + "security-framework", 440 + "security-framework-sys", 441 + "tempfile", 442 + ] 443 + 444 + [[package]] 445 + name = "num_cpus" 446 + version = "1.16.0" 447 + source = "registry+https://github.com/rust-lang/crates.io-index" 448 + checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 449 + dependencies = [ 450 + "hermit-abi", 451 + "libc", 452 + ] 453 + 454 + [[package]] 455 + name = "object" 456 + version = "0.31.1" 457 + source = "registry+https://github.com/rust-lang/crates.io-index" 458 + checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" 459 + dependencies = [ 460 + "memchr", 461 + ] 462 + 463 + [[package]] 464 + name = "once_cell" 465 + version = "1.18.0" 466 + source = "registry+https://github.com/rust-lang/crates.io-index" 467 + checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 468 + 469 + [[package]] 470 + name = "openssl" 471 + version = "0.10.55" 472 + source = "registry+https://github.com/rust-lang/crates.io-index" 473 + checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" 474 + dependencies = [ 475 + "bitflags 1.3.2", 476 + "cfg-if", 477 + "foreign-types", 478 + "libc", 479 + "once_cell", 480 + "openssl-macros", 481 + "openssl-sys", 482 + ] 483 + 484 + [[package]] 485 + name = "openssl-macros" 486 + version = "0.1.1" 487 + source = "registry+https://github.com/rust-lang/crates.io-index" 488 + checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 489 + dependencies = [ 490 + "proc-macro2", 491 + "quote", 492 + "syn", 493 + ] 494 + 495 + [[package]] 496 + name = "openssl-probe" 497 + version = "0.1.5" 498 + source = "registry+https://github.com/rust-lang/crates.io-index" 499 + checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 500 + 501 + [[package]] 502 + name = "openssl-sys" 503 + version = "0.9.90" 504 + source = "registry+https://github.com/rust-lang/crates.io-index" 505 + checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" 506 + dependencies = [ 507 + "cc", 508 + "libc", 509 + "pkg-config", 510 + "vcpkg", 511 + ] 512 + 513 + [[package]] 514 + name = "percent-encoding" 515 + version = "2.3.0" 516 + source = "registry+https://github.com/rust-lang/crates.io-index" 517 + checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 518 + 519 + [[package]] 520 + name = "pin-project-lite" 521 + version = "0.2.10" 522 + source = "registry+https://github.com/rust-lang/crates.io-index" 523 + checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" 524 + 525 + [[package]] 526 + name = "pin-utils" 527 + version = "0.1.0" 528 + source = "registry+https://github.com/rust-lang/crates.io-index" 529 + checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 530 + 531 + [[package]] 532 + name = "pkg-config" 533 + version = "0.3.27" 534 + source = "registry+https://github.com/rust-lang/crates.io-index" 535 + checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" 536 + 537 + [[package]] 538 + name = "proc-macro2" 539 + version = "1.0.66" 540 + source = "registry+https://github.com/rust-lang/crates.io-index" 541 + checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 542 + dependencies = [ 543 + "unicode-ident", 544 + ] 545 + 546 + [[package]] 547 + name = "quote" 548 + version = "1.0.32" 549 + source = "registry+https://github.com/rust-lang/crates.io-index" 550 + checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" 551 + dependencies = [ 552 + "proc-macro2", 553 + ] 554 + 555 + [[package]] 556 + name = "redox_syscall" 557 + version = "0.3.5" 558 + source = "registry+https://github.com/rust-lang/crates.io-index" 559 + checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 560 + dependencies = [ 561 + "bitflags 1.3.2", 562 + ] 563 + 564 + [[package]] 565 + name = "reqwest" 566 + version = "0.11.18" 567 + source = "registry+https://github.com/rust-lang/crates.io-index" 568 + checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" 569 + dependencies = [ 570 + "base64", 571 + "bytes", 572 + "encoding_rs", 573 + "futures-core", 574 + "futures-util", 575 + "h2", 576 + "http", 577 + "http-body", 578 + "hyper", 579 + "hyper-tls", 580 + "ipnet", 581 + "js-sys", 582 + "log", 583 + "mime", 584 + "native-tls", 585 + "once_cell", 586 + "percent-encoding", 587 + "pin-project-lite", 588 + "serde", 589 + "serde_json", 590 + "serde_urlencoded", 591 + "tokio", 592 + "tokio-native-tls", 593 + "tower-service", 594 + "url", 595 + "wasm-bindgen", 596 + "wasm-bindgen-futures", 597 + "web-sys", 598 + "winreg", 599 + ] 600 + 601 + [[package]] 602 + name = "rustc-demangle" 603 + version = "0.1.23" 604 + source = "registry+https://github.com/rust-lang/crates.io-index" 605 + checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 606 + 607 + [[package]] 608 + name = "rustix" 609 + version = "0.38.4" 610 + source = "registry+https://github.com/rust-lang/crates.io-index" 611 + checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" 612 + dependencies = [ 613 + "bitflags 2.3.3", 614 + "errno", 615 + "libc", 616 + "linux-raw-sys", 617 + "windows-sys", 618 + ] 619 + 620 + [[package]] 621 + name = "ryu" 622 + version = "1.0.15" 623 + source = "registry+https://github.com/rust-lang/crates.io-index" 624 + checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" 625 + 626 + [[package]] 627 + name = "schannel" 628 + version = "0.1.22" 629 + source = "registry+https://github.com/rust-lang/crates.io-index" 630 + checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" 631 + dependencies = [ 632 + "windows-sys", 633 + ] 634 + 635 + [[package]] 636 + name = "security-framework" 637 + version = "2.9.2" 638 + source = "registry+https://github.com/rust-lang/crates.io-index" 639 + checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" 640 + dependencies = [ 641 + "bitflags 1.3.2", 642 + "core-foundation", 643 + "core-foundation-sys", 644 + "libc", 645 + "security-framework-sys", 646 + ] 647 + 648 + [[package]] 649 + name = "security-framework-sys" 650 + version = "2.9.1" 651 + source = "registry+https://github.com/rust-lang/crates.io-index" 652 + checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" 653 + dependencies = [ 654 + "core-foundation-sys", 655 + "libc", 656 + ] 657 + 658 + [[package]] 659 + name = "serde" 660 + version = "1.0.177" 661 + source = "registry+https://github.com/rust-lang/crates.io-index" 662 + checksum = "63ba2516aa6bf82e0b19ca8b50019d52df58455d3cf9bdaf6315225fdd0c560a" 663 + 664 + [[package]] 665 + name = "serde_json" 666 + version = "1.0.104" 667 + source = "registry+https://github.com/rust-lang/crates.io-index" 668 + checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" 669 + dependencies = [ 670 + "itoa", 671 + "ryu", 672 + "serde", 673 + ] 674 + 675 + [[package]] 676 + name = "serde_urlencoded" 677 + version = "0.7.1" 678 + source = "registry+https://github.com/rust-lang/crates.io-index" 679 + checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 680 + dependencies = [ 681 + "form_urlencoded", 682 + "itoa", 683 + "ryu", 684 + "serde", 685 + ] 686 + 687 + [[package]] 688 + name = "slab" 689 + version = "0.4.8" 690 + source = "registry+https://github.com/rust-lang/crates.io-index" 691 + checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 692 + dependencies = [ 693 + "autocfg", 694 + ] 695 + 696 + [[package]] 697 + name = "socket2" 698 + version = "0.4.9" 699 + source = "registry+https://github.com/rust-lang/crates.io-index" 700 + checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 701 + dependencies = [ 702 + "libc", 703 + "winapi", 704 + ] 705 + 706 + [[package]] 707 + name = "syn" 708 + version = "2.0.27" 709 + source = "registry+https://github.com/rust-lang/crates.io-index" 710 + checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" 711 + dependencies = [ 712 + "proc-macro2", 713 + "quote", 714 + "unicode-ident", 715 + ] 716 + 717 + [[package]] 718 + name = "tempfile" 719 + version = "3.7.0" 720 + source = "registry+https://github.com/rust-lang/crates.io-index" 721 + checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" 722 + dependencies = [ 723 + "cfg-if", 724 + "fastrand", 725 + "redox_syscall", 726 + "rustix", 727 + "windows-sys", 728 + ] 729 + 730 + [[package]] 731 + name = "tinyvec" 732 + version = "1.6.0" 733 + source = "registry+https://github.com/rust-lang/crates.io-index" 734 + checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 735 + dependencies = [ 736 + "tinyvec_macros", 737 + ] 738 + 739 + [[package]] 740 + name = "tinyvec_macros" 741 + version = "0.1.1" 742 + source = "registry+https://github.com/rust-lang/crates.io-index" 743 + checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 744 + 745 + [[package]] 746 + name = "tokio" 747 + version = "1.29.1" 748 + source = "registry+https://github.com/rust-lang/crates.io-index" 749 + checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" 750 + dependencies = [ 751 + "autocfg", 752 + "backtrace", 753 + "bytes", 754 + "libc", 755 + "mio", 756 + "num_cpus", 757 + "pin-project-lite", 758 + "socket2", 759 + "windows-sys", 760 + ] 761 + 762 + [[package]] 763 + name = "tokio-native-tls" 764 + version = "0.3.1" 765 + source = "registry+https://github.com/rust-lang/crates.io-index" 766 + checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 767 + dependencies = [ 768 + "native-tls", 769 + "tokio", 770 + ] 771 + 772 + [[package]] 773 + name = "tokio-util" 774 + version = "0.7.8" 775 + source = "registry+https://github.com/rust-lang/crates.io-index" 776 + checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 777 + dependencies = [ 778 + "bytes", 779 + "futures-core", 780 + "futures-sink", 781 + "pin-project-lite", 782 + "tokio", 783 + "tracing", 784 + ] 785 + 786 + [[package]] 787 + name = "tower-service" 788 + version = "0.3.2" 789 + source = "registry+https://github.com/rust-lang/crates.io-index" 790 + checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 791 + 792 + [[package]] 793 + name = "tracing" 794 + version = "0.1.37" 795 + source = "registry+https://github.com/rust-lang/crates.io-index" 796 + checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 797 + dependencies = [ 798 + "cfg-if", 799 + "pin-project-lite", 800 + "tracing-core", 801 + ] 802 + 803 + [[package]] 804 + name = "tracing-core" 805 + version = "0.1.31" 806 + source = "registry+https://github.com/rust-lang/crates.io-index" 807 + checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 808 + dependencies = [ 809 + "once_cell", 810 + ] 811 + 812 + [[package]] 813 + name = "try-lock" 814 + version = "0.2.4" 815 + source = "registry+https://github.com/rust-lang/crates.io-index" 816 + checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 817 + 818 + [[package]] 819 + name = "unicode-bidi" 820 + version = "0.3.13" 821 + source = "registry+https://github.com/rust-lang/crates.io-index" 822 + checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 823 + 824 + [[package]] 825 + name = "unicode-ident" 826 + version = "1.0.11" 827 + source = "registry+https://github.com/rust-lang/crates.io-index" 828 + checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" 829 + 830 + [[package]] 831 + name = "unicode-normalization" 832 + version = "0.1.22" 833 + source = "registry+https://github.com/rust-lang/crates.io-index" 834 + checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 835 + dependencies = [ 836 + "tinyvec", 837 + ] 838 + 839 + [[package]] 840 + name = "url" 841 + version = "2.4.0" 842 + source = "registry+https://github.com/rust-lang/crates.io-index" 843 + checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" 844 + dependencies = [ 845 + "form_urlencoded", 846 + "idna", 847 + "percent-encoding", 848 + ] 849 + 850 + [[package]] 851 + name = "vcpkg" 852 + version = "0.2.15" 853 + source = "registry+https://github.com/rust-lang/crates.io-index" 854 + checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 855 + 856 + [[package]] 857 + name = "want" 858 + version = "0.3.1" 859 + source = "registry+https://github.com/rust-lang/crates.io-index" 860 + checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 861 + dependencies = [ 862 + "try-lock", 863 + ] 864 + 865 + [[package]] 866 + name = "wasi" 867 + version = "0.11.0+wasi-snapshot-preview1" 868 + source = "registry+https://github.com/rust-lang/crates.io-index" 869 + checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 870 + 871 + [[package]] 872 + name = "wasm-bindgen" 873 + version = "0.2.87" 874 + source = "registry+https://github.com/rust-lang/crates.io-index" 875 + checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 876 + dependencies = [ 877 + "cfg-if", 878 + "wasm-bindgen-macro", 879 + ] 880 + 881 + [[package]] 882 + name = "wasm-bindgen-backend" 883 + version = "0.2.87" 884 + source = "registry+https://github.com/rust-lang/crates.io-index" 885 + checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 886 + dependencies = [ 887 + "bumpalo", 888 + "log", 889 + "once_cell", 890 + "proc-macro2", 891 + "quote", 892 + "syn", 893 + "wasm-bindgen-shared", 894 + ] 895 + 896 + [[package]] 897 + name = "wasm-bindgen-futures" 898 + version = "0.4.37" 899 + source = "registry+https://github.com/rust-lang/crates.io-index" 900 + checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" 901 + dependencies = [ 902 + "cfg-if", 903 + "js-sys", 904 + "wasm-bindgen", 905 + "web-sys", 906 + ] 907 + 908 + [[package]] 909 + name = "wasm-bindgen-macro" 910 + version = "0.2.87" 911 + source = "registry+https://github.com/rust-lang/crates.io-index" 912 + checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 913 + dependencies = [ 914 + "quote", 915 + "wasm-bindgen-macro-support", 916 + ] 917 + 918 + [[package]] 919 + name = "wasm-bindgen-macro-support" 920 + version = "0.2.87" 921 + source = "registry+https://github.com/rust-lang/crates.io-index" 922 + checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 923 + dependencies = [ 924 + "proc-macro2", 925 + "quote", 926 + "syn", 927 + "wasm-bindgen-backend", 928 + "wasm-bindgen-shared", 929 + ] 930 + 931 + [[package]] 932 + name = "wasm-bindgen-shared" 933 + version = "0.2.87" 934 + source = "registry+https://github.com/rust-lang/crates.io-index" 935 + checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 936 + 937 + [[package]] 938 + name = "web-sys" 939 + version = "0.3.64" 940 + source = "registry+https://github.com/rust-lang/crates.io-index" 941 + checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" 942 + dependencies = [ 943 + "js-sys", 944 + "wasm-bindgen", 945 + ] 946 + 947 + [[package]] 948 + name = "winapi" 949 + version = "0.3.9" 950 + source = "registry+https://github.com/rust-lang/crates.io-index" 951 + checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 952 + dependencies = [ 953 + "winapi-i686-pc-windows-gnu", 954 + "winapi-x86_64-pc-windows-gnu", 955 + ] 956 + 957 + [[package]] 958 + name = "winapi-i686-pc-windows-gnu" 959 + version = "0.4.0" 960 + source = "registry+https://github.com/rust-lang/crates.io-index" 961 + checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 962 + 963 + [[package]] 964 + name = "winapi-x86_64-pc-windows-gnu" 965 + version = "0.4.0" 966 + source = "registry+https://github.com/rust-lang/crates.io-index" 967 + checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 968 + 969 + [[package]] 970 + name = "windows-sys" 971 + version = "0.48.0" 972 + source = "registry+https://github.com/rust-lang/crates.io-index" 973 + checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 974 + dependencies = [ 975 + "windows-targets", 976 + ] 977 + 978 + [[package]] 979 + name = "windows-targets" 980 + version = "0.48.1" 981 + source = "registry+https://github.com/rust-lang/crates.io-index" 982 + checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" 983 + dependencies = [ 984 + "windows_aarch64_gnullvm", 985 + "windows_aarch64_msvc", 986 + "windows_i686_gnu", 987 + "windows_i686_msvc", 988 + "windows_x86_64_gnu", 989 + "windows_x86_64_gnullvm", 990 + "windows_x86_64_msvc", 991 + ] 992 + 993 + [[package]] 994 + name = "windows_aarch64_gnullvm" 995 + version = "0.48.0" 996 + source = "registry+https://github.com/rust-lang/crates.io-index" 997 + checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 998 + 999 + [[package]] 1000 + name = "windows_aarch64_msvc" 1001 + version = "0.48.0" 1002 + source = "registry+https://github.com/rust-lang/crates.io-index" 1003 + checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1004 + 1005 + [[package]] 1006 + name = "windows_i686_gnu" 1007 + version = "0.48.0" 1008 + source = "registry+https://github.com/rust-lang/crates.io-index" 1009 + checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1010 + 1011 + [[package]] 1012 + name = "windows_i686_msvc" 1013 + version = "0.48.0" 1014 + source = "registry+https://github.com/rust-lang/crates.io-index" 1015 + checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1016 + 1017 + [[package]] 1018 + name = "windows_x86_64_gnu" 1019 + version = "0.48.0" 1020 + source = "registry+https://github.com/rust-lang/crates.io-index" 1021 + checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1022 + 1023 + [[package]] 1024 + name = "windows_x86_64_gnullvm" 1025 + version = "0.48.0" 1026 + source = "registry+https://github.com/rust-lang/crates.io-index" 1027 + checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 1028 + 1029 + [[package]] 1030 + name = "windows_x86_64_msvc" 1031 + version = "0.48.0" 1032 + source = "registry+https://github.com/rust-lang/crates.io-index" 1033 + checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 1034 + 1035 + [[package]] 1036 + name = "winreg" 1037 + version = "0.10.1" 1038 + source = "registry+https://github.com/rust-lang/crates.io-index" 1039 + checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 1040 + dependencies = [ 1041 + "winapi", 1042 + ]
+10
Cargo.toml
··· 1 + [package] 2 + name = "iss_locator" 3 + version = "0.1.0" 4 + edition = "2021" 5 + 6 + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 + 8 + [dependencies] 9 + reqwest = { version = "0.11.18",features = ["json","blocking"]} 10 + serde_json = "1.0.104"
+9
LICENSE
··· 1 + MIT License 2 + 3 + Copyright (c) <year> <copyright holders> 4 + 5 + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 + 7 + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 + 9 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+5
README.md
··· 1 + # ISS locator 2 + 3 + Borne out of an idea about Amature Radio, i wanted to have a utility that can quickly check if ISS is in visible and amature radio range to listen to. 4 + 5 + Your location is recieved from IP, ISS location from an API, plagiarized Haversine formula to check the distance between.
+74
src/lib.rs
··· 1 + use serde_json::Value; 2 + 3 + 4 + pub struct Location { 5 + pub lat: f64, 6 + pub long: f64, 7 + } 8 + 9 + impl Location { 10 + pub fn build(args: &[String]) -> Result<Location, &'static str> { 11 + if args.len() < 2{ 12 + println!("{}",args.len()); 13 + return Err("Not enough arguments"); 14 + } 15 + 16 + let lat: f64 = match args[0].parse::<f64>() { 17 + Ok(num) => 18 + if num >= -90.0 && num <= 90.0 { 19 + num 20 + } else { 21 + panic!("Invalid Lattitude: {num}") 22 + }, 23 + Err(e) => panic!("{:?}",e), 24 + }; 25 + 26 + let long: f64 = match args[1].parse::<f64>() { 27 + Ok(num) => 28 + if num >= -180.0 && num <= 180.0 { 29 + num 30 + } else { 31 + panic!("Invalid Longitude: {num}") 32 + }, 33 + Err(e) => panic!("{:?}",e), 34 + }; 35 + 36 + Ok(Location { lat,long }) 37 + } 38 + } 39 + 40 + pub fn get_distance(local: Location, distant: Location) -> f64 { 41 + let r:f64 = 6367.45; 42 + let delta_long = (local.long - distant.long).to_radians(); 43 + let delta_lat = (local.lat - distant.lat).to_radians(); 44 + 45 + let ang_inner = (delta_lat / 2.0).sin().powi(2) 46 + + local.lat.to_radians().cos() * distant.lat.to_radians().cos() * (delta_long / 2.0).sin().powi(2); 47 + let ang = 2.0 * ang_inner.sqrt().asin(); 48 + r*ang 49 + } 50 + 51 + pub fn get_iss_location() -> Result<[String;2],Box<dyn std::error::Error>>{ 52 + let object: Value = match reqwest::blocking::get("http://api.open-notify.org/iss-now.json")?.json::<serde_json::Value>() { 53 + Ok(object) => object["iss_position"].clone(), 54 + Err(e) => panic!("Error serializing json data: {e}"), 55 + }; 56 + 57 + let mut lat = object["latitude"].to_string(); 58 + lat.retain(|c| !r#"()":'"#.contains(c)); 59 + let mut long = object["longitude"].to_string(); 60 + long.retain(|c| !r#"()":'"#.contains(c)); 61 + Ok([lat,long]) 62 + } 63 + 64 + 65 + pub fn get_local_location() -> Result<[String;2],Box<dyn std::error::Error>>{ 66 + let object: Value = match reqwest::blocking::get("http://ip-api.com/json/")?.json::<serde_json::Value>() { 67 + Ok(object) => object.clone(), 68 + Err(e) => panic!("Error serializing json data: {e}"), 69 + }; 70 + 71 + let (lat,long) = (object["lat"].to_string(),object["lon"].to_string()); 72 + Ok([lat,long]) 73 + } 74 +
+35
src/main.rs
··· 1 + use std::process; 2 + use iss_locator::Location; 3 + 4 + fn main() { 5 + 6 + let iss_location = match iss_locator::get_iss_location() { 7 + Ok(string) => string, 8 + Err(e) => panic!("Iss location aquisition failure: {e}"), 9 + }; 10 + let local_location = match iss_locator::get_local_location() { 11 + Ok(string) => string, 12 + Err(e) => panic!("Local location aquisition failure: {e}"), 13 + }; 14 + 15 + let iss: Location = Location::build(&iss_location).unwrap_or_else(|err| { 16 + eprintln!("{err}"); 17 + process::exit(1); 18 + }); 19 + let local: Location = Location::build(&local_location).unwrap_or_else(|err| { 20 + eprintln!("{err}"); 21 + process::exit(1); 22 + }); 23 + 24 + 25 + 26 + println!("local:{},{}",local.lat,local.long); 27 + println!(" iss :{},{}",iss.lat,iss.long); 28 + let distance = iss_locator::get_distance(local,iss); 29 + println!("distance: {:.3} km",distance); 30 + if distance < 2246.6449 { 31 + println!("You are within ISS range"); 32 + } else { 33 + println!("Outside of ISS range"); 34 + } 35 + }