SQLite-backed Key / Value Store
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: added modes to the cli

added the skeletal work to get safir modes running.

+1489 -60
+1394 -38
Cargo.lock
··· 3 3 version = 3 4 4 5 5 [[package]] 6 + name = "addr2line" 7 + version = "0.22.0" 8 + source = "registry+https://github.com/rust-lang/crates.io-index" 9 + checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" 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 = "ahash" 22 + version = "0.8.11" 23 + source = "registry+https://github.com/rust-lang/crates.io-index" 24 + checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 25 + dependencies = [ 26 + "cfg-if", 27 + "getrandom", 28 + "once_cell", 29 + "version_check", 30 + "zerocopy", 31 + ] 32 + 33 + [[package]] 34 + name = "allocator-api2" 35 + version = "0.2.18" 36 + source = "registry+https://github.com/rust-lang/crates.io-index" 37 + checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" 38 + 39 + [[package]] 6 40 name = "anstream" 7 41 version = "0.3.2" 8 42 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 38 72 source = "registry+https://github.com/rust-lang/crates.io-index" 39 73 checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" 40 74 dependencies = [ 41 - "windows-sys", 75 + "windows-sys 0.48.0", 42 76 ] 43 77 44 78 [[package]] ··· 48 82 checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" 49 83 dependencies = [ 50 84 "anstyle", 51 - "windows-sys", 85 + "windows-sys 0.48.0", 52 86 ] 53 87 54 88 [[package]] ··· 58 92 checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" 59 93 60 94 [[package]] 95 + name = "atoi" 96 + version = "2.0.0" 97 + source = "registry+https://github.com/rust-lang/crates.io-index" 98 + checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" 99 + dependencies = [ 100 + "num-traits", 101 + ] 102 + 103 + [[package]] 104 + name = "autocfg" 105 + version = "1.3.0" 106 + source = "registry+https://github.com/rust-lang/crates.io-index" 107 + checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 108 + 109 + [[package]] 110 + name = "backtrace" 111 + version = "0.3.73" 112 + source = "registry+https://github.com/rust-lang/crates.io-index" 113 + checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" 114 + dependencies = [ 115 + "addr2line", 116 + "cc", 117 + "cfg-if", 118 + "libc", 119 + "miniz_oxide", 120 + "object", 121 + "rustc-demangle", 122 + ] 123 + 124 + [[package]] 125 + name = "base64" 126 + version = "0.21.7" 127 + source = "registry+https://github.com/rust-lang/crates.io-index" 128 + checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 129 + 130 + [[package]] 131 + name = "base64ct" 132 + version = "1.6.0" 133 + source = "registry+https://github.com/rust-lang/crates.io-index" 134 + checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" 135 + 136 + [[package]] 61 137 name = "bitflags" 62 138 version = "1.3.2" 63 139 source = "registry+https://github.com/rust-lang/crates.io-index" 64 140 checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 65 141 66 142 [[package]] 143 + name = "bitflags" 144 + version = "2.5.0" 145 + source = "registry+https://github.com/rust-lang/crates.io-index" 146 + checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 147 + dependencies = [ 148 + "serde", 149 + ] 150 + 151 + [[package]] 152 + name = "block-buffer" 153 + version = "0.10.4" 154 + source = "registry+https://github.com/rust-lang/crates.io-index" 155 + checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 156 + dependencies = [ 157 + "generic-array", 158 + ] 159 + 160 + [[package]] 161 + name = "byteorder" 162 + version = "1.5.0" 163 + source = "registry+https://github.com/rust-lang/crates.io-index" 164 + checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 165 + 166 + [[package]] 167 + name = "bytes" 168 + version = "1.6.0" 169 + source = "registry+https://github.com/rust-lang/crates.io-index" 170 + checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" 171 + 172 + [[package]] 67 173 name = "cc" 68 - version = "1.0.79" 174 + version = "1.0.99" 69 175 source = "registry+https://github.com/rust-lang/crates.io-index" 70 - checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 176 + checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" 71 177 72 178 [[package]] 73 179 name = "cfg-if" ··· 94 200 dependencies = [ 95 201 "anstream", 96 202 "anstyle", 97 - "bitflags", 203 + "bitflags 1.3.2", 98 204 "clap_lex", 99 205 "strsim", 100 206 ] ··· 108 214 "heck", 109 215 "proc-macro2", 110 216 "quote", 111 - "syn", 217 + "syn 2.0.66", 112 218 ] 113 219 114 220 [[package]] ··· 124 230 checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 125 231 126 232 [[package]] 233 + name = "const-oid" 234 + version = "0.9.6" 235 + source = "registry+https://github.com/rust-lang/crates.io-index" 236 + checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 237 + 238 + [[package]] 239 + name = "cpufeatures" 240 + version = "0.2.12" 241 + source = "registry+https://github.com/rust-lang/crates.io-index" 242 + checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 243 + dependencies = [ 244 + "libc", 245 + ] 246 + 247 + [[package]] 248 + name = "crc" 249 + version = "3.2.1" 250 + source = "registry+https://github.com/rust-lang/crates.io-index" 251 + checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" 252 + dependencies = [ 253 + "crc-catalog", 254 + ] 255 + 256 + [[package]] 257 + name = "crc-catalog" 258 + version = "2.4.0" 259 + source = "registry+https://github.com/rust-lang/crates.io-index" 260 + checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" 261 + 262 + [[package]] 263 + name = "crossbeam-queue" 264 + version = "0.3.11" 265 + source = "registry+https://github.com/rust-lang/crates.io-index" 266 + checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" 267 + dependencies = [ 268 + "crossbeam-utils", 269 + ] 270 + 271 + [[package]] 272 + name = "crossbeam-utils" 273 + version = "0.8.20" 274 + source = "registry+https://github.com/rust-lang/crates.io-index" 275 + checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" 276 + 277 + [[package]] 278 + name = "crypto-common" 279 + version = "0.1.6" 280 + source = "registry+https://github.com/rust-lang/crates.io-index" 281 + checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 282 + dependencies = [ 283 + "generic-array", 284 + "typenum", 285 + ] 286 + 287 + [[package]] 288 + name = "der" 289 + version = "0.7.9" 290 + source = "registry+https://github.com/rust-lang/crates.io-index" 291 + checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" 292 + dependencies = [ 293 + "const-oid", 294 + "pem-rfc7468", 295 + "zeroize", 296 + ] 297 + 298 + [[package]] 299 + name = "digest" 300 + version = "0.10.7" 301 + source = "registry+https://github.com/rust-lang/crates.io-index" 302 + checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 303 + dependencies = [ 304 + "block-buffer", 305 + "const-oid", 306 + "crypto-common", 307 + "subtle", 308 + ] 309 + 310 + [[package]] 127 311 name = "dirs" 128 312 version = "5.0.1" 129 313 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 141 325 "libc", 142 326 "option-ext", 143 327 "redox_users", 144 - "windows-sys", 328 + "windows-sys 0.48.0", 329 + ] 330 + 331 + [[package]] 332 + name = "dotenvy" 333 + version = "0.15.7" 334 + source = "registry+https://github.com/rust-lang/crates.io-index" 335 + checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" 336 + 337 + [[package]] 338 + name = "either" 339 + version = "1.12.0" 340 + source = "registry+https://github.com/rust-lang/crates.io-index" 341 + checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" 342 + dependencies = [ 343 + "serde", 145 344 ] 146 345 147 346 [[package]] 347 + name = "equivalent" 348 + version = "1.0.1" 349 + source = "registry+https://github.com/rust-lang/crates.io-index" 350 + checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 351 + 352 + [[package]] 148 353 name = "errno" 149 - version = "0.3.1" 354 + version = "0.3.9" 150 355 source = "registry+https://github.com/rust-lang/crates.io-index" 151 - checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 356 + checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 152 357 dependencies = [ 153 - "errno-dragonfly", 154 358 "libc", 155 - "windows-sys", 359 + "windows-sys 0.52.0", 360 + ] 361 + 362 + [[package]] 363 + name = "etcetera" 364 + version = "0.8.0" 365 + source = "registry+https://github.com/rust-lang/crates.io-index" 366 + checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" 367 + dependencies = [ 368 + "cfg-if", 369 + "home", 370 + "windows-sys 0.48.0", 371 + ] 372 + 373 + [[package]] 374 + name = "event-listener" 375 + version = "2.5.3" 376 + source = "registry+https://github.com/rust-lang/crates.io-index" 377 + checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" 378 + 379 + [[package]] 380 + name = "fastrand" 381 + version = "2.1.0" 382 + source = "registry+https://github.com/rust-lang/crates.io-index" 383 + checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" 384 + 385 + [[package]] 386 + name = "flume" 387 + version = "0.11.0" 388 + source = "registry+https://github.com/rust-lang/crates.io-index" 389 + checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" 390 + dependencies = [ 391 + "futures-core", 392 + "futures-sink", 393 + "spin 0.9.8", 394 + ] 395 + 396 + [[package]] 397 + name = "form_urlencoded" 398 + version = "1.2.1" 399 + source = "registry+https://github.com/rust-lang/crates.io-index" 400 + checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 401 + dependencies = [ 402 + "percent-encoding", 403 + ] 404 + 405 + [[package]] 406 + name = "futures-channel" 407 + version = "0.3.30" 408 + source = "registry+https://github.com/rust-lang/crates.io-index" 409 + checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 410 + dependencies = [ 411 + "futures-core", 412 + "futures-sink", 413 + ] 414 + 415 + [[package]] 416 + name = "futures-core" 417 + version = "0.3.30" 418 + source = "registry+https://github.com/rust-lang/crates.io-index" 419 + checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 420 + 421 + [[package]] 422 + name = "futures-executor" 423 + version = "0.3.30" 424 + source = "registry+https://github.com/rust-lang/crates.io-index" 425 + checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" 426 + dependencies = [ 427 + "futures-core", 428 + "futures-task", 429 + "futures-util", 430 + ] 431 + 432 + [[package]] 433 + name = "futures-intrusive" 434 + version = "0.5.0" 435 + source = "registry+https://github.com/rust-lang/crates.io-index" 436 + checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" 437 + dependencies = [ 438 + "futures-core", 439 + "lock_api", 440 + "parking_lot", 441 + ] 442 + 443 + [[package]] 444 + name = "futures-io" 445 + version = "0.3.30" 446 + source = "registry+https://github.com/rust-lang/crates.io-index" 447 + checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" 448 + 449 + [[package]] 450 + name = "futures-sink" 451 + version = "0.3.30" 452 + source = "registry+https://github.com/rust-lang/crates.io-index" 453 + checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 454 + 455 + [[package]] 456 + name = "futures-task" 457 + version = "0.3.30" 458 + source = "registry+https://github.com/rust-lang/crates.io-index" 459 + checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 460 + 461 + [[package]] 462 + name = "futures-util" 463 + version = "0.3.30" 464 + source = "registry+https://github.com/rust-lang/crates.io-index" 465 + checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 466 + dependencies = [ 467 + "futures-core", 468 + "futures-io", 469 + "futures-sink", 470 + "futures-task", 471 + "memchr", 472 + "pin-project-lite", 473 + "pin-utils", 474 + "slab", 156 475 ] 157 476 158 477 [[package]] 159 - name = "errno-dragonfly" 160 - version = "0.1.2" 478 + name = "generic-array" 479 + version = "0.14.7" 161 480 source = "registry+https://github.com/rust-lang/crates.io-index" 162 - checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 481 + checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 163 482 dependencies = [ 164 - "cc", 165 - "libc", 483 + "typenum", 484 + "version_check", 166 485 ] 167 486 168 487 [[package]] ··· 177 496 ] 178 497 179 498 [[package]] 499 + name = "gimli" 500 + version = "0.29.0" 501 + source = "registry+https://github.com/rust-lang/crates.io-index" 502 + checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" 503 + 504 + [[package]] 505 + name = "hashbrown" 506 + version = "0.14.5" 507 + source = "registry+https://github.com/rust-lang/crates.io-index" 508 + checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 509 + dependencies = [ 510 + "ahash", 511 + "allocator-api2", 512 + ] 513 + 514 + [[package]] 515 + name = "hashlink" 516 + version = "0.8.4" 517 + source = "registry+https://github.com/rust-lang/crates.io-index" 518 + checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" 519 + dependencies = [ 520 + "hashbrown", 521 + ] 522 + 523 + [[package]] 180 524 name = "heck" 181 525 version = "0.4.1" 182 526 source = "registry+https://github.com/rust-lang/crates.io-index" 183 527 checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 528 + dependencies = [ 529 + "unicode-segmentation", 530 + ] 184 531 185 532 [[package]] 186 533 name = "hermit-abi" ··· 189 536 checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" 190 537 191 538 [[package]] 539 + name = "hex" 540 + version = "0.4.3" 541 + source = "registry+https://github.com/rust-lang/crates.io-index" 542 + checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 543 + 544 + [[package]] 545 + name = "hkdf" 546 + version = "0.12.4" 547 + source = "registry+https://github.com/rust-lang/crates.io-index" 548 + checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" 549 + dependencies = [ 550 + "hmac", 551 + ] 552 + 553 + [[package]] 554 + name = "hmac" 555 + version = "0.12.1" 556 + source = "registry+https://github.com/rust-lang/crates.io-index" 557 + checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 558 + dependencies = [ 559 + "digest", 560 + ] 561 + 562 + [[package]] 563 + name = "home" 564 + version = "0.5.9" 565 + source = "registry+https://github.com/rust-lang/crates.io-index" 566 + checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" 567 + dependencies = [ 568 + "windows-sys 0.52.0", 569 + ] 570 + 571 + [[package]] 572 + name = "idna" 573 + version = "0.5.0" 574 + source = "registry+https://github.com/rust-lang/crates.io-index" 575 + checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 576 + dependencies = [ 577 + "unicode-bidi", 578 + "unicode-normalization", 579 + ] 580 + 581 + [[package]] 582 + name = "indexmap" 583 + version = "2.2.6" 584 + source = "registry+https://github.com/rust-lang/crates.io-index" 585 + checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" 586 + dependencies = [ 587 + "equivalent", 588 + "hashbrown", 589 + ] 590 + 591 + [[package]] 192 592 name = "io-lifetimes" 193 593 version = "1.0.11" 194 594 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 196 596 dependencies = [ 197 597 "hermit-abi", 198 598 "libc", 199 - "windows-sys", 599 + "windows-sys 0.48.0", 200 600 ] 201 601 202 602 [[package]] ··· 207 607 dependencies = [ 208 608 "hermit-abi", 209 609 "io-lifetimes", 210 - "rustix", 211 - "windows-sys", 610 + "rustix 0.37.19", 611 + "windows-sys 0.48.0", 212 612 ] 213 613 214 614 [[package]] ··· 218 618 checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 219 619 220 620 [[package]] 621 + name = "lazy_static" 622 + version = "1.4.0" 623 + source = "registry+https://github.com/rust-lang/crates.io-index" 624 + checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 625 + dependencies = [ 626 + "spin 0.5.2", 627 + ] 628 + 629 + [[package]] 221 630 name = "libc" 222 - version = "0.2.144" 631 + version = "0.2.155" 632 + source = "registry+https://github.com/rust-lang/crates.io-index" 633 + checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 634 + 635 + [[package]] 636 + name = "libm" 637 + version = "0.2.8" 638 + source = "registry+https://github.com/rust-lang/crates.io-index" 639 + checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" 640 + 641 + [[package]] 642 + name = "libsqlite3-sys" 643 + version = "0.27.0" 223 644 source = "registry+https://github.com/rust-lang/crates.io-index" 224 - checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" 645 + checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" 646 + dependencies = [ 647 + "cc", 648 + "pkg-config", 649 + "vcpkg", 650 + ] 225 651 226 652 [[package]] 227 653 name = "linux-raw-sys" ··· 230 656 checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" 231 657 232 658 [[package]] 659 + name = "linux-raw-sys" 660 + version = "0.4.14" 661 + source = "registry+https://github.com/rust-lang/crates.io-index" 662 + checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 663 + 664 + [[package]] 665 + name = "lock_api" 666 + version = "0.4.12" 667 + source = "registry+https://github.com/rust-lang/crates.io-index" 668 + checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 669 + dependencies = [ 670 + "autocfg", 671 + "scopeguard", 672 + ] 673 + 674 + [[package]] 675 + name = "log" 676 + version = "0.4.21" 677 + source = "registry+https://github.com/rust-lang/crates.io-index" 678 + checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 679 + 680 + [[package]] 681 + name = "md-5" 682 + version = "0.10.6" 683 + source = "registry+https://github.com/rust-lang/crates.io-index" 684 + checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" 685 + dependencies = [ 686 + "cfg-if", 687 + "digest", 688 + ] 689 + 690 + [[package]] 691 + name = "memchr" 692 + version = "2.7.4" 693 + source = "registry+https://github.com/rust-lang/crates.io-index" 694 + checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 695 + 696 + [[package]] 697 + name = "minimal-lexical" 698 + version = "0.2.1" 699 + source = "registry+https://github.com/rust-lang/crates.io-index" 700 + checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 701 + 702 + [[package]] 703 + name = "miniz_oxide" 704 + version = "0.7.4" 705 + source = "registry+https://github.com/rust-lang/crates.io-index" 706 + checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" 707 + dependencies = [ 708 + "adler", 709 + ] 710 + 711 + [[package]] 712 + name = "mio" 713 + version = "0.8.11" 714 + source = "registry+https://github.com/rust-lang/crates.io-index" 715 + checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" 716 + dependencies = [ 717 + "libc", 718 + "wasi", 719 + "windows-sys 0.48.0", 720 + ] 721 + 722 + [[package]] 723 + name = "nom" 724 + version = "7.1.3" 725 + source = "registry+https://github.com/rust-lang/crates.io-index" 726 + checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 727 + dependencies = [ 728 + "memchr", 729 + "minimal-lexical", 730 + ] 731 + 732 + [[package]] 733 + name = "num-bigint-dig" 734 + version = "0.8.4" 735 + source = "registry+https://github.com/rust-lang/crates.io-index" 736 + checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" 737 + dependencies = [ 738 + "byteorder", 739 + "lazy_static", 740 + "libm", 741 + "num-integer", 742 + "num-iter", 743 + "num-traits", 744 + "rand", 745 + "smallvec", 746 + "zeroize", 747 + ] 748 + 749 + [[package]] 750 + name = "num-integer" 751 + version = "0.1.46" 752 + source = "registry+https://github.com/rust-lang/crates.io-index" 753 + checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 754 + dependencies = [ 755 + "num-traits", 756 + ] 757 + 758 + [[package]] 759 + name = "num-iter" 760 + version = "0.1.45" 761 + source = "registry+https://github.com/rust-lang/crates.io-index" 762 + checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" 763 + dependencies = [ 764 + "autocfg", 765 + "num-integer", 766 + "num-traits", 767 + ] 768 + 769 + [[package]] 770 + name = "num-traits" 771 + version = "0.2.19" 772 + source = "registry+https://github.com/rust-lang/crates.io-index" 773 + checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 774 + dependencies = [ 775 + "autocfg", 776 + "libm", 777 + ] 778 + 779 + [[package]] 780 + name = "num_cpus" 781 + version = "1.16.0" 782 + source = "registry+https://github.com/rust-lang/crates.io-index" 783 + checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 784 + dependencies = [ 785 + "hermit-abi", 786 + "libc", 787 + ] 788 + 789 + [[package]] 790 + name = "object" 791 + version = "0.36.0" 792 + source = "registry+https://github.com/rust-lang/crates.io-index" 793 + checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" 794 + dependencies = [ 795 + "memchr", 796 + ] 797 + 798 + [[package]] 233 799 name = "once_cell" 234 - version = "1.17.2" 800 + version = "1.19.0" 235 801 source = "registry+https://github.com/rust-lang/crates.io-index" 236 - checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" 802 + checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 237 803 238 804 [[package]] 239 805 name = "option-ext" ··· 242 808 checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 243 809 244 810 [[package]] 811 + name = "parking_lot" 812 + version = "0.12.3" 813 + source = "registry+https://github.com/rust-lang/crates.io-index" 814 + checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 815 + dependencies = [ 816 + "lock_api", 817 + "parking_lot_core", 818 + ] 819 + 820 + [[package]] 821 + name = "parking_lot_core" 822 + version = "0.9.10" 823 + source = "registry+https://github.com/rust-lang/crates.io-index" 824 + checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 825 + dependencies = [ 826 + "cfg-if", 827 + "libc", 828 + "redox_syscall 0.5.2", 829 + "smallvec", 830 + "windows-targets 0.52.5", 831 + ] 832 + 833 + [[package]] 834 + name = "paste" 835 + version = "1.0.15" 836 + source = "registry+https://github.com/rust-lang/crates.io-index" 837 + checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 838 + 839 + [[package]] 840 + name = "pem-rfc7468" 841 + version = "0.7.0" 842 + source = "registry+https://github.com/rust-lang/crates.io-index" 843 + checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" 844 + dependencies = [ 845 + "base64ct", 846 + ] 847 + 848 + [[package]] 849 + name = "percent-encoding" 850 + version = "2.3.1" 851 + source = "registry+https://github.com/rust-lang/crates.io-index" 852 + checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 853 + 854 + [[package]] 855 + name = "pin-project-lite" 856 + version = "0.2.14" 857 + source = "registry+https://github.com/rust-lang/crates.io-index" 858 + checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 859 + 860 + [[package]] 861 + name = "pin-utils" 862 + version = "0.1.0" 863 + source = "registry+https://github.com/rust-lang/crates.io-index" 864 + checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 865 + 866 + [[package]] 867 + name = "pkcs1" 868 + version = "0.7.5" 869 + source = "registry+https://github.com/rust-lang/crates.io-index" 870 + checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" 871 + dependencies = [ 872 + "der", 873 + "pkcs8", 874 + "spki", 875 + ] 876 + 877 + [[package]] 878 + name = "pkcs8" 879 + version = "0.10.2" 880 + source = "registry+https://github.com/rust-lang/crates.io-index" 881 + checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" 882 + dependencies = [ 883 + "der", 884 + "spki", 885 + ] 886 + 887 + [[package]] 888 + name = "pkg-config" 889 + version = "0.3.30" 890 + source = "registry+https://github.com/rust-lang/crates.io-index" 891 + checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" 892 + 893 + [[package]] 894 + name = "ppv-lite86" 895 + version = "0.2.17" 896 + source = "registry+https://github.com/rust-lang/crates.io-index" 897 + checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 898 + 899 + [[package]] 245 900 name = "proc-macro2" 246 901 version = "1.0.85" 247 902 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 260 915 ] 261 916 262 917 [[package]] 918 + name = "rand" 919 + version = "0.8.5" 920 + source = "registry+https://github.com/rust-lang/crates.io-index" 921 + checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 922 + dependencies = [ 923 + "libc", 924 + "rand_chacha", 925 + "rand_core", 926 + ] 927 + 928 + [[package]] 929 + name = "rand_chacha" 930 + version = "0.3.1" 931 + source = "registry+https://github.com/rust-lang/crates.io-index" 932 + checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 933 + dependencies = [ 934 + "ppv-lite86", 935 + "rand_core", 936 + ] 937 + 938 + [[package]] 939 + name = "rand_core" 940 + version = "0.6.4" 941 + source = "registry+https://github.com/rust-lang/crates.io-index" 942 + checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 943 + dependencies = [ 944 + "getrandom", 945 + ] 946 + 947 + [[package]] 263 948 name = "redox_syscall" 264 949 version = "0.2.16" 265 950 source = "registry+https://github.com/rust-lang/crates.io-index" 266 951 checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 267 952 dependencies = [ 268 - "bitflags", 953 + "bitflags 1.3.2", 954 + ] 955 + 956 + [[package]] 957 + name = "redox_syscall" 958 + version = "0.4.1" 959 + source = "registry+https://github.com/rust-lang/crates.io-index" 960 + checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 961 + dependencies = [ 962 + "bitflags 1.3.2", 963 + ] 964 + 965 + [[package]] 966 + name = "redox_syscall" 967 + version = "0.5.2" 968 + source = "registry+https://github.com/rust-lang/crates.io-index" 969 + checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" 970 + dependencies = [ 971 + "bitflags 2.5.0", 269 972 ] 270 973 271 974 [[package]] ··· 275 978 checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 276 979 dependencies = [ 277 980 "getrandom", 278 - "redox_syscall", 981 + "redox_syscall 0.2.16", 279 982 "thiserror", 280 983 ] 281 984 282 985 [[package]] 986 + name = "rsa" 987 + version = "0.9.6" 988 + source = "registry+https://github.com/rust-lang/crates.io-index" 989 + checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" 990 + dependencies = [ 991 + "const-oid", 992 + "digest", 993 + "num-bigint-dig", 994 + "num-integer", 995 + "num-traits", 996 + "pkcs1", 997 + "pkcs8", 998 + "rand_core", 999 + "signature", 1000 + "spki", 1001 + "subtle", 1002 + "zeroize", 1003 + ] 1004 + 1005 + [[package]] 1006 + name = "rustc-demangle" 1007 + version = "0.1.24" 1008 + source = "registry+https://github.com/rust-lang/crates.io-index" 1009 + checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 1010 + 1011 + [[package]] 283 1012 name = "rustix" 284 1013 version = "0.37.19" 285 1014 source = "registry+https://github.com/rust-lang/crates.io-index" 286 1015 checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" 287 1016 dependencies = [ 288 - "bitflags", 1017 + "bitflags 1.3.2", 289 1018 "errno", 290 1019 "io-lifetimes", 291 1020 "libc", 292 - "linux-raw-sys", 293 - "windows-sys", 1021 + "linux-raw-sys 0.3.8", 1022 + "windows-sys 0.48.0", 1023 + ] 1024 + 1025 + [[package]] 1026 + name = "rustix" 1027 + version = "0.38.34" 1028 + source = "registry+https://github.com/rust-lang/crates.io-index" 1029 + checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" 1030 + dependencies = [ 1031 + "bitflags 2.5.0", 1032 + "errno", 1033 + "libc", 1034 + "linux-raw-sys 0.4.14", 1035 + "windows-sys 0.52.0", 294 1036 ] 295 1037 296 1038 [[package]] ··· 306 1048 "anyhow", 307 1049 "clap", 308 1050 "dirs", 1051 + "serde", 309 1052 "serde_json", 1053 + "sqlx", 1054 + "tokio", 310 1055 ] 311 1056 312 1057 [[package]] 1058 + name = "scopeguard" 1059 + version = "1.2.0" 1060 + source = "registry+https://github.com/rust-lang/crates.io-index" 1061 + checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1062 + 1063 + [[package]] 313 1064 name = "serde" 314 1065 version = "1.0.203" 315 1066 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 326 1077 dependencies = [ 327 1078 "proc-macro2", 328 1079 "quote", 329 - "syn", 1080 + "syn 2.0.66", 330 1081 ] 331 1082 332 1083 [[package]] ··· 341 1092 ] 342 1093 343 1094 [[package]] 1095 + name = "sha1" 1096 + version = "0.10.6" 1097 + source = "registry+https://github.com/rust-lang/crates.io-index" 1098 + checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 1099 + dependencies = [ 1100 + "cfg-if", 1101 + "cpufeatures", 1102 + "digest", 1103 + ] 1104 + 1105 + [[package]] 1106 + name = "sha2" 1107 + version = "0.10.8" 1108 + source = "registry+https://github.com/rust-lang/crates.io-index" 1109 + checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 1110 + dependencies = [ 1111 + "cfg-if", 1112 + "cpufeatures", 1113 + "digest", 1114 + ] 1115 + 1116 + [[package]] 1117 + name = "signal-hook-registry" 1118 + version = "1.4.2" 1119 + source = "registry+https://github.com/rust-lang/crates.io-index" 1120 + checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 1121 + dependencies = [ 1122 + "libc", 1123 + ] 1124 + 1125 + [[package]] 1126 + name = "signature" 1127 + version = "2.2.0" 1128 + source = "registry+https://github.com/rust-lang/crates.io-index" 1129 + checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 1130 + dependencies = [ 1131 + "digest", 1132 + "rand_core", 1133 + ] 1134 + 1135 + [[package]] 1136 + name = "slab" 1137 + version = "0.4.9" 1138 + source = "registry+https://github.com/rust-lang/crates.io-index" 1139 + checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1140 + dependencies = [ 1141 + "autocfg", 1142 + ] 1143 + 1144 + [[package]] 1145 + name = "smallvec" 1146 + version = "1.13.2" 1147 + source = "registry+https://github.com/rust-lang/crates.io-index" 1148 + checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1149 + 1150 + [[package]] 1151 + name = "socket2" 1152 + version = "0.5.7" 1153 + source = "registry+https://github.com/rust-lang/crates.io-index" 1154 + checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 1155 + dependencies = [ 1156 + "libc", 1157 + "windows-sys 0.52.0", 1158 + ] 1159 + 1160 + [[package]] 1161 + name = "spin" 1162 + version = "0.5.2" 1163 + source = "registry+https://github.com/rust-lang/crates.io-index" 1164 + checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 1165 + 1166 + [[package]] 1167 + name = "spin" 1168 + version = "0.9.8" 1169 + source = "registry+https://github.com/rust-lang/crates.io-index" 1170 + checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1171 + dependencies = [ 1172 + "lock_api", 1173 + ] 1174 + 1175 + [[package]] 1176 + name = "spki" 1177 + version = "0.7.3" 1178 + source = "registry+https://github.com/rust-lang/crates.io-index" 1179 + checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" 1180 + dependencies = [ 1181 + "base64ct", 1182 + "der", 1183 + ] 1184 + 1185 + [[package]] 1186 + name = "sqlformat" 1187 + version = "0.2.4" 1188 + source = "registry+https://github.com/rust-lang/crates.io-index" 1189 + checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" 1190 + dependencies = [ 1191 + "nom", 1192 + "unicode_categories", 1193 + ] 1194 + 1195 + [[package]] 1196 + name = "sqlx" 1197 + version = "0.7.4" 1198 + source = "registry+https://github.com/rust-lang/crates.io-index" 1199 + checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" 1200 + dependencies = [ 1201 + "sqlx-core", 1202 + "sqlx-macros", 1203 + "sqlx-mysql", 1204 + "sqlx-postgres", 1205 + "sqlx-sqlite", 1206 + ] 1207 + 1208 + [[package]] 1209 + name = "sqlx-core" 1210 + version = "0.7.4" 1211 + source = "registry+https://github.com/rust-lang/crates.io-index" 1212 + checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" 1213 + dependencies = [ 1214 + "ahash", 1215 + "atoi", 1216 + "byteorder", 1217 + "bytes", 1218 + "crc", 1219 + "crossbeam-queue", 1220 + "either", 1221 + "event-listener", 1222 + "futures-channel", 1223 + "futures-core", 1224 + "futures-intrusive", 1225 + "futures-io", 1226 + "futures-util", 1227 + "hashlink", 1228 + "hex", 1229 + "indexmap", 1230 + "log", 1231 + "memchr", 1232 + "once_cell", 1233 + "paste", 1234 + "percent-encoding", 1235 + "serde", 1236 + "serde_json", 1237 + "sha2", 1238 + "smallvec", 1239 + "sqlformat", 1240 + "thiserror", 1241 + "tokio", 1242 + "tokio-stream", 1243 + "tracing", 1244 + "url", 1245 + ] 1246 + 1247 + [[package]] 1248 + name = "sqlx-macros" 1249 + version = "0.7.4" 1250 + source = "registry+https://github.com/rust-lang/crates.io-index" 1251 + checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" 1252 + dependencies = [ 1253 + "proc-macro2", 1254 + "quote", 1255 + "sqlx-core", 1256 + "sqlx-macros-core", 1257 + "syn 1.0.109", 1258 + ] 1259 + 1260 + [[package]] 1261 + name = "sqlx-macros-core" 1262 + version = "0.7.4" 1263 + source = "registry+https://github.com/rust-lang/crates.io-index" 1264 + checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" 1265 + dependencies = [ 1266 + "dotenvy", 1267 + "either", 1268 + "heck", 1269 + "hex", 1270 + "once_cell", 1271 + "proc-macro2", 1272 + "quote", 1273 + "serde", 1274 + "serde_json", 1275 + "sha2", 1276 + "sqlx-core", 1277 + "sqlx-mysql", 1278 + "sqlx-sqlite", 1279 + "syn 1.0.109", 1280 + "tempfile", 1281 + "tokio", 1282 + "url", 1283 + ] 1284 + 1285 + [[package]] 1286 + name = "sqlx-mysql" 1287 + version = "0.7.4" 1288 + source = "registry+https://github.com/rust-lang/crates.io-index" 1289 + checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" 1290 + dependencies = [ 1291 + "atoi", 1292 + "base64", 1293 + "bitflags 2.5.0", 1294 + "byteorder", 1295 + "bytes", 1296 + "crc", 1297 + "digest", 1298 + "dotenvy", 1299 + "either", 1300 + "futures-channel", 1301 + "futures-core", 1302 + "futures-io", 1303 + "futures-util", 1304 + "generic-array", 1305 + "hex", 1306 + "hkdf", 1307 + "hmac", 1308 + "itoa", 1309 + "log", 1310 + "md-5", 1311 + "memchr", 1312 + "once_cell", 1313 + "percent-encoding", 1314 + "rand", 1315 + "rsa", 1316 + "serde", 1317 + "sha1", 1318 + "sha2", 1319 + "smallvec", 1320 + "sqlx-core", 1321 + "stringprep", 1322 + "thiserror", 1323 + "tracing", 1324 + "whoami", 1325 + ] 1326 + 1327 + [[package]] 1328 + name = "sqlx-postgres" 1329 + version = "0.7.4" 1330 + source = "registry+https://github.com/rust-lang/crates.io-index" 1331 + checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" 1332 + dependencies = [ 1333 + "atoi", 1334 + "base64", 1335 + "bitflags 2.5.0", 1336 + "byteorder", 1337 + "crc", 1338 + "dotenvy", 1339 + "etcetera", 1340 + "futures-channel", 1341 + "futures-core", 1342 + "futures-io", 1343 + "futures-util", 1344 + "hex", 1345 + "hkdf", 1346 + "hmac", 1347 + "home", 1348 + "itoa", 1349 + "log", 1350 + "md-5", 1351 + "memchr", 1352 + "once_cell", 1353 + "rand", 1354 + "serde", 1355 + "serde_json", 1356 + "sha2", 1357 + "smallvec", 1358 + "sqlx-core", 1359 + "stringprep", 1360 + "thiserror", 1361 + "tracing", 1362 + "whoami", 1363 + ] 1364 + 1365 + [[package]] 1366 + name = "sqlx-sqlite" 1367 + version = "0.7.4" 1368 + source = "registry+https://github.com/rust-lang/crates.io-index" 1369 + checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" 1370 + dependencies = [ 1371 + "atoi", 1372 + "flume", 1373 + "futures-channel", 1374 + "futures-core", 1375 + "futures-executor", 1376 + "futures-intrusive", 1377 + "futures-util", 1378 + "libsqlite3-sys", 1379 + "log", 1380 + "percent-encoding", 1381 + "serde", 1382 + "sqlx-core", 1383 + "tracing", 1384 + "url", 1385 + "urlencoding", 1386 + ] 1387 + 1388 + [[package]] 1389 + name = "stringprep" 1390 + version = "0.1.5" 1391 + source = "registry+https://github.com/rust-lang/crates.io-index" 1392 + checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" 1393 + dependencies = [ 1394 + "unicode-bidi", 1395 + "unicode-normalization", 1396 + "unicode-properties", 1397 + ] 1398 + 1399 + [[package]] 344 1400 name = "strsim" 345 1401 version = "0.10.0" 346 1402 source = "registry+https://github.com/rust-lang/crates.io-index" 347 1403 checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 348 1404 349 1405 [[package]] 1406 + name = "subtle" 1407 + version = "2.6.0" 1408 + source = "registry+https://github.com/rust-lang/crates.io-index" 1409 + checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" 1410 + 1411 + [[package]] 1412 + name = "syn" 1413 + version = "1.0.109" 1414 + source = "registry+https://github.com/rust-lang/crates.io-index" 1415 + checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1416 + dependencies = [ 1417 + "proc-macro2", 1418 + "quote", 1419 + "unicode-ident", 1420 + ] 1421 + 1422 + [[package]] 350 1423 name = "syn" 351 1424 version = "2.0.66" 352 1425 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 358 1431 ] 359 1432 360 1433 [[package]] 1434 + name = "tempfile" 1435 + version = "3.10.1" 1436 + source = "registry+https://github.com/rust-lang/crates.io-index" 1437 + checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" 1438 + dependencies = [ 1439 + "cfg-if", 1440 + "fastrand", 1441 + "rustix 0.38.34", 1442 + "windows-sys 0.52.0", 1443 + ] 1444 + 1445 + [[package]] 361 1446 name = "thiserror" 362 1447 version = "1.0.40" 363 1448 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 374 1459 dependencies = [ 375 1460 "proc-macro2", 376 1461 "quote", 377 - "syn", 1462 + "syn 2.0.66", 1463 + ] 1464 + 1465 + [[package]] 1466 + name = "tinyvec" 1467 + version = "1.6.0" 1468 + source = "registry+https://github.com/rust-lang/crates.io-index" 1469 + checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1470 + dependencies = [ 1471 + "tinyvec_macros", 1472 + ] 1473 + 1474 + [[package]] 1475 + name = "tinyvec_macros" 1476 + version = "0.1.1" 1477 + source = "registry+https://github.com/rust-lang/crates.io-index" 1478 + checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1479 + 1480 + [[package]] 1481 + name = "tokio" 1482 + version = "1.38.0" 1483 + source = "registry+https://github.com/rust-lang/crates.io-index" 1484 + checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" 1485 + dependencies = [ 1486 + "backtrace", 1487 + "bytes", 1488 + "libc", 1489 + "mio", 1490 + "num_cpus", 1491 + "parking_lot", 1492 + "pin-project-lite", 1493 + "signal-hook-registry", 1494 + "socket2", 1495 + "tokio-macros", 1496 + "windows-sys 0.48.0", 1497 + ] 1498 + 1499 + [[package]] 1500 + name = "tokio-macros" 1501 + version = "2.3.0" 1502 + source = "registry+https://github.com/rust-lang/crates.io-index" 1503 + checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" 1504 + dependencies = [ 1505 + "proc-macro2", 1506 + "quote", 1507 + "syn 2.0.66", 1508 + ] 1509 + 1510 + [[package]] 1511 + name = "tokio-stream" 1512 + version = "0.1.15" 1513 + source = "registry+https://github.com/rust-lang/crates.io-index" 1514 + checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" 1515 + dependencies = [ 1516 + "futures-core", 1517 + "pin-project-lite", 1518 + "tokio", 1519 + ] 1520 + 1521 + [[package]] 1522 + name = "tracing" 1523 + version = "0.1.40" 1524 + source = "registry+https://github.com/rust-lang/crates.io-index" 1525 + checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1526 + dependencies = [ 1527 + "log", 1528 + "pin-project-lite", 1529 + "tracing-attributes", 1530 + "tracing-core", 378 1531 ] 379 1532 380 1533 [[package]] 1534 + name = "tracing-attributes" 1535 + version = "0.1.27" 1536 + source = "registry+https://github.com/rust-lang/crates.io-index" 1537 + checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 1538 + dependencies = [ 1539 + "proc-macro2", 1540 + "quote", 1541 + "syn 2.0.66", 1542 + ] 1543 + 1544 + [[package]] 1545 + name = "tracing-core" 1546 + version = "0.1.32" 1547 + source = "registry+https://github.com/rust-lang/crates.io-index" 1548 + checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1549 + dependencies = [ 1550 + "once_cell", 1551 + ] 1552 + 1553 + [[package]] 1554 + name = "typenum" 1555 + version = "1.17.0" 1556 + source = "registry+https://github.com/rust-lang/crates.io-index" 1557 + checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1558 + 1559 + [[package]] 1560 + name = "unicode-bidi" 1561 + version = "0.3.15" 1562 + source = "registry+https://github.com/rust-lang/crates.io-index" 1563 + checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" 1564 + 1565 + [[package]] 381 1566 name = "unicode-ident" 382 1567 version = "1.0.9" 383 1568 source = "registry+https://github.com/rust-lang/crates.io-index" 384 1569 checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" 385 1570 386 1571 [[package]] 1572 + name = "unicode-normalization" 1573 + version = "0.1.23" 1574 + source = "registry+https://github.com/rust-lang/crates.io-index" 1575 + checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" 1576 + dependencies = [ 1577 + "tinyvec", 1578 + ] 1579 + 1580 + [[package]] 1581 + name = "unicode-properties" 1582 + version = "0.1.1" 1583 + source = "registry+https://github.com/rust-lang/crates.io-index" 1584 + checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" 1585 + 1586 + [[package]] 1587 + name = "unicode-segmentation" 1588 + version = "1.11.0" 1589 + source = "registry+https://github.com/rust-lang/crates.io-index" 1590 + checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" 1591 + 1592 + [[package]] 1593 + name = "unicode_categories" 1594 + version = "0.1.1" 1595 + source = "registry+https://github.com/rust-lang/crates.io-index" 1596 + checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" 1597 + 1598 + [[package]] 1599 + name = "url" 1600 + version = "2.5.2" 1601 + source = "registry+https://github.com/rust-lang/crates.io-index" 1602 + checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" 1603 + dependencies = [ 1604 + "form_urlencoded", 1605 + "idna", 1606 + "percent-encoding", 1607 + ] 1608 + 1609 + [[package]] 1610 + name = "urlencoding" 1611 + version = "2.1.3" 1612 + source = "registry+https://github.com/rust-lang/crates.io-index" 1613 + checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" 1614 + 1615 + [[package]] 387 1616 name = "utf8parse" 388 1617 version = "0.2.1" 389 1618 source = "registry+https://github.com/rust-lang/crates.io-index" 390 1619 checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 391 1620 392 1621 [[package]] 1622 + name = "vcpkg" 1623 + version = "0.2.15" 1624 + source = "registry+https://github.com/rust-lang/crates.io-index" 1625 + checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1626 + 1627 + [[package]] 1628 + name = "version_check" 1629 + version = "0.9.4" 1630 + source = "registry+https://github.com/rust-lang/crates.io-index" 1631 + checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1632 + 1633 + [[package]] 393 1634 name = "wasi" 394 1635 version = "0.11.0+wasi-snapshot-preview1" 395 1636 source = "registry+https://github.com/rust-lang/crates.io-index" 396 1637 checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 397 1638 398 1639 [[package]] 1640 + name = "wasite" 1641 + version = "0.1.0" 1642 + source = "registry+https://github.com/rust-lang/crates.io-index" 1643 + checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" 1644 + 1645 + [[package]] 1646 + name = "whoami" 1647 + version = "1.5.1" 1648 + source = "registry+https://github.com/rust-lang/crates.io-index" 1649 + checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" 1650 + dependencies = [ 1651 + "redox_syscall 0.4.1", 1652 + "wasite", 1653 + ] 1654 + 1655 + [[package]] 399 1656 name = "windows-sys" 400 1657 version = "0.48.0" 401 1658 source = "registry+https://github.com/rust-lang/crates.io-index" 402 1659 checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 403 1660 dependencies = [ 404 - "windows-targets", 1661 + "windows-targets 0.48.0", 1662 + ] 1663 + 1664 + [[package]] 1665 + name = "windows-sys" 1666 + version = "0.52.0" 1667 + source = "registry+https://github.com/rust-lang/crates.io-index" 1668 + checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1669 + dependencies = [ 1670 + "windows-targets 0.52.5", 405 1671 ] 406 1672 407 1673 [[package]] ··· 410 1676 source = "registry+https://github.com/rust-lang/crates.io-index" 411 1677 checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" 412 1678 dependencies = [ 413 - "windows_aarch64_gnullvm", 414 - "windows_aarch64_msvc", 415 - "windows_i686_gnu", 416 - "windows_i686_msvc", 417 - "windows_x86_64_gnu", 418 - "windows_x86_64_gnullvm", 419 - "windows_x86_64_msvc", 1679 + "windows_aarch64_gnullvm 0.48.0", 1680 + "windows_aarch64_msvc 0.48.0", 1681 + "windows_i686_gnu 0.48.0", 1682 + "windows_i686_msvc 0.48.0", 1683 + "windows_x86_64_gnu 0.48.0", 1684 + "windows_x86_64_gnullvm 0.48.0", 1685 + "windows_x86_64_msvc 0.48.0", 1686 + ] 1687 + 1688 + [[package]] 1689 + name = "windows-targets" 1690 + version = "0.52.5" 1691 + source = "registry+https://github.com/rust-lang/crates.io-index" 1692 + checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 1693 + dependencies = [ 1694 + "windows_aarch64_gnullvm 0.52.5", 1695 + "windows_aarch64_msvc 0.52.5", 1696 + "windows_i686_gnu 0.52.5", 1697 + "windows_i686_gnullvm", 1698 + "windows_i686_msvc 0.52.5", 1699 + "windows_x86_64_gnu 0.52.5", 1700 + "windows_x86_64_gnullvm 0.52.5", 1701 + "windows_x86_64_msvc 0.52.5", 420 1702 ] 421 1703 422 1704 [[package]] ··· 426 1708 checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 427 1709 428 1710 [[package]] 1711 + name = "windows_aarch64_gnullvm" 1712 + version = "0.52.5" 1713 + source = "registry+https://github.com/rust-lang/crates.io-index" 1714 + checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" 1715 + 1716 + [[package]] 429 1717 name = "windows_aarch64_msvc" 430 1718 version = "0.48.0" 431 1719 source = "registry+https://github.com/rust-lang/crates.io-index" 432 1720 checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 433 1721 434 1722 [[package]] 1723 + name = "windows_aarch64_msvc" 1724 + version = "0.52.5" 1725 + source = "registry+https://github.com/rust-lang/crates.io-index" 1726 + checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" 1727 + 1728 + [[package]] 435 1729 name = "windows_i686_gnu" 436 1730 version = "0.48.0" 437 1731 source = "registry+https://github.com/rust-lang/crates.io-index" 438 1732 checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 439 1733 440 1734 [[package]] 1735 + name = "windows_i686_gnu" 1736 + version = "0.52.5" 1737 + source = "registry+https://github.com/rust-lang/crates.io-index" 1738 + checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" 1739 + 1740 + [[package]] 1741 + name = "windows_i686_gnullvm" 1742 + version = "0.52.5" 1743 + source = "registry+https://github.com/rust-lang/crates.io-index" 1744 + checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" 1745 + 1746 + [[package]] 441 1747 name = "windows_i686_msvc" 442 1748 version = "0.48.0" 443 1749 source = "registry+https://github.com/rust-lang/crates.io-index" 444 1750 checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1751 + 1752 + [[package]] 1753 + name = "windows_i686_msvc" 1754 + version = "0.52.5" 1755 + source = "registry+https://github.com/rust-lang/crates.io-index" 1756 + checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" 445 1757 446 1758 [[package]] 447 1759 name = "windows_x86_64_gnu" ··· 450 1762 checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 451 1763 452 1764 [[package]] 1765 + name = "windows_x86_64_gnu" 1766 + version = "0.52.5" 1767 + source = "registry+https://github.com/rust-lang/crates.io-index" 1768 + checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" 1769 + 1770 + [[package]] 453 1771 name = "windows_x86_64_gnullvm" 454 1772 version = "0.48.0" 455 1773 source = "registry+https://github.com/rust-lang/crates.io-index" 456 1774 checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 457 1775 458 1776 [[package]] 1777 + name = "windows_x86_64_gnullvm" 1778 + version = "0.52.5" 1779 + source = "registry+https://github.com/rust-lang/crates.io-index" 1780 + checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" 1781 + 1782 + [[package]] 459 1783 name = "windows_x86_64_msvc" 460 1784 version = "0.48.0" 461 1785 source = "registry+https://github.com/rust-lang/crates.io-index" 462 1786 checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 1787 + 1788 + [[package]] 1789 + name = "windows_x86_64_msvc" 1790 + version = "0.52.5" 1791 + source = "registry+https://github.com/rust-lang/crates.io-index" 1792 + checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" 1793 + 1794 + [[package]] 1795 + name = "zerocopy" 1796 + version = "0.7.34" 1797 + source = "registry+https://github.com/rust-lang/crates.io-index" 1798 + checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" 1799 + dependencies = [ 1800 + "zerocopy-derive", 1801 + ] 1802 + 1803 + [[package]] 1804 + name = "zerocopy-derive" 1805 + version = "0.7.34" 1806 + source = "registry+https://github.com/rust-lang/crates.io-index" 1807 + checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" 1808 + dependencies = [ 1809 + "proc-macro2", 1810 + "quote", 1811 + "syn 2.0.66", 1812 + ] 1813 + 1814 + [[package]] 1815 + name = "zeroize" 1816 + version = "1.8.1" 1817 + source = "registry+https://github.com/rust-lang/crates.io-index" 1818 + checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
+3
Cargo.toml
··· 16 16 anyhow = "1.0.75" 17 17 dirs = "5.0.1" 18 18 serde_json = "1.0.108" 19 + serde = { version = "1.0.203", features = ["derive"] } 20 + tokio = { version = "1.38.0", features = ["full"] } 21 + sqlx = { version = "0.7.4", features = ["runtime-tokio", "sqlite"] } 19 22 20 23 # The profile that 'cargo dist' will build with 21 24 [profile.dist]
+5 -1
src/cli.rs
··· 1 1 //! CLI for using the Safir binary 2 - pub use clap::{Args, Parser, Subcommand}; 2 + use crate::store::SafirMode; 3 + pub use clap::{Parser, Subcommand}; 3 4 4 5 /// CLI arguments for running the program 5 6 #[derive(Parser, Debug)] ··· 47 48 /// Keys to export the values 48 49 keys: Vec<String>, 49 50 }, 51 + 52 + /// Sets the mode for Safir (KV-file store or SQLite store - active on next run) 53 + Mode { mode: SafirMode }, 50 54 51 55 /// List all values in the store 52 56 List,
+5 -4
src/main.rs
··· 3 3 mod utils; 4 4 5 5 use cli::*; 6 - use store::Store; 7 6 8 7 use anyhow::Result; 9 8 10 9 fn main() -> Result<()> { 11 10 let cli = Cli::parse(); 12 - let mut safir = Store::init_safir(); 13 11 14 - match &cli.command { 12 + match cli.command { 15 13 Commands::Add { key, value } => { 16 14 // safir.add(key.to_owned(), value.to_owned()); 17 15 } ··· 36 34 Commands::Purge => { 37 35 // safir.purge(); 38 36 } 37 + Commands::Mode { mode } => { 38 + println!("Mode: {mode:?}"); 39 + } 39 40 } 40 41 41 - utils::write_store(&safir.store, &safir.file); 42 + // utils::write_store(&safir.store, &safir.file); 42 43 Ok(()) 43 44 }
+8 -8
src/store.rs src/store/file_store.rs
··· 1 1 use crate::utils; 2 - use std::{fs, path::PathBuf, collections::HashMap}; 2 + use std::{collections::HashMap, fs, path::PathBuf}; 3 3 4 - pub struct Store { 4 + pub struct KVStore { 5 5 pub path: PathBuf, 6 6 pub file: PathBuf, 7 - pub store: HashMap<String, String> 7 + pub store: HashMap<String, String>, 8 8 } 9 9 10 - impl Store { 10 + impl KVStore { 11 11 pub fn init_safir() -> Self { 12 12 match dirs::home_dir() { 13 13 Some(home) => { 14 14 let working_dir = home.join(".safirstore"); 15 - fs::create_dir_all(&working_dir) 16 - .expect("unable to create main directory"); 15 + fs::create_dir_all(&working_dir).expect("unable to create main directory"); 17 16 18 - let store_path = working_dir.join("safirstore.json"); 17 + let store_path = working_dir.join("safirstore.json"); 19 18 let store = if store_path.exists() { 20 19 utils::load_store(&store_path) 21 20 } else { ··· 89 88 } 90 89 91 90 pub fn purge(&mut self) { 92 - let confirm_msg = "Are you sure you want to remove the .safirstore directory and ALL contents?"; 91 + let confirm_msg = 92 + "Are you sure you want to remove the .safirstore directory and ALL contents?"; 93 93 if utils::confirm_entry(&confirm_msg) { 94 94 utils::purge_directory(self.path.clone()); 95 95 std::process::exit(0);
+47
src/store/mod.rs
··· 1 + pub mod file_store; 2 + 3 + use crate::utils; 4 + 5 + use std::path::Path; 6 + 7 + use anyhow::{Context, Result}; 8 + use clap::ValueEnum; 9 + use serde::{Deserialize, Serialize}; 10 + 11 + pub trait SafirStore { 12 + async fn add(key: String, value: String) -> Result<()>; 13 + async fn get(keys: Vec<String>) -> Result<Vec<String>>; 14 + async fn list(keys: Vec<String>) -> Result<Vec<String>>; 15 + async fn remove(keys: Vec<String>) -> Result<()>; 16 + async fn clear() -> Result<()>; 17 + async fn purge() -> Result<()>; 18 + } 19 + 20 + #[derive(ValueEnum, Default, Debug, Copy, PartialEq, Eq, Clone, Serialize, Deserialize)] 21 + #[serde(rename_all = "lowercase")] 22 + pub enum SafirMode { 23 + #[default] 24 + File, 25 + Database, 26 + } 27 + 28 + #[derive(Default, Debug, Clone, Serialize, Deserialize)] 29 + pub struct SafirConfig { 30 + mode: SafirMode, 31 + } 32 + 33 + impl SafirConfig { 34 + pub fn load(fp: impl AsRef<Path>) -> Result<Self> { 35 + let fp = fp.as_ref().join("safirstore.cfg"); 36 + let contents = std::fs::read_to_string(&fp).context("loading safir config")?; 37 + serde_json::from_str(&contents).context("deserializing safir config") 38 + } 39 + } 40 + 41 + pub fn init_safir() { 42 + // 1. Create .safirstore dir 43 + let _ws = utils::create_safir_workspace(); 44 + 45 + // 2. Load / Create config 46 + // 3. Load / Create stores 47 + }
+27 -9
src/utils.rs
··· 1 - use std::{io::Write, collections::HashMap, path::Path}; 1 + use std::{ 2 + collections::HashMap, 3 + fs, 4 + io::Write, 5 + path::{Path, PathBuf}, 6 + }; 2 7 3 8 /// Confirmation dialog for important calls 4 9 pub fn confirm_entry(msg: &str) -> bool { ··· 25 30 26 31 /// Loads the store from disk 27 32 pub fn load_store(path: impl AsRef<Path>) -> HashMap<String, String> { 28 - let contents = std::fs::read_to_string(path.as_ref()) 29 - .expect("unable to store contents"); 33 + let contents = std::fs::read_to_string(path.as_ref()).expect("unable to store contents"); 30 34 31 35 return serde_json::from_str::<HashMap<String, String>>(&contents) 32 36 .expect("unable to deserialize store contents"); ··· 34 38 35 39 /// Writes the store to disk 36 40 pub fn write_store(store: &HashMap<String, String>, path: impl AsRef<Path>) { 37 - let str_store = serde_json::to_string_pretty(store) 38 - .expect("unable to serialize store contents"); 41 + let str_store = 42 + serde_json::to_string_pretty(store).expect("unable to serialize store contents"); 39 43 40 - let mut file = std::fs::File::create(&path) 41 - .expect("unable to get file handle"); 44 + let mut file = std::fs::File::create(&path).expect("unable to get file handle"); 42 45 43 46 file.write_all(str_store.as_bytes()) 44 47 .expect("unable to write store out to disk"); ··· 46 49 47 50 /// Remove the .safirstore directory 48 51 pub fn purge_directory(path: impl AsRef<Path>) { 49 - std::fs::remove_dir_all(path) 50 - .expect("unable to remove safirstore directory"); 52 + std::fs::remove_dir_all(path).expect("unable to remove safirstore directory"); 53 + } 54 + 55 + /// Create the .safirstore directory in the user HOME 56 + pub fn create_safir_workspace() -> PathBuf { 57 + match dirs::home_dir() { 58 + Some(home) => { 59 + let working_dir = home.join(".safirstore"); 60 + fs::create_dir_all(&working_dir).expect("unable to create main directory"); 61 + 62 + working_dir 63 + } 64 + None => { 65 + eprintln!("unable to obtain home directory path!"); 66 + std::process::exit(-1); 67 + } 68 + } 51 69 }