diff options
| -rw-r--r-- | Cargo.lock | 892 | ||||
| -rw-r--r-- | Cargo.toml | 20 | ||||
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | src/arts.json | 5 | ||||
| -rw-r--r-- | src/configmanager.rs | 38 | ||||
| -rw-r--r-- | src/main.rs | 203 | ||||
| -rw-r--r-- | src/parser.rs | 220 | ||||
| -rw-r--r-- | src/shared.rs | 43 |
8 files changed, 901 insertions, 528 deletions
@@ -18,18 +18,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - -[[package]] -name = "aho-corasick" -version = "1.1.3" +name = "aligned-vec" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" dependencies = [ - "memchr", + "equator", ] [[package]] @@ -107,6 +101,35 @@ dependencies = [ ] [[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" + +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -124,6 +147,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] +name = "av1-grain" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c8fbc0f831f4519fe8b810b6a7a91410ec83031b8233f730a0480029f6a23f" +dependencies = [ + "arrayvec", +] + +[[package]] name = "backtrace" version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -146,9 +192,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bit_field" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" +checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" [[package]] name = "bitflags" @@ -163,6 +209,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] +name = "bitstream-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" + +[[package]] +name = "built" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" + +[[package]] name = "bumpalo" version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -170,15 +228,15 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.22.0" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" [[package]] -name = "byteorder" -version = "1.5.0" +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" @@ -192,10 +250,22 @@ version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ + "jobserver", + "libc", "shlex", ] [[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -232,9 +302,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.32" +version = "4.5.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5" dependencies = [ "clap_builder", "clap_derive", @@ -242,9 +312,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a" dependencies = [ "anstream", "anstyle", @@ -254,14 +324,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ "heck", - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -300,9 +370,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -334,39 +404,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" - -[[package]] -name = "deflate" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" -dependencies = [ - "adler32", - "byteorder", -] - -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "displaydoc" @@ -374,9 +414,9 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -395,6 +435,26 @@ dependencies = [ ] [[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -412,9 +472,9 @@ dependencies = [ [[package]] name = "exr" -version = "1.73.0" +version = "1.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" +checksum = "4300e043a56aa2cb633c01af81ca8f699a321879a7854d3896a0ba89056363be" dependencies = [ "bit_field", "half", @@ -432,6 +492,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] +name = "fax" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" +dependencies = [ + "fax_derive", +] + +[[package]] +name = "fax_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "fdeflate" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -442,9 +522,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.0" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "miniz_oxide", @@ -521,9 +601,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", @@ -544,19 +624,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.10.3" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af" -dependencies = [ - "color_quant", - "lzw", -] - -[[package]] -name = "gif" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b" dependencies = [ "color_quant", "weezl", @@ -589,12 +659,13 @@ dependencies = [ [[package]] name = "half" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" dependencies = [ "cfg-if", "crunchy", + "zerocopy", ] [[package]] @@ -826,9 +897,9 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -854,41 +925,45 @@ dependencies = [ [[package]] name = "image" -version = "0.21.3" +version = "0.25.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35371e467cd7b0b3d1d6013d619203658467df12d61b0ca43cd67b743b1965eb" +checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" dependencies = [ - "byteorder", - "gif 0.10.3", - "jpeg-decoder 0.1.22", - "lzw", - "num-iter", - "num-rational", + "bytemuck", + "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", + "moxcms", "num-traits", - "png 0.14.1", - "scoped_threadpool", - "tiff 0.2.2", + "png", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core", + "zune-jpeg", ] [[package]] -name = "image" -version = "0.24.9" +name = "image-webp" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "exr", - "gif 0.13.1", - "jpeg-decoder 0.3.1", - "num-traits", - "png 0.17.16", - "qoi", - "tiff 0.9.1", + "byteorder-lite", + "quick-error", ] [[package]] +name = "imgref" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8" + +[[package]] name = "indexmap" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -899,12 +974,14 @@ dependencies = [ ] [[package]] -name = "inflate" -version = "0.4.5" +name = "interpolate_name" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ - "adler32", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -920,27 +997,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] -name = "itoa" -version = "1.0.15" +name = "itertools" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] [[package]] -name = "jpeg-decoder" -version = "0.1.22" +name = "itoa" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" -dependencies = [ - "rayon", -] +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] -name = "jpeg-decoder" -version = "0.3.1" +name = "jobserver" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ - "rayon", + "getrandom 0.3.2", + "libc", ] [[package]] @@ -954,16 +1032,10 @@ dependencies = [ ] [[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] name = "lebe" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" +checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" [[package]] name = "libc" @@ -972,13 +1044,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] -name = "libredox" -version = "0.1.3" +name = "libfuzzer-sys" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404" dependencies = [ - "bitflags 2.9.0", - "libc", + "arbitrary", + "cc", ] [[package]] @@ -1010,10 +1082,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] -name = "lzw" -version = "0.10.0" +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + +[[package]] +name = "maybe-rayon" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] [[package]] name = "memchr" @@ -1049,6 +1134,16 @@ dependencies = [ ] [[package]] +name = "moxcms" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbdd3d7436f8b5e892b8b7ea114271ff0fa00bc5acae845d53b07d498616ef6" +dependencies = [ + "num-traits", + "pxfm", +] + +[[package]] name = "native-tls" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1066,43 +1161,63 @@ dependencies = [ ] [[package]] -name = "num-derive" -version = "0.2.5" +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "memchr", ] [[package]] -name = "num-integer" -version = "0.1.46" +name = "noop_proc_macro" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ + "num-integer", "num-traits", ] [[package]] -name = "num-iter" -version = "0.1.45" +name = "num-derive" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", - "num-integer", "num-traits", ] [[package]] name = "num-rational" -version = "0.2.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", + "num-bigint", "num-integer", "num-traits", ] @@ -1152,9 +1267,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1199,6 +1314,12 @@ dependencies = [ ] [[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1224,23 +1345,11 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "png" -version = "0.14.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63daf481fdd0defa2d1d2be15c674fbfa1b0fd71882c303a91f9a79b3252c359" +checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" dependencies = [ - "bitflags 1.3.2", - "deflate", - "inflate", - "num-iter", -] - -[[package]] -name = "png" -version = "0.17.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" -dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.0", "crc32fast", "fdeflate", "flate2", @@ -1248,12 +1357,12 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "0.4.30" +name = "ppv-lite86" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "unicode-xid", + "zerocopy", ] [[package]] @@ -1266,6 +1375,34 @@ dependencies = [ ] [[package]] +name = "profiling" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "pxfm" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cbdf373972bf78df4d3b518d07003938e2c7d1fb5891e55f9cb6df57009d84" +dependencies = [ + "num-traits", +] + +[[package]] name = "qoi" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1275,13 +1412,10 @@ dependencies = [ ] [[package]] -name = "quote" -version = "0.6.13" +name = "quick-error" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" @@ -1289,7 +1423,7 @@ version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ - "proc-macro2 1.0.94", + "proc-macro2", ] [[package]] @@ -1299,73 +1433,113 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" [[package]] -name = "rayon" -version = "1.10.0" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "either", - "rayon-core", + "libc", + "rand_chacha", + "rand_core", ] [[package]] -name = "rayon-core" -version = "1.12.1" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "ppv-lite86", + "rand_core", ] [[package]] -name = "redox_syscall" -version = "0.5.10" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "bitflags 2.9.0", + "getrandom 0.2.16", ] [[package]] -name = "redox_users" -version = "0.4.6" +name = "rav1e" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" dependencies = [ - "getrandom 0.2.15", - "libredox", + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand", + "rand_chacha", + "simd_helpers", + "system-deps", "thiserror", + "v_frame", + "wasm-bindgen", ] [[package]] -name = "regex" -version = "1.11.1" +name = "ravif" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rayon", + "rgb", ] [[package]] -name = "regex-automata" -version = "0.4.9" +name = "rayon" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "either", + "rayon-core", ] [[package]] -name = "regex-syntax" -version = "0.8.5" +name = "rayon-core" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] [[package]] name = "reqwest" @@ -1408,6 +1582,12 @@ dependencies = [ ] [[package]] +name = "rgb" +version = "0.8.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" + +[[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1457,12 +1637,6 @@ dependencies = [ ] [[package]] -name = "scoped_threadpool" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" - -[[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1506,9 +1680,9 @@ version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1566,6 +1740,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + +[[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1610,23 +1793,12 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid", -] - -[[package]] -name = "syn" version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", + "proc-macro2", + "quote", "unicode-ident", ] @@ -1642,9 +1814,9 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1669,6 +1841,25 @@ dependencies = [ ] [[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 0.8.20", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] name = "tempfile" version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1693,14 +1884,12 @@ dependencies = [ [[package]] name = "termimage" -version = "0.4.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888d21770ee0f5defa7af7a2e548002b9a4d44546fb435589b3087b769ca74c7" +checksum = "09f86572fc30a2db4c80f8d01fa202504cf9b74fdd6d20bbda26e58269cdaa53" dependencies = [ "clap 2.34.0", - "image 0.21.3", - "lazy_static", - "regex", + "image", "term_size", "winapi", ] @@ -1729,32 +1918,23 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", -] - -[[package]] -name = "tiff" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4834f28a0330cb9f3f2c87d2649dca723cb33802e2bdcf18da32759fbec7ce" -dependencies = [ - "byteorder", - "lzw", - "num-derive", - "num-traits", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "tiff" -version = "0.9.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" dependencies = [ + "fax", "flate2", - "jpeg-decoder 0.3.1", + "half", + "quick-error", "weezl", + "zune-jpeg", ] [[package]] @@ -1791,9 +1971,9 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1828,7 +2008,19 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.24", ] [[package]] @@ -1850,7 +2042,20 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.7.13", ] [[package]] @@ -1897,12 +2102,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] name = "url" version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1932,6 +2131,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] +name = "v_frame" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + +[[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1944,6 +2154,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] name = "want" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1987,9 +2203,9 @@ checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-shared", ] @@ -2012,7 +2228,7 @@ version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ - "quote 1.0.40", + "quote", "wasm-bindgen-macro-support", ] @@ -2022,9 +2238,9 @@ version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2039,21 +2255,6 @@ dependencies = [ ] [[package]] -name = "weatherfetch" -version = "0.1.0" -dependencies = [ - "chrono", - "clap 4.5.32", - "dirs", - "image 0.24.9", - "reqwest", - "serde", - "termimage", - "tokio", - "toml", -] - -[[package]] name = "web-sys" version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2065,9 +2266,24 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.8" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" + +[[package]] +name = "wfetch" +version = "0.1.0" +dependencies = [ + "chrono", + "clap 4.5.51", + "clap_derive", + "reqwest", + "serde", + "serde_json", + "termimage", + "tokio", + "toml 0.7.8", +] [[package]] name = "winapi" @@ -2264,6 +2480,15 @@ dependencies = [ ] [[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] name = "winreg" version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2312,13 +2537,33 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", "synstructure", ] [[package]] +name = "zerocopy" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "zerofrom" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2333,9 +2578,9 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", "synstructure", ] @@ -2356,12 +2601,18 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ - "proc-macro2 1.0.94", - "quote 1.0.40", - "syn 2.0.100", + "proc-macro2", + "quote", + "syn", ] [[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] name = "zune-inflate" version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2369,3 +2620,12 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zune-jpeg" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" +dependencies = [ + "zune-core", +] @@ -1,15 +1,15 @@ [package] -name = "weatherfetch" +name = "wfetch" version = "0.1.0" edition = "2021" [dependencies] -serde = { version = "1.0", features = ["derive"] } -toml = "0.7" -clap = { version = "4.4", features = ["derive"] } -reqwest = { version = "0.11", features = ["json"] } -tokio = { version = "1.0", features = ["full"] } -chrono = "0.4" -dirs = "4.0" -termimage = "0.4" -image = "0.24" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +toml = "0.7" +clap = { version = "4.4", features = ["derive"] } +reqwest = { version = "0.11", features = ["json"] } +tokio = { version = "1.0", features = ["full"] } +chrono = "0.4" +termimage = "1.2.2" +clap_derive = "4.5.49" @@ -18,7 +18,10 @@ This is my pet project, but I think someone might like it. I am the sole develop <h2 align="center"> Tech details 🏗️</h2> -- Uses the https://openweathermap.org/api/one-call-3 API, which requires coordinates or configuration to function properly. +> [!WARNING] +> Not all of this fns can be implemented with openmeteo API + +- Uses the free open-meteo API, which requires coordinates or configuration to function properly. - Displays images in the terminal. - Provides various time intervals, including daily, hourly, and minute-by-minute updates, as well as current information. - Can send alerts. @@ -28,7 +31,8 @@ This is my pet project, but I think someone might like it. I am the sole develop <h2 align="center"> Using ⛽️</h2> >[!WARNING] ->Coordinates and an internet connection are required. This information is not stored or used in any way. +>Coordinates and an internet connection are required if cache not builded properly. +>To cache weather data you cah run `wfetch rebuild-cache` `wfetch -h` diff --git a/src/arts.json b/src/arts.json new file mode 100644 index 0000000..27fdbe5 --- /dev/null +++ b/src/arts.json @@ -0,0 +1,5 @@ +arts { + weather: { + cold = "" + }; +} diff --git a/src/configmanager.rs b/src/configmanager.rs deleted file mode 100644 index c0047a5..0000000 --- a/src/configmanager.rs +++ /dev/null @@ -1,38 +0,0 @@ -use std::fs; -use serde::Deserialize; -use dirs::home_dir; -use std::path::PathBuf; - -#[derive(Debug, Deserialize)] -pub struct Config { - pub lat: String, - pub lon: String, - pub exclude: String, - pub appid: String, - pub lang: String, - pub units: String, - pub cache: bool, - pub rain: String, - pub sunny: String, - pub snowy: String, -} - -pub fn handle_config(_config: &Config) -> Result<(), Box<dyn std::error::Error>> { - Ok(()) -} - -pub fn gen_standard_conf() { - // TODO: Implement -} - -impl Config { - pub fn load() -> Result<Self, Box<dyn std::error::Error>> { - let mut path = home_dir().ok_or("Home directory not found")?; - path.push(".config/WeatherFetch/Config.toml"); - - let config_str = fs::read_to_string(path)?; - let config: Config = toml::from_str(&config_str)?; - Ok(config) - } -} - diff --git a/src/main.rs b/src/main.rs index 9f64ca4..057588b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,51 +1,182 @@ -extern crate image; +/* + _______ ________ __________ + ___ |__________________ _______________ __ \_______ __ ___ ___ \ + __ /| |_ ___/ ___/ __ `/_ __ \ _ \_ / / / _ \_ | / / __ / _ \ | + _ ___ | / / /__ / /_/ /_ / / / __/ /_/ // __/_ |/ / _ / , _/ / + /_/ |_/_/ \___/ \__,_/ /_/ /_/\___//_____/ \___/_____/ |_/_/|_|_/ +MIT License -use clap::{Arg, Command}; -use termimage::{Options}; +Copyright (c) 2023-2025 ArcaneDev +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. + +*/ + +use std::fs::{self, File}; +use std::path::PathBuf; + +use clap::{Parser, Subcommand}; +use termimage::Options; -mod configmanager; mod parser; +mod shared; -use crate::configmanager::{Config, handle_config}; +use parser::{get_config, parse_weather, generate_config, Config}; +use shared::WeatherData; -fn main() -> Result<(), Box<dyn std::error::Error>> { - let matches = Command::new("WeatherFetch") - .version("0.1") - .author("Borisov Alexey <arcanetmodl@gmail.com>") - .about("Weather fetch with image and ASCII art support") - .arg(Arg::new("image").short('i').long("image").value_name("PATH")) - .arg(Arg::new("exclude").short('e').long("exclude").value_name("TYPE") - .value_parser(["current", "minutely", "hourly", "daily", "alerts"])) - .arg(Arg::new("help").short('h').long("help")) - .arg(Arg::new("lat").short('t').long("lat").value_name("LATITUDE")) - .arg(Arg::new("lon").short('n').long("lon").value_name("LONGITUDE")) - .get_matches(); - - if matches.contains_id("help") { - println!("Usage: ..."); - return Ok(()); - } - - if let Some(img_path) = matches.get_one::<String>("image") { - let _img = Image::from_path(img_path)?; - } +#[derive(Parser)] +#[command(name = "wfetch")] +#[command(about = "Weather fetch tool")] +struct Cli { + #[command(subcommand)] + command: Option<Commands>, +} - let config = Config::load()?; - handle_config(&config)?; +#[derive(Subcommand)] +enum Commands { + Config, + Fetch, + Clean, + Today, + Tomorrow, + RebuildCache, + CheckCfg +} +fn process_config() -> Result<(), Box<dyn std::error::Error>> { + let _cfg: Config = get_config()?; + println!("Config is valid"); + Ok(()) +} - let opts = Options::parse(); - /* - if !opts { - opts = configmanager::Config::load(); - } +fn parse_cached() -> Result<WeatherData, Box<dyn std::error::Error>> { + let home = std::env::var("HOME")?; + let cache_path = format!("{}/.cache/WeatherFetch/weather.json", home); + + if !PathBuf::from(&cache_path).exists() { + return Err("Cache file not found".into()); + } + + let cache_data = fs::read_to_string(&cache_path)?; + let weather_data: WeatherData = serde_json::from_str(&cache_data)?; + Ok(weather_data) +} - let format = ops::guess_format(&opts.image)?; - let img = ops::load_image(&opts.image, format)?; +fn print_help() -> Result<(), Box<dyn std::error::Error>> { + println!("Help command"); + println!("Usage: wfetch <command>"); + println!("Commands:"); + println!(" config - Check config"); + println!(" fetch - Fetch weather-data"); + println!(" clean - Clean cache"); + println!(" help - Print help"); + println!(" today - Print today weather"); + println!(" tomorrow - Print tomorrow weather"); + println!(" rebuild-cache - Rebuild cache"); + Ok(()) +} - */ +fn clean_cache() -> Result<(), Box<dyn std::error::Error>> { + let home = std::env::var("HOME")?; + let cache_path = format!("{}/.cache/WeatherFetch/weather.json", home); + if PathBuf::from(&cache_path).exists() { + fs::remove_file(&cache_path)?; + println!("Cache cleaned successfully"); + } else { + println!("Cache file not found"); + } + Ok(()) +} +fn rebuild_cache() -> Result<(), Box<dyn std::error::Error>> { + let rt = tokio::runtime::Runtime::new()?; + let weather_data = rt.block_on(parse_weather())?; + + let home = std::env::var("HOME")?; + let cache_dir = format!("{}/.cache/WeatherFetch", home); + fs::create_dir_all(&cache_dir)?; + + let cache_path = format!("{}/weather.json", cache_dir); + let json_data = serde_json::to_string_pretty(&weather_data)?; + fs::write(&cache_path, json_data)?; + + println!("Cache rebuilt successfully"); Ok(()) } + +fn main() -> Result<(), Box<dyn std::error::Error>> { + let cli = Cli::parse(); + + match cli.command { + Some(Commands::Config) => { + println!("Config checker command"); + let home = std::env::var("HOME")?; + let config_path = format!("{}/.config/WeatherFetch/Config.toml", home); + if File::open(&config_path).is_err() { + generate_config()?; + println!("Config generated successfully"); + } else { + process_config()?; + println!("Config already exists and is valid."); + } + Ok(()) + }, + Some(Commands::Fetch) => { + println!("Fetch weather-data command"); + let rt = tokio::runtime::Runtime::new()?; + let weather_data = rt.block_on(parse_weather())?; + let home = std::env::var("HOME")?; + println!("Weather data fetched to: {}", format!("{}/.cache/WeatherFetch", home)); + Ok(()) + }, + Some(Commands::Clean) => { + println!("Clean cache command"); + clean_cache()?; + Ok(()) + }, + Some(Commands::Today) => { + println!("Today weather command"); + Ok(()) + }, + Some(Commands::Tomorrow) => { + println!("Tomorrow weather command"); + Ok(()) + }, + Some(Commands::RebuildCache) => { + println!("Rebuild cache command"); + rebuild_cache()?; + Ok(()) + }, + Some(Commands::CheckCfg) => { + println!("Validating cfg..."); + let home = std::env::var("HOME")?; + let config_path = format!("{}/.config/WeatherFetch/Config.toml", home); + if File::open(&config_path).is_ok() { + process_config()?; + } else { + println!("Config file not found, try `wfetch config`, its will generate default cfg."); + } + Ok(()) + } + None => { + print_help() + }, + } +}
\ No newline at end of file diff --git a/src/parser.rs b/src/parser.rs index 5a670b1..f4fd2da 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,146 +1,114 @@ -use reqwest::{Error, Client, get}; -use chrono::{DateTime, Utc, prelude::*}; -use serde::{Serialize, Deserialize}; - -use crate::configmanager; - -//API answer struct`s -#[derive(Debug, Serialize, Deserialize)] -pub struct WeatherData { - pub lat: f64, - pub lon: f64, - pub timezone: String, - pub timezone_offset: i32, - pub current: Current, - pub minutely: Vec<Minutely>, - pub hourly: Vec<Hourly>, - pub daily: Vec<Daily>, - pub alerts: Vec<Alert>, -} +use reqwest::Client; +use std::fs::{self, File}; +use std::io::Read; +use toml; +use serde::Deserialize; +use serde_json; -#[derive(Debug, Serialize, Deserialize)] -pub struct Current { - pub dt: u64, - pub sunrise: u64, - pub sunset: u64, - pub temp: f32, - pub feels_like: f32, - pub pressure: u32, - pub humidity: u32, - pub dew_point: f32, - pub uvi: f32, - pub clouds: u32, - pub visibility: u32, - pub wind_speed: f32, - pub wind_deg: u32, - pub wind_gust: f32, - pub weather: Vec<Weather>, -} +// use crate::configmanager::Config; +use crate::shared::*; -#[derive(Debug, Serialize, Deserialize)] -pub struct Weather { - pub id: u32, - pub main: String, - pub description: String, - pub icon: String, -} +pub type BoxedError = Box<dyn std::error::Error + Send + Sync>; -#[derive(Debug, Serialize, Deserialize)] -pub struct Minutely { - pub dt: u64, - pub precipitation: f32, +fn get_config_path() -> Result<String, Box<dyn std::error::Error>> { + let home = std::env::var("HOME")?; + Ok(format!("{}/.config/WeatherFetch/Config.toml", home)) } -#[derive(Debug, Serialize, Deserialize)] -pub struct Hourly { - pub dt: u64, - pub temp: f32, - pub feels_like: f32, - pub pressure: u32, - pub humidity: u32, - pub dew_point: f32, - pub uvi: f32, - pub clouds: u32, - pub visibility: u32, - pub wind_speed: f32, - pub wind_deg: u32, - pub wind_gust: f32, - pub weather: Vec<Weather>, - pub pop: f32, -} +/* +const CONF: Lazy<Result<Config, Box<dyn std::error::Error + Send + Sync>>> = Lazy::new(|| { + Config::load().map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>) +}); +*/ -#[derive(Debug, Serialize, Deserialize)] -pub struct Daily { - pub dt: u64, - pub sunrise: u64, - pub sunset: u64, - pub moonrise: u64, - pub moonset: u64, - pub moon_phase: f32, - pub summary: String, - pub temp: Temp, - pub feels_like: FeelsLike, - pub pressure: u32, - pub humidity: u32, - pub dew_point: f32, - pub wind_speed: f32, - pub wind_deg: u32, - pub wind_gust: f32, - pub weather: Vec<Weather>, - pub clouds: u32, - pub pop: f32, - pub rain: Option<f32>, - pub uvi: f32, -} +pub fn get_location(coords_args: bool) -> Result<(), BoxedError> { + let config = get_config().unwrap(); -#[derive(Debug, Serialize, Deserialize)] -pub struct Temp { - pub day: f32, - pub min: f32, - pub max: f32, - pub night: f32, - pub eve: f32, - pub morn: f32, + if (config.lat == 0.0 || config.lon == 0.0) && !coords_args { + + println!("No coordinates in configuration file or conf not founded."); + println!("HINT: Try create ~/.config/WeatherFetch/Config.toml"); + println!("HINT: And add `lat(<float>)`, `lon(<float>)`."); + println!("HINT: To get more info check https://open-meteo.com/en/docs"); + + Err("Invalid coordinates in config".into()) + } else { + Ok(()) + } } -#[derive(Debug, Serialize, Deserialize)] -pub struct FeelsLike { - pub day: f32, - pub night: f32, - pub eve: f32, - pub morn: f32, +pub async fn parse_weather() -> Result<WeatherData, Box<dyn std::error::Error>> { + let config = get_config()?; + let client = Client::new(); + let response = client.get("https://api.open-meteo.com/v1/forecast") + .query(&[ + ("latitude", config.lat.to_string()), + ("longitude", config.lon.to_string()), + ("current", "temperature_2m,wind_speed_10m".to_string()), + ("hourly", "temperature_2m,relative_humidity_2m,wind_speed_10m".to_string()), + ]) + .send() + .await?; + + let response_text = response.text().await?; + + let weather_data: WeatherData = serde_json::from_str(&response_text)?; + + let home = std::env::var("HOME")?; + let cache_dir = format!("{}/.cache/WeatherFetch", home); + fs::create_dir_all(&cache_dir)?; + + let cache_path = format!("{}/weather.json", cache_dir); + let json_data = serde_json::to_string_pretty(&weather_data)?; + fs::write(&cache_path, json_data)?; + + Ok(weather_data) } -#[derive(Debug, Serialize, Deserialize)] -pub struct Alert { - pub sender_name: String, - pub event: String, - pub start: u64, - pub end: u64, - pub description: String, - pub tags: Vec<String>, + +#[derive(Debug, Deserialize)] +pub struct Config { + lat: f64, + lon: f64, + exclude: String, + appid: String, + units: String, + lang: String, } +pub fn get_config() -> Result<Config, Box<dyn std::error::Error>> { + let config_path = get_config_path()?; + + if File::open(&config_path).is_err() { + generate_config()?; + } + + let mut file = File::open(&config_path)?; + let mut content = String::new(); + file.read_to_string(&mut content)?; + let config: Config = toml::from_str(&content)?; + Ok(config) +} +pub fn generate_cachedir() -> Result<(), Box<dyn std::error::Error>> { + let home = std::env::var("HOME")?; + let cache_path = format!("{}/.cache/WeatherFetch/", home); + + let _ = fs::create_dir(cache_path); -pub fn get_location(coords_args: bool) -> Result<(), String>{ - //Get the lat and lon for API call - let conf: Option<configmanager::load()>; - if conf.lat.is_empty() || conf.lon.is_empty() && !coords_args{ - println!("No coordinates in configuration file or conf not founded."); - println!("HINT: Try create ~/.config/WeatherFetch/Config.toml"); - println!("HINT: And add `lat(<int>)`, `lon(<int>)`."); - println!("HINT: To get more info check https://openweathermap.org/api/one-call-3"); + Ok(()) +} - Err("No coordinates in config or args.".into()) - } else { - Ok(()) +pub fn generate_config() -> Result<(), Box<dyn std::error::Error>> { + let config_path = get_config_path()?; + let config = "lat = 55.75\nlon = 37.62\nexclude = \"\"\nappid = \"\"\nunits = \"metric\"\nlang = \"ru\""; + let path = std::path::Path::new(&config_path); + if let Some(parent) = path.parent() { + fs::create_dir_all(parent)?; } -} - - -pub async fn parse_weather(_config: &Config) -> Result<(), reqwest::Error> { + fs::write(path, config)?; + println!("Config file generated at: {}", config_path); Ok(()) -} +}
\ No newline at end of file diff --git a/src/shared.rs b/src/shared.rs new file mode 100644 index 0000000..75a4d1c --- /dev/null +++ b/src/shared.rs @@ -0,0 +1,43 @@ +use serde::{Serialize, Deserialize}; +//API answer struct`s + +#[derive(Debug, Serialize, Deserialize)] +pub struct WeatherData { + pub latitude: f64, + pub longitude: f64, + pub generationtime_ms: Option<f64>, + pub utc_offset_seconds: Option<i32>, + pub timezone: Option<String>, + pub timezone_abbreviation: Option<String>, + pub elevation: Option<f64>, + pub current_units: Option<CurrentUnits>, + pub current: Current, + pub hourly_units: Option<HourlyUnits>, + pub hourly: Hourly, +} +#[derive(Debug, Serialize, Deserialize)] +pub struct Current { + pub time: String, + pub temperature_2m: f32, + pub wind_speed_10m: f32, +} +#[derive(Debug, Serialize, Deserialize)] +pub struct CurrentUnits { + pub time: Option<String>, + pub temperature_2m: Option<String>, + pub wind_speed_10m: Option<String>, +} +#[derive(Debug, Serialize, Deserialize)] +pub struct Hourly { + pub time: Vec<String>, + pub temperature_2m: Vec<f32>, + pub relative_humidity_2m: Vec<u32>, + pub wind_speed_10m: Vec<f32>, +} +#[derive(Debug, Serialize, Deserialize)] +pub struct HourlyUnits { + pub time: Option<String>, + pub temperature_2m: Option<String>, + pub relative_humidity_2m: Option<String>, + pub wind_speed_10m: Option<String>, +} |
