From 3ff4a273c70b794442d32ebc01488bf139645af0 Mon Sep 17 00:00:00 2001 From: jw Date: Wed, 9 Apr 2025 21:54:28 +0200 Subject: [PATCH 01/18] :tada: First async call in brt. --- Cargo.lock | 2449 +++++++++++++++++++++++-------------- Cargo.toml | 41 +- src/action.rs | 30 - src/app.rs | 166 --- src/cli.rs | 34 - src/components.rs | 49 - src/components/battery.rs | 84 -- src/components/cpu.rs | 63 - src/components/fps.rs | 133 -- src/components/process.rs | 366 ------ src/config.rs | 558 --------- src/logger.rs | 45 - src/main.rs | 229 +++- src/model.rs | 235 ---- src/processbar.rs | 54 - src/tui.rs | 212 ---- src/utils.rs | 168 --- src/widgets.rs | 1 - src/widgets/cpu_graph.rs | 59 - 19 files changed, 1724 insertions(+), 3252 deletions(-) delete mode 100644 src/action.rs delete mode 100644 src/app.rs delete mode 100644 src/cli.rs delete mode 100644 src/components.rs delete mode 100644 src/components/battery.rs delete mode 100644 src/components/cpu.rs delete mode 100644 src/components/fps.rs delete mode 100644 src/components/process.rs delete mode 100644 src/config.rs delete mode 100644 src/logger.rs delete mode 100644 src/model.rs delete mode 100644 src/processbar.rs delete mode 100644 src/tui.rs delete mode 100644 src/utils.rs delete mode 100644 src/widgets.rs delete mode 100644 src/widgets/cpu_graph.rs diff --git a/Cargo.lock b/Cargo.lock index 8316c35..fcbe097 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,60 +59,11 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" - -[[package]] -name = "anstyle-parse" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "arc-swap" @@ -122,13 +73,22 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", +] + +[[package]] +name = "atomic" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", ] [[package]] @@ -154,36 +114,24 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "battery" -version = "0.7.8" +name = "bit-set" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b624268937c0e0a3edb7c27843f9e547c320d730c610d3b8e6e8e95b2026e4" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "cfg-if", - "core-foundation", - "lazycell", - "libc", - "mach", - "nix", - "num-traits", - "uom", - "winapi", + "bit-vec", ] [[package]] -name = "better-panic" -version = "0.3.0" +name = "bit-vec" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa9e1d11a268684cbd90ed36370d7577afb6c62d912ddff5c15fc34343e5036" -dependencies = [ - "backtrace", - "console", -] +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" @@ -193,9 +141,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" dependencies = [ "serde", ] @@ -213,53 +161,32 @@ dependencies = [ name = "brt" version = "0.1.8" dependencies = [ - "anyhow", - "battery", - "better-panic", "cargo-husky", - "clap", "color-eyre", - "config", - "crossterm", - "derive_deref", - "directories", - "dirs", - "futures", - "human-panic", - "humansize", - "json5", - "lazy_static", - "libc", - "log", - "log4rs", - "owo-colors 4.0.0", - "pretty_assertions", - "procfs", + "crossterm 0.29.0", + "octocrab", "ratatui", - "serde", - "signal-hook", - "strip-ansi-escapes", - "strum", "tokio", - "tokio-util", - "tracing", - "tracing-error", - "tracing-subscriber", - "tui-input", - "uzers", + "tokio-stream", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "bytes" -version = "1.6.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cargo-husky" @@ -275,18 +202,21 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "castaway" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" dependencies = [ "rustversion", ] [[package]] name = "cc" -version = "1.0.97" +version = "1.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -294,61 +224,27 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", - "windows-targets 0.52.5", -] - -[[package]] -name = "clap" -version = "4.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", - "terminal_size", - "unicase", - "unicode-width", -] - -[[package]] -name = "clap_derive" -version = "4.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.63", + "serde", + "wasm-bindgen", + "windows-link", ] -[[package]] -name = "clap_lex" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - [[package]] name = "color-eyre" version = "0.6.3" @@ -360,7 +256,7 @@ dependencies = [ "eyre", "indenter", "once_cell", - "owo-colors 3.5.0", + "owo-colors", "tracing-error", ] @@ -371,143 +267,89 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" dependencies = [ "once_cell", - "owo-colors 3.5.0", + "owo-colors", "tracing-core", "tracing-error", ] -[[package]] -name = "colorchoice" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" - [[package]] name = "compact_str" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" dependencies = [ "castaway", "cfg-if", "itoa", + "rustversion", "ryu", "static_assertions", ] -[[package]] -name = "config" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" -dependencies = [ - "async-trait", - "convert_case", - "json5", - "lazy_static", - "nom", - "pathdiff", - "ron", - "rust-ini", - "serde", - "serde_json", - "toml", - "yaml-rust", -] - -[[package]] -name = "console" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "const-random" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" -dependencies = [ - "const-random-macro", -] - -[[package]] -name = "const-random-macro" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" -dependencies = [ - "getrandom", - "once_cell", - "tiny-keccak", -] - [[package]] name = "convert_case" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" dependencies = [ "unicode-segmentation", ] [[package]] name = "core-foundation" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" dependencies = [ - "core-foundation-sys 0.7.0", + "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" -version = "0.7.0" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] [[package]] -name = "crc32fast" -version = "1.4.0" +name = "crossterm" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "cfg-if", + "bitflags 2.9.0", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", ] [[package]] name = "crossterm" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.0", "crossterm_winapi", + "derive_more", + "document-features", "futures-core", - "libc", "mio", "parking_lot", + "rustix 1.0.5", "serde", "signal-hook", "signal-hook-mio", @@ -523,12 +365,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-common" version = "0.1.6" @@ -540,86 +376,114 @@ dependencies = [ ] [[package]] -name = "derivative" -version = "2.2.0" +name = "csscolorparser" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" +dependencies = [ + "lab", + "phf", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ + "fnv", + "ident_case", "proc-macro2", "quote", - "syn 1.0.109", + "strsim", + "syn 2.0.100", ] [[package]] -name = "derive_deref" -version = "1.1.1" +name = "darling_macro" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcdbcee2d9941369faba772587a565f4f534e42cb8d17e5295871de730163b2b" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "proc-macro2", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "destructure_traitobject" -version = "0.2.0" +name = "deltae" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7" +checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4" [[package]] -name = "diff" -version = "0.1.13" +name = "deranged" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] [[package]] -name = "digest" -version = "0.10.7" +name = "derive_more" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" dependencies = [ - "block-buffer", - "crypto-common", + "derive_more-impl", ] [[package]] -name = "directories" -version = "5.0.1" +name = "derive_more-impl" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ - "dirs-sys", + "convert_case", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "dirs" -version = "5.0.1" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "dirs-sys", + "block-buffer", + "crypto-common", ] [[package]] -name = "dirs-sys" -version = "0.4.1" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "dlv-list" -version = "0.5.2" +name = "document-features" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ - "const-random", + "litrs", ] [[package]] @@ -629,25 +493,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "equivalent" -version = "1.0.1" +name = "errno" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +dependencies = [ + "libc", + "windows-sys", +] [[package]] -name = "errno" -version = "0.3.9" +name = "euclid" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" dependencies = [ - "libc", - "windows-sys 0.52.0", + "num-traits", ] [[package]] @@ -661,26 +522,58 @@ dependencies = [ ] [[package]] -name = "flate2" -version = "1.0.30" +name = "fancy-regex" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ - "crc32fast", - "miniz_oxide", + "bit-set", + "regex", +] + +[[package]] +name = "filedescriptor" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e40758ed24c9b2eeb76c35fb0aebc66c626084edd827e07e1552279814c6682d" +dependencies = [ + "libc", + "thiserror 1.0.69", + "winapi", ] +[[package]] +name = "finl_unicode" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94c970b525906eb37d3940083aa65b95e481fc1857d467d13374e1d925cfc163" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -693,9 +586,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -703,15 +596,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -720,38 +613,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -782,21 +675,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] -name = "gimli" -version = "0.28.1" +name = "getrandom" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] [[package]] -name = "hashbrown" -version = "0.13.2" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "hashbrown" @@ -808,24 +709,12 @@ dependencies = [ "allocator-api2", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hex" version = "0.4.3" @@ -833,46 +722,127 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "human-panic" -version = "2.0.0" +name = "http" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c5d0e9120f6bca6120d142c7ede1ba376dd6bf276d69dd3dbe6cbeb7824179" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ - "anstream", - "anstyle", - "backtrace", - "os_info", - "serde", - "serde_derive", - "toml", - "uuid", + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "log", + "rustls", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", ] [[package]] -name = "humansize" -version = "2.1.3" +name = "hyper-timeout" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "libm", + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", ] [[package]] -name = "humantime" -version = "2.1.0" +name = "hyper-util" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", - "core-foundation-sys 0.8.6", + "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -887,21 +857,156 @@ dependencies = [ ] [[package]] -name = "indenter" -version = "0.3.3" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "indexmap" -version = "2.2.6" +name = "icu_locid_transform_data" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "equivalent", - "hashbrown 0.14.5", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] +[[package]] +name = "icu_normalizer_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indoc" version = "2.0.5" @@ -909,16 +1014,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] -name = "is_terminal_polyfill" -version = "1.70.0" +name = "instability" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -931,24 +1053,35 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] -name = "json5" -version = "0.4.1" +name = "jsonwebtoken" +version = "9.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" dependencies = [ - "pest", - "pest_derive", + "base64", + "js-sys", + "pem", + "ring", "serde", + "serde_json", + "simple_asn1", ] +[[package]] +name = "lab" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f" + [[package]] name = "lazy_static" version = "1.4.0" @@ -956,44 +1089,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "lazycell" -version = "1.3.0" +name = "libc" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] -name = "libc" -version = "0.2.154" +name = "line-clipping" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "76364bf78d7ed059f98564fc5fb94c5a6eb2b6c9edd621cb1528febe1e918b29" +dependencies = [ + "bitflags 2.9.0", +] [[package]] -name = "libm" -version = "0.2.8" +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] -name = "libredox" -version = "0.1.3" +name = "linux-raw-sys" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.5.0", - "libc", -] +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] -name = "linked-hash-map" -version = "0.5.6" +name = "litemap" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] -name = "linux-raw-sys" -version = "0.4.13" +name = "litrs" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] name = "lock_api" @@ -1010,77 +1142,47 @@ name = "log" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -dependencies = [ - "serde", -] [[package]] -name = "log-mdc" -version = "0.1.0" +name = "lru" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown", +] [[package]] -name = "log4rs" -version = "1.3.0" +name = "mac_address" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0816135ae15bd0391cf284eab37e6e3ee0a6ee63d2ceeb659862bd8d0a984ca6" +checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" dependencies = [ - "anyhow", - "arc-swap", - "chrono", - "derivative", - "fnv", - "humantime", - "libc", - "log", - "log-mdc", - "once_cell", - "parking_lot", - "rand", - "serde", - "serde-value", - "serde_json", - "serde_yaml", - "thiserror", - "thread-id", - "typemap-ors", + "nix", "winapi", ] [[package]] -name = "lru" -version = "0.12.3" +name = "memchr" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" -dependencies = [ - "hashbrown 0.14.5", -] +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "mach" -version = "0.3.2" +name = "memmem" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] +checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" [[package]] -name = "matchers" -version = "0.1.0" +name = "memoffset" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ - "regex-automata 0.1.10", + "autocfg", ] -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1098,26 +1200,27 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "log", - "wasi", - "windows-sys 0.48.0", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", ] [[package]] name = "nix" -version = "0.19.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 1.3.2", - "cc", + "bitflags 2.9.0", "cfg-if", + "cfg_aliases", "libc", + "memoffset", ] [[package]] @@ -1131,13 +1234,39 @@ dependencies = [ ] [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "num-bigint" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "overload", - "winapi", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", ] [[package]] @@ -1150,12 +1279,11 @@ dependencies = [ ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "num_threads" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" dependencies = [ - "hermit-abi", "libc", ] @@ -1168,6 +1296,46 @@ dependencies = [ "memchr", ] +[[package]] +name = "octocrab" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaf799a9982a4d0b4b3fa15b4c1ff7daf5bd0597f46456744dcbb6ddc2e4c827" +dependencies = [ + "arc-swap", + "async-trait", + "base64", + "bytes", + "cfg-if", + "chrono", + "either", + "futures", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-timeout", + "hyper-util", + "jsonwebtoken", + "once_cell", + "percent-encoding", + "pin-project", + "secrecy", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "snafu", + "tokio", + "tower", + "tower-http", + "tracing", + "url", + "web-time", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -1175,59 +1343,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "option-ext" -version = "0.2.0" +name = "openssl-probe" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "ordered-float" -version = "2.10.1" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" dependencies = [ "num-traits", ] -[[package]] -name = "ordered-multimap" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ed8acf08e98e744e5384c8bc63ceb0364e68a6854187221c18df61c4797690e" -dependencies = [ - "dlv-list", - "hashbrown 0.13.2", -] - -[[package]] -name = "os_info" -version = "3.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" -dependencies = [ - "log", - "serde", - "windows-sys 0.52.0", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "owo-colors" version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "owo-colors" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" - [[package]] name = "parking_lot" version = "0.12.2" @@ -1248,7 +1383,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets", ] [[package]] @@ -1258,27 +1393,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "pathdiff" -version = "0.2.1" +name = "pem" +version = "3.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.12", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" dependencies = [ "pest", "pest_generator", @@ -1286,28 +1431,100 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" dependencies = [ "once_cell", "pest", "sha2", ] +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -1321,111 +1538,130 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] -name = "pretty_assertions" -version = "1.4.0" +name = "proc-macro2" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ - "diff", - "yansi", + "unicode-ident", ] [[package]] -name = "proc-macro2" -version = "1.0.82" +name = "quote" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ - "unicode-ident", + "proc-macro2", ] [[package]] -name = "procfs" -version = "0.16.0" +name = "r-efi" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "bitflags 2.5.0", - "chrono", - "flate2", - "hex", - "lazy_static", - "procfs-core", - "rustix", + "rand_core", ] [[package]] -name = "procfs-core" -version = "0.16.0" +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "ratatui" +version = "0.30.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" +checksum = "12ad516b947c599840ea2e258c935428bc2f842111c5c9370ddee2117e634aca" dependencies = [ - "bitflags 2.5.0", - "chrono", - "hex", + "instability", + "ratatui-core", + "ratatui-crossterm", + "ratatui-macros", + "ratatui-termwiz", + "ratatui-widgets", + "time", ] [[package]] -name = "quote" -version = "1.0.36" +name = "ratatui-core" +version = "0.1.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "97f3a4e1bfb70ffad2cba06d71ec11c0b5e2a4a8644d9ddae181a61726289ce8" dependencies = [ - "proc-macro2", + "bitflags 2.9.0", + "cassowary", + "compact_str", + "indoc", + "itertools", + "lru", + "paste", + "strum", + "thiserror 2.0.12", + "unicode-segmentation", + "unicode-truncate", + "unicode-width", ] [[package]] -name = "rand" -version = "0.8.5" +name = "ratatui-crossterm" +version = "0.1.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "36224e9526a56d73f31456751b0e1db8587407ae9668cf9df0a6effd31b06385" dependencies = [ - "libc", - "rand_chacha", - "rand_core", + "crossterm 0.28.1", + "instability", + "ratatui-core", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "ratatui-macros" +version = "0.7.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "838b0ba06759a48a773afd376941b3e884a78a36b791a03bfd29fa084a3f43e3" dependencies = [ - "ppv-lite86", - "rand_core", + "ratatui-core", + "ratatui-widgets", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "ratatui-termwiz" +version = "0.1.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "28bd9f7c9dfe497c9ea5816dbf2e6ac40af557d4dd08bdb2c86eeb13f3575f64" dependencies = [ - "getrandom", + "ratatui-core", + "termwiz", ] [[package]] -name = "ratatui" -version = "0.26.2" +name = "ratatui-widgets" +version = "0.3.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564a852040e82671dc50a37d88f3aa83bbc690dfc6844cfe7a2591620206a80" +checksum = "b0d4fed374a3d7851c4152daf92fcb24440e6d4390192a5601e9d19683a3fa0a" dependencies = [ - "bitflags 2.5.0", - "cassowary", - "compact_str", - "crossterm", + "bitflags 2.9.0", "indoc", + "instability", "itertools", - "lru", - "paste", - "stability", + "line-clipping", + "ratatui-core", "strum", + "time", "unicode-segmentation", "unicode-width", ] @@ -1436,103 +1672,126 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.0", ] [[package]] -name = "redox_users" -version = "0.4.5" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "getrandom", - "libredox", - "thiserror", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "regex" -version = "1.10.4" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-syntax", ] [[package]] -name = "regex-automata" -version = "0.1.10" +name = "regex-syntax" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "regex-automata" -version = "0.4.6" +name = "ring" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.3", + "cc", + "cfg-if", + "getrandom 0.2.15", + "libc", + "untrusted", + "windows-sys", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "regex-syntax" -version = "0.8.3" +name = "rustix" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys", +] [[package]] -name = "ron" -version = "0.8.1" +name = "rustix" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ - "base64", - "bitflags 2.5.0", - "serde", - "serde_derive", + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys", ] [[package]] -name = "rust-ini" -version = "0.19.0" +name = "rustls" +version = "0.23.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ - "cfg-if", - "ordered-multimap", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] [[package]] -name = "rustc-demangle" -version = "0.1.24" +name = "rustls-native-certs" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] [[package]] -name = "rustix" -version = "0.38.34" +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.103.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -1547,6 +1806,15 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -1554,22 +1822,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "serde" -version = "1.0.201" +name = "secrecy" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" dependencies = [ - "serde_derive", + "zeroize", ] [[package]] -name = "serde-value" -version = "0.7.0" +name = "security-framework" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "ordered-float", - "serde", + "bitflags 2.9.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.201" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +dependencies = [ + "serde_derive", ] [[package]] @@ -1580,40 +1870,41 @@ checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "serde_spanned" -version = "0.6.5" +name = "serde_path_to_error" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" dependencies = [ + "itoa", "serde", ] [[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ - "indexmap", + "form_urlencoded", "itoa", "ryu", "serde", - "unsafe-libyaml", ] [[package]] @@ -1636,6 +1927,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -1648,9 +1945,9 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", "mio", @@ -1666,6 +1963,24 @@ dependencies = [ "libc", ] +[[package]] +name = "simple_asn1" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" +dependencies = [ + "num-bigint", + "num-traits", + "thiserror 2.0.12", + "time", +] + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" version = "0.4.9" @@ -1682,39 +1997,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] -name = "socket2" -version = "0.5.7" +name = "snafu" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "223891c85e2a29c3fe8fb900c1fae5e69c2e42415e3177752e8718475efa5019" dependencies = [ - "libc", - "windows-sys 0.52.0", + "snafu-derive", ] [[package]] -name = "stability" -version = "0.2.0" +name = "snafu-derive" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" +checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917" dependencies = [ + "heck", + "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "socket2" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +dependencies = [ + "libc", + "windows-sys", +] [[package]] -name = "strip-ansi-escapes" -version = "0.2.0" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa" -dependencies = [ - "vte", -] +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" @@ -1724,26 +2047,32 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.63", + "syn 2.0.100", ] +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "syn" version = "1.0.109" @@ -1757,9 +2086,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.63" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -1767,43 +2096,123 @@ dependencies = [ ] [[package]] -name = "terminal_size" -version = "0.3.0" +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "terminfo" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662" +dependencies = [ + "fnv", + "nom", + "phf", + "phf_codegen", +] + +[[package]] +name = "termios" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" +dependencies = [ + "libc", +] + +[[package]] +name = "termwiz" +version = "0.23.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4676b37242ccbd1aabf56edb093a4827dc49086c0ffd764a5705899e0f35f8f7" +dependencies = [ + "anyhow", + "base64", + "bitflags 2.9.0", + "fancy-regex", + "filedescriptor", + "finl_unicode", + "fixedbitset", + "hex", + "lazy_static", + "libc", + "log", + "memmem", + "nix", + "num-derive", + "num-traits", + "ordered-float", + "pest", + "pest_derive", + "phf", + "sha2", + "signal-hook", + "siphasher", + "terminfo", + "termios", + "thiserror 1.0.69", + "ucd-trie", + "unicode-segmentation", + "vtparse", + "wezterm-bidi", + "wezterm-blob-leases", + "wezterm-color-types", + "wezterm-dynamic", + "wezterm-input-types", + "winapi", +] + +[[package]] +name = "thiserror" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "rustix", - "windows-sys 0.48.0", + "thiserror-impl 1.0.69", ] [[package]] name = "thiserror" -version = "1.0.60" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.12", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", ] [[package]] -name = "thread-id" -version = "4.2.1" +name = "thiserror-impl" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ec81c46e9eb50deaa257be2f148adf052d1fb7701cfd55ccfab2525280b70b" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ - "libc", - "winapi", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -1817,49 +2226,103 @@ dependencies = [ ] [[package]] -name = "tiny-keccak" -version = "2.0.2" +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "crunchy", + "displaydoc", + "zerovec", ] [[package]] name = "tokio" -version = "1.37.0" +version = "1.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -1869,38 +2332,52 @@ dependencies = [ ] [[package]] -name = "toml" -version = "0.8.12" +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", + "bitflags 2.9.0", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "toml_datetime" -version = "0.6.5" +name = "tower-layer" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -dependencies = [ - "serde", -] +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] -name = "toml_edit" -version = "0.22.12" +name = "tower-service" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -1908,6 +2385,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1915,13 +2393,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", ] [[package]] @@ -1944,76 +2422,34 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-subscriber" version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "serde", "sharded-slab", - "smallvec", "thread_local", - "tracing", "tracing-core", - "tracing-log", -] - -[[package]] -name = "tui-input" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e785f863a3af4c800a2a669d0b64c879b538738e352607e2624d03f868dc01" -dependencies = [ - "crossterm", - "serde", - "unicode-width", ] [[package]] -name = "typemap-ors" -version = "1.0.0" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68c24b707f02dd18f1e4ccceb9d49f2058c2fb86384ef9972592904d7a28867" -dependencies = [ - "unsafe-any-ors", -] +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - -[[package]] -name = "unicase" -version = "2.7.0" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unicode-ident" @@ -2023,64 +2459,71 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] -name = "unicode-width" -version = "0.1.12" +name = "unicode-truncate" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "8fbf03860ff438702f3910ca5f28f8dac63c1c11e7efb5012b8b175493606330" +dependencies = [ + "itertools", + "unicode-segmentation", + "unicode-width", +] [[package]] -name = "unsafe-any-ors" -version = "1.0.0" +name = "unicode-width" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a303d30665362d9680d7d91d78b23f5f899504d4f08b3c4cf08d055d87c0ad" -dependencies = [ - "destructure_traitobject", -] +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] -name = "unsafe-libyaml" -version = "0.2.11" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "uom" -version = "0.30.0" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e76503e636584f1e10b9b3b9498538279561adcef5412927ba00c2b32c4ce5ed" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "num-traits", - "typenum", + "form_urlencoded", + "idna", + "percent-encoding", + "serde", ] [[package]] -name = "utf8parse" -version = "0.2.1" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uuid" -version = "1.8.0" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" -dependencies = [ - "getrandom", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] -name = "uzers" -version = "0.12.0" +name = "uuid" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d85875e16d59b3b1549efce83ff8251a64923b03bef94add0a1862847448de4" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ - "libc", - "log", + "atomic", + "getrandom 0.3.2", ] [[package]] @@ -2096,23 +2539,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "vte" -version = "0.11.1" +name = "vtparse" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" +checksum = "6d9b2acfb050df409c972a37d3b8e08cdea3bddb0c09db9d53137e504cfabed0" dependencies = [ "utf8parse", - "vte_generate_state_changes", ] [[package]] -name = "vte_generate_state_changes" -version = "0.1.1" +name = "want" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "proc-macro2", - "quote", + "try-lock", ] [[package]] @@ -2121,36 +2562,46 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", + "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2158,22 +2609,108 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "wezterm-bidi" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0a6e355560527dd2d1cf7890652f4f09bb3433b6aadade4c9b5ed76de5f3ec" +dependencies = [ + "log", + "wezterm-dynamic", +] + +[[package]] +name = "wezterm-blob-leases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692daff6d93d94e29e4114544ef6d5c942a7ed998b37abdc19b17136ea428eb7" +dependencies = [ + "getrandom 0.3.2", + "mac_address", + "sha2", + "thiserror 1.0.69", + "uuid", +] + +[[package]] +name = "wezterm-color-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de81ef35c9010270d63772bebef2f2d6d1f2d20a983d27505ac850b8c4b4296" +dependencies = [ + "csscolorparser", + "deltae", + "lazy_static", + "wezterm-dynamic", +] + +[[package]] +name = "wezterm-dynamic" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f2ab60e120fd6eaa68d9567f3226e876684639d22a4219b313ff69ec0ccd5ac" +dependencies = [ + "log", + "ordered-float", + "strsim", + "thiserror 1.0.69", + "wezterm-dynamic-derive", +] + +[[package]] +name = "wezterm-dynamic-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c0cf2d539c645b448eaffec9ec494b8b19bd5077d9e58cb1ae7efece8d575b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "wezterm-input-types" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "7012add459f951456ec9d6c7e6fc340b1ce15d6fc9629f8c42853412c029e57e" +dependencies = [ + "bitflags 1.3.2", + "euclid", + "lazy_static", + "serde", + "wezterm-dynamic", +] [[package]] name = "winapi" @@ -2199,79 +2736,93 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" dependencies = [ - "windows-targets 0.52.5", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-implement" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ - "windows-targets 0.48.5", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-interface" +version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ - "windows-targets 0.52.5", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-result" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-link", ] [[package]] -name = "windows-targets" -version = "0.52.5" +name = "windows-strings" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows-link", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] [[package]] -name = "windows_aarch64_gnullvm" +name = "windows-targets" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] [[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" +name = "windows_aarch64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2279,12 +2830,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.5" @@ -2297,48 +2842,24 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.5" @@ -2346,28 +2867,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] -name = "winnow" -version = "0.6.8" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "memchr", + "bitflags 2.9.0", ] [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "linked-hash-map", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "yansi" -version = "0.5.1" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "synstructure", +] [[package]] name = "zerocopy" @@ -2386,5 +2928,54 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.100", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] diff --git a/Cargo.toml b/Cargo.toml index 8379be0..2da0825 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,44 +13,13 @@ rust-version = "1.74.1" [[bin]] name = "brt" -[[bin]] -name = "processbar" -path = "src/processbar.rs" - [dependencies] -anyhow = "1.0.83" -battery = "0.7.8" -better-panic = "0.3.0" -clap = { version = "4.5.4", features = ["std", "color", "help", "usage", "error-context", "suggestions", "derive", "cargo", "wrap_help", "unicode", "string", "unstable-styles"] } color-eyre = "0.6.3" -config = "0.14.0" -crossterm = { version = "0.27.0", features = ["serde", "event-stream"] } -derive_deref = "1.1.1" -directories = "5.0.1" -dirs = "5.0.1" -futures = "0.3.30" -human-panic = "2.0.0" -humansize = "2.1.3" -json5 = "0.4.1" -lazy_static = "1.4.0" -libc = "0.2.154" -log = "0.4.21" -log4rs = "1.3.0" -owo-colors = "4.0.0" -pretty_assertions = "1.4.0" -procfs = "0.16.0" -ratatui = { version = "0.26.2", features = ["default", "unstable-widget-ref"] } -serde = { version = "1.0.201", features = ["derive"] } -signal-hook = "0.3.17" -strip-ansi-escapes = "0.2.0" -strum = { version = "0.26.2", features = ["derive"] } -tokio = { version = "1.37.0", features = ["full"] } -tokio-util = "0.7.11" -tracing = "0.1.40" -tracing-error = "0.2.0" -tracing-subscriber = { version = "0.3.18", features = ["env-filter", "serde"] } -tui-input = { version = "0.8.0", features = ["serde"] } -uzers = "0.12.0" +crossterm = { version = "0.29.0", features = ["serde", "event-stream"] } +ratatui = { version = "0.30.0-alpha.2", features = ["default", "unstable-widget-ref"] } +tokio = { version = "1.44.2", features = ["full"] } +tokio-stream = "0.1.17" +octocrab = "0.44.0" [dev-dependencies.cargo-husky] version = "1" diff --git a/src/action.rs b/src/action.rs deleted file mode 100644 index f92f119..0000000 --- a/src/action.rs +++ /dev/null @@ -1,30 +0,0 @@ -use serde::{Deserialize, Serialize}; -use strum::Display; - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Display, Deserialize)] -pub enum Action { - Tick, - Render, - Resize(u16, u16), - Suspend, - Resume, - Quit, - Refresh, - Error(String), - Help, - ToggleShowHelp, - Increment(usize), - Decrement(usize), - CompleteInput(String), - EnterNormal, - EnterInsert, - EnterProcessing, - ExitProcessing, - Up, - Down, - PageUp, - PageDown, - Left, - Right, - Update, -} diff --git a/src/app.rs b/src/app.rs deleted file mode 100644 index 5f516a5..0000000 --- a/src/app.rs +++ /dev/null @@ -1,166 +0,0 @@ -use color_eyre::eyre::Result; -use crossterm::event::KeyEvent; -use ratatui::prelude::Rect; -use serde::{Deserialize, Serialize}; -use tokio::sync::mpsc; - -use crate::{ - action::Action, - components::{fps::FpsCounter, process::Process, Component}, - config::Config, - tui, -}; - -#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub enum Mode { - #[default] - Process, -} - -pub struct App { - pub config: Config, - pub tick_rate: f64, - pub frame_rate: f64, - pub components: Vec>, - pub should_quit: bool, - pub should_suspend: bool, - pub mode: Mode, - pub last_tick_key_events: Vec, -} - -impl App { - pub fn new(tick_rate: f64, frame_rate: f64, debug: bool) -> Result { - let mut process = Process::new(); - process.refresh(); - - let components: Vec> = if debug { - let fps = FpsCounter::new(); - vec![Box::new(process), Box::new(fps)] - } else { - vec![Box::new(process)] - }; - let config = Config::new()?; - let mode = Mode::Process; - Ok(Self { - tick_rate, - frame_rate, - components, - should_quit: false, - should_suspend: false, - config, - mode, - last_tick_key_events: Vec::new(), - }) - } - - pub async fn run(&mut self) -> Result<()> { - let (action_tx, mut action_rx) = mpsc::unbounded_channel(); - - let mut tui = tui::Tui::new()?; - tui.tick_rate(self.tick_rate); - tui.frame_rate(self.frame_rate); - tui.enter()?; - - for component in self.components.iter_mut() { - component.register_action_handler(action_tx.clone())?; - } - - for component in self.components.iter_mut() { - component.register_config_handler(self.config.clone())?; - } - - for component in self.components.iter_mut() { - component.init()?; - } - - loop { - if let Some(e) = tui.next().await { - match e { - tui::Event::Quit => action_tx.send(Action::Quit)?, - tui::Event::Tick => action_tx.send(Action::Tick)?, - tui::Event::Render => action_tx.send(Action::Render)?, - tui::Event::Resize(x, y) => action_tx.send(Action::Resize(x, y))?, - tui::Event::Key(key) => { - if let Some(keymap) = self.config.keybindings.get(&self.mode) { - if let Some(action) = keymap.get(&vec![key]) { - log::info!("Got action: {action:?}"); - action_tx.send(action.clone())?; - } else { - // If the key was not handled as a single key action, - // then consider it for multi-key combinations. - self.last_tick_key_events.push(key); - - // Check for multi-key combinations - if let Some(action) = keymap.get(&self.last_tick_key_events) { - log::info!("Got action: {action:?}"); - action_tx.send(action.clone())?; - } - } - }; - } - _ => {} - } - for component in self.components.iter_mut() { - if let Some(action) = component.handle_events(Some(e.clone()))? { - action_tx.send(action)?; - } - } - } - - while let Ok(action) = action_rx.try_recv() { - match action { - Action::Tick => { - self.last_tick_key_events.drain(..); - } - Action::Quit => self.should_quit = true, - Action::Suspend => self.should_suspend = true, - Action::Resume => self.should_suspend = false, - Action::Resize(w, h) => { - tui.resize(Rect::new(0, 0, w, h))?; - tui.draw(|f| { - for component in self.components.iter_mut() { - let r = component.draw(f, f.size()); - if let Err(e) = r { - action_tx - .send(Action::Error(format!("Failed to draw: {:?}", e))) - .unwrap(); - } - } - })?; - } - Action::Render => { - tui.draw(|f| { - for component in self.components.iter_mut() { - let r = component.draw(f, f.size()); - if let Err(e) = r { - action_tx - .send(Action::Error(format!("Failed to draw: {:?}", e))) - .unwrap(); - } - } - })?; - } - _ => {} - } - for component in self.components.iter_mut() { - if let Some(action) = component.update(action.clone())? { - action_tx.send(action)? - }; - } - } - if self.should_suspend { - tui.suspend()?; - action_tx.send(Action::Resume)?; - tui = tui::Tui::new()?; - tui.tick_rate(self.tick_rate); - tui.frame_rate(self.frame_rate); - tui.enter()?; - } else if self.should_quit { - tui.stop()?; - break; - } - } - tui.exit()?; - Ok(()) - } -} diff --git a/src/cli.rs b/src/cli.rs deleted file mode 100644 index 46badf5..0000000 --- a/src/cli.rs +++ /dev/null @@ -1,34 +0,0 @@ -use clap::Parser; - -use crate::utils::version; - -#[derive(Parser, Debug)] -#[command(author, version = version(), about)] -pub struct Cli { - #[arg( - short, - long, - value_name = "FLOAT", - help = "Tick rate, i.e. number of ticks per second", - default_value_t = 0.2 - )] - pub tick_rate: f64, - - #[arg( - short, - long, - value_name = "FLOAT", - help = "Frame rate, i.e. number of frames per second", - default_value_t = 60.0 - )] - pub frame_rate: f64, - - #[arg( - short = 'x', - long, - value_name = "BOOL", - help = "Show the fps or not", - default_value_t = false - )] - pub debug: bool, -} diff --git a/src/components.rs b/src/components.rs deleted file mode 100644 index 76211bb..0000000 --- a/src/components.rs +++ /dev/null @@ -1,49 +0,0 @@ -use color_eyre::eyre::Result; -use crossterm::event::{KeyEvent, MouseEvent}; -use ratatui::layout::Rect; -use tokio::sync::mpsc::UnboundedSender; - -use crate::{ - action::Action, - config::Config, - tui::{Event, Frame}, -}; - -pub mod battery; -pub mod fps; -pub mod process; - -pub trait Component { - #[allow(unused_variables)] - fn register_action_handler(&mut self, tx: UnboundedSender) -> Result<()> { - Ok(()) - } - #[allow(unused_variables)] - fn register_config_handler(&mut self, config: Config) -> Result<()> { - Ok(()) - } - fn init(&mut self) -> Result<()> { - Ok(()) - } - fn handle_events(&mut self, event: Option) -> Result> { - let r = match event { - Some(Event::Key(key_event)) => self.handle_key_events(key_event)?, - Some(Event::Mouse(mouse_event)) => self.handle_mouse_events(mouse_event)?, - _ => None, - }; - Ok(r) - } - #[allow(unused_variables)] - fn handle_key_events(&mut self, key: KeyEvent) -> Result> { - Ok(None) - } - #[allow(unused_variables)] - fn handle_mouse_events(&mut self, mouse: MouseEvent) -> Result> { - Ok(None) - } - #[allow(unused_variables)] - fn update(&mut self, action: Action) -> Result> { - Ok(None) - } - fn draw(&mut self, f: &mut Frame<'_>, rect: Rect) -> Result<()>; -} diff --git a/src/components/battery.rs b/src/components/battery.rs deleted file mode 100644 index 3315a5b..0000000 --- a/src/components/battery.rs +++ /dev/null @@ -1,84 +0,0 @@ -use battery as battery_model; -use battery::State; -use ratatui::layout::{Constraint, Direction, Layout, Rect}; -use ratatui::text::Line; - -use crate::action::Action; -use crate::components::Component; -use crate::tui::Frame; - -#[derive(Debug)] -pub struct Battery { - battery: Option, -} - -impl Default for Battery { - fn default() -> Self { - Self::new() - } -} - -impl Battery { - pub fn new() -> Self { - Self { battery: None } - } -} - -impl Component for Battery { - fn init(&mut self) -> color_eyre::Result<()> { - let batteries = battery_model::Manager::new().unwrap().batteries(); - if batteries.is_ok() { - let b = batteries.unwrap().next().unwrap().unwrap(); - self.battery = Some(b); - } - Ok(()) - } - - fn update(&mut self, _action: Action) -> color_eyre::Result> { - let _ = self.init(); - Ok(None) - } - - fn draw(&mut self, f: &mut Frame<'_>, rect: Rect) -> color_eyre::Result<()> { - let layout = - Layout::new(Direction::Horizontal, vec![Constraint::Percentage(100)]).split(rect); - let mut state = "○"; - if self.battery.is_some() { - state = match self.battery.as_mut().unwrap().state() { - State::Charging => "▲", - State::Discharging => "▼", - State::Full => "■", - State::Unknown => "○", - State::Empty => "○", - _ => "○", - }; - } - let soc = self.battery.as_mut().unwrap().state_of_charge().value * 100.0; - let percentage = format!("{}%", soc as u32); - let status = format!("{}{} {}", "BAT", state, percentage); - let line = Line::from(status); - f.render_widget(line, layout[0]); - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use log::info; - use ratatui::{backend::TestBackend, prelude::*}; - - #[test] - fn test_battery() { - let mut battery = Battery::default(); - let _ = battery.init(); - let backend = TestBackend::new(40, 20); - let mut terminal = Terminal::new(backend).unwrap(); - let _ = terminal.draw(|frame| { - let _r = battery.draw(frame, Rect::new(3, 3, 10, 1)); - let b = frame.buffer_mut(); - info!("{:#?}", b); - }); - assert_eq!(true, true) - } -} diff --git a/src/components/cpu.rs b/src/components/cpu.rs deleted file mode 100644 index 9019043..0000000 --- a/src/components/cpu.rs +++ /dev/null @@ -1,63 +0,0 @@ -use ratatui::layout::{Constraint, Direction, Layout, Rect}; -use ratatui::text::Line; - -use crate::action::Action; -use crate::components::Component; -use crate::tui::Frame; - -#[derive(Debug)] -pub struct Cpu { - state: bool, -} - -impl Default for Battery { - fn default() -> Self { - Self::new() - } -} - -impl Cpu { - pub fn new() -> Self { - Self { state: false } - } -} - -impl Component for Cpu { - fn init(&mut self) -> color_eyre::Result<()> { - Ok(()) - } - - fn update(&mut self, _action: Action) -> color_eyre::Result> { - let _ = self.init(); - Ok(None) - } - - fn draw(&mut self, f: &mut Frame<'_>, rect: Rect) -> color_eyre::Result<()> { - let layout = - Layout::new(Direction::Horizontal, vec![Constraint::Percentage(100)]).split(rect); - let message = format!("{}", "."); - let line = Line::from(status); - f.render_widget(line, layout[0]); - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use ratatui::{backend::TestBackend, prelude::*}; - - #[test] - fn test_cpu() { - let mut cpu = Cpu::default(); - let _ = battery.init(); - let backend = TestBackend::new(40, 20); - let mut terminal = Terminal::new(backend).unwrap(); - let _ = terminal.draw(|frame| { - let _r = battery.draw(frame, Rect::new(3, 3, 10, 1)); - let b = frame.buffer_mut(); - println!("{:#?}", b); - }); - assert_eq!(true, true) - } -} diff --git a/src/components/fps.rs b/src/components/fps.rs deleted file mode 100644 index b6667b3..0000000 --- a/src/components/fps.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::time::Instant; - -use color_eyre::eyre::Result; -use ratatui::{prelude::*, widgets::*}; - -use super::Component; -use crate::{action::Action, tui::Frame}; - -#[derive(Debug, Clone, PartialEq)] -pub enum Ticker { - AppTick, - RenderTick, -} - -#[derive(Debug, Clone, PartialEq)] -pub struct FpsCounter { - app_start_time: Instant, - app_frames: u32, - app_fps: f64, - - render_start_time: Instant, - render_frames: u32, - render_fps: f64, -} - -impl Default for FpsCounter { - fn default() -> Self { - Self::new() - } -} - -impl FpsCounter { - pub fn new() -> Self { - Self { - app_start_time: Instant::now(), - app_frames: 0, - app_fps: 0.0, - render_start_time: Instant::now(), - render_frames: 0, - render_fps: 0.0, - } - } - - fn app_tick(&mut self) -> Result<()> { - self.app_frames += 1; - let now = Instant::now(); - let elapsed = (now - self.app_start_time).as_secs_f64(); - if elapsed >= 1.0 { - self.app_fps = self.app_frames as f64 / elapsed; - self.app_start_time = now; - self.app_frames = 0; - } - Ok(()) - } - - fn render_tick(&mut self) -> Result<()> { - self.render_frames += 1; - let now = Instant::now(); - let elapsed = (now - self.render_start_time).as_secs_f64(); - if elapsed >= 1.0 { - self.render_fps = self.render_frames as f64 / elapsed; - self.render_start_time = now; - self.render_frames = 0; - } - Ok(()) - } -} - -impl Component for FpsCounter { - fn update(&mut self, action: Action) -> Result> { - if let Action::Tick = action { - self.app_tick()? - }; - if let Action::Render = action { - self.render_tick()? - }; - Ok(None) - } - - fn draw(&mut self, f: &mut Frame<'_>, rect: Rect) -> Result<()> { - let rects = Layout::default() - .direction(Direction::Vertical) - .constraints(vec![ - Constraint::Length(1), // first row - Constraint::Min(0), - ]) - .split(rect); - - let rect = rects[0]; - - let s = format!( - "{:.2} fps (app) {:.2} fps (render)", - self.app_fps, self.render_fps - ); - let block = Block::default().title(block::Title::from(s.dim()).alignment(Alignment::Right)); - f.render_widget(block, rect); - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - #[test] - fn test_fps_app_tick() { - let mut fps = FpsCounter::default(); - let _ = fps.app_tick(); - assert_eq!(fps.app_frames, 1); - } - - #[test] - fn test_fps_render_tick() { - let mut fps = FpsCounter::default(); - let _ = fps.render_tick(); - assert_eq!(fps.render_frames, 1); - } - - #[test] - fn test_fps_update_tick() { - let mut fps = FpsCounter::default(); - let _ = fps.update(Action::Tick); - assert_eq!(fps.app_frames, 1); - assert_eq!(fps.render_frames, 0); - } - - #[test] - fn test_fps_update_render() { - let mut fps = FpsCounter::default(); - let _ = fps.update(Action::Render); - assert_eq!(fps.render_frames, 1); - assert_eq!(fps.app_frames, 0); - } -} diff --git a/src/components/process.rs b/src/components/process.rs deleted file mode 100644 index 251df9f..0000000 --- a/src/components/process.rs +++ /dev/null @@ -1,366 +0,0 @@ -use std::collections::HashMap; -use std::default::Default; -use std::fmt; - -use color_eyre::eyre::Result; -use crossterm::event::{KeyCode, KeyEvent}; -use log::{debug, info, warn}; -use procfs::process::all_processes; -use ratatui::layout::Constraint::{Fill, Length, Percentage}; -use ratatui::widgets::block::{Position, Title}; -use ratatui::widgets::TableState; -use ratatui::{prelude::*, widgets::*}; -use tokio::sync::mpsc::UnboundedSender; -use tui_input::Input; - -use super::{Component, Frame}; -use crate::action::Action; -use crate::components::process::Order::{Command, Cpu, Name, NumberOfThreads, Pid}; -use crate::model::{create_rows, to_brt_process, BrtProcess}; - -#[derive(Default, Copy, Clone, PartialEq, Eq, Debug)] -pub enum Order { - #[default] - Pid, - Name, - Command, - NumberOfThreads, - Cpu, -} - -impl Order { - fn next(&self) -> Self { - use Order::*; - match *self { - Pid => Name, - Name => Command, - Command => NumberOfThreads, - NumberOfThreads => Cpu, - Cpu => Pid, - } - } - - fn previous(&self) -> Self { - use Order::*; - match *self { - Pid => Cpu, - Cpu => NumberOfThreads, - NumberOfThreads => Command, - Command => Name, - Name => Pid, - } - } -} - -impl fmt::Display for Order { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - Pid => write!(f, "pid"), - Name => write!(f, "name"), - Command => write!(f, "command"), - NumberOfThreads => write!(f, "threads"), - Cpu => write!(f, "cpu"), - } - } -} - -#[derive(Default, Debug)] -pub struct Process { - pub show_help: bool, - pub app_ticker: usize, - pub render_ticker: usize, - pub input: Input, - pub process_map: HashMap, - pub processes: Vec, - pub order: Order, - pub scrollbar_state: ScrollbarState, - pub state: TableState, - pub action_tx: Option>, -} - -impl Process { - pub fn new() -> Process { - let mut process = Process::default(); - process.process_map = process.get_processes(); - process.processes = process.process_map.clone().into_values().collect(); - process.state = TableState::new().with_selected(Some(0)); - process - } - - pub fn refresh(&mut self) { - let length = self.process_map.len(); - let new_processes = self.get_processes(); - let mut updated_processes = HashMap::new(); - for (pid, process) in new_processes { - let old_process_option = self.process_map.get(&pid); - if old_process_option.is_some() { - let mut old_process = old_process_option.unwrap().clone(); - old_process.cpus.push_back(process.cpu); - old_process.cpus.pop_front(); - old_process.cpu_graph = crate::model::get_cpu_graph(&old_process.cpus); - updated_processes.insert(pid, old_process); - }; - } - self.process_map = updated_processes; - self.processes = self.process_map.clone().into_values().collect(); - self.scrollbar_state = self.scrollbar_state.content_length(length); - } - - pub fn order_string(&mut self) -> String { - format!("{} {} {}", "<".red(), self.order, ">".red()) - } - - pub fn tick(&mut self) { - self.app_ticker = self.app_ticker.saturating_add(1); - // if self.app_ticker % 5 == 0 { - // self.processes = self.get_all_processes(); - self.refresh(); - - self.order_by_enum(); - info!("Refreshed process list."); - // } - } - - fn get_processes(&mut self) -> HashMap { - let processes: HashMap = all_processes() - .expect("Can't read /proc") - .filter_map(|p| match p { - Ok(p) => { - let brt_process = to_brt_process(&p); - if brt_process.is_some() { - Some((p.pid, brt_process?)) - } else { - None - } - } - Err(e) => match e { - procfs::ProcError::NotFound(_) => None, - procfs::ProcError::Io(_e, _path) => None, - x => { - warn!("Can't read process due to error {x:?}"); - None - } - }, - }) - .collect(); - processes - } - - pub fn order_by_enum(&mut self) { - let order = self.order; - match order { - Pid => self.order_by_pid(), - Name => self.order_by_program(), - Command => self.order_by_command(), - NumberOfThreads => self.order_by_number_of_threads(), - Cpu => self.order_by_cpu(), - } - } - - pub fn order_by_pid(&mut self) { - self.processes.sort_by(|a, b| a.pid.cmp(&b.pid)) - } - - pub fn order_by_program(&mut self) { - self.processes.sort_by(|a, b| a.program.cmp(&b.program)) - } - - pub fn order_by_command(&mut self) { - self.processes.sort_by(|a, b| a.command.cmp(&b.command)) - } - - pub fn order_by_number_of_threads(&mut self) { - self.processes.sort_by(|a, b| { - a.number_of_threads - .partial_cmp(&b.number_of_threads) - .unwrap() - }) - } - - pub fn order_by_cpu(&mut self) { - self.processes - .sort_by(|a, b| a.cpu.partial_cmp(&b.cpu).unwrap()) - } - - pub fn render_tick(&mut self) { - info!("Render Tick"); - self.render_ticker = self.render_ticker.saturating_add(1); - } - - pub fn jump(&mut self, steps: i64) { - let location = self.state.selected().unwrap_or(0) as i64; - let length = self.process_map.len() as i64; - debug!( - "Move {} steps in [{}..{}] when current location is {}.", - steps, 0, length, location - ); - let mut index = location + steps; - while index < 0 { - index += length; - } - let new_location = (index % length) as usize; - debug!("New location is {}.", new_location); - self.state.select(Some(new_location)); - self.scrollbar_state = self.scrollbar_state.position(new_location); - } -} - -impl Component for Process { - fn register_action_handler(&mut self, tx: UnboundedSender) -> Result<()> { - self.action_tx = Some(tx); - Ok(()) - } - - fn handle_key_events(&mut self, key: KeyEvent) -> Result> { - debug!("Handling {:?}.", key); - let action = match key.code { - KeyCode::Up => Action::Up, - KeyCode::Down => Action::Down, - KeyCode::PageUp => Action::PageUp, - KeyCode::PageDown => Action::PageDown, - KeyCode::Left => Action::Left, - KeyCode::Right => Action::Right, - KeyCode::Esc => Action::Quit, - _ => Action::Update, - }; - Ok(Some(action)) - } - - fn update(&mut self, action: Action) -> Result> { - match action { - Action::Tick => self.tick(), - Action::Render => self.render_tick(), - Action::Up => self.jump(-1), - Action::Down => self.jump(1), - Action::PageUp => self.jump(-20), - Action::PageDown => self.jump(20), - Action::Left => { - self.order = self.order.previous(); - self.order_by_enum(); - } - Action::Right => { - self.order = self.order.next(); - self.order_by_enum(); - } - _ => (), - } - Ok(None) - } - - fn draw(&mut self, f: &mut Frame<'_>, _rect: Rect) -> Result<()> { - let layout = Layout::default() - .direction(Direction::Vertical) - .constraints([Percentage(100)]) - .split(f.size()); - - let rows = create_rows(&self.processes); - - let scrollbar = Scrollbar::new(ScrollbarOrientation::VerticalRight) - .begin_symbol(Some("↑")) - .end_symbol(Some("↓")) - .track_symbol(Some(" ")) - .style(Color::White); - - let selected_style = Style::default() - .bg(Color::Rgb(0xd4, 0x54, 0x54)) - .fg(Color::White) - .add_modifier(Modifier::BOLD); - - let header = [ - Cell::new(Line::from("Pid:").alignment(Alignment::Right)), - Cell::new("Program:"), - Cell::new("Command:"), - Cell::new(Line::from("Threads:").alignment(Alignment::Right)), - Cell::new("User:"), - Cell::new("MemB"), - Cell::new(""), - Cell::new("Cpu%"), - ] - .iter() - .cloned() - .map(Cell::from) - .collect::() - .height(1) - .style(Style::default().bold()); - - let processes = self.processes.len(); - let process = format!("{}/{}", self.state.selected().unwrap() + 1, processes); - - let block = Block::default() - .title(Title::from("brt").alignment(Alignment::Center)) - .title(Title::from(self.order_string()).alignment(Alignment::Right)) - .title( - Title::from(process) - .position(Position::Bottom) - .alignment(Alignment::Right), - ) - .borders(Borders::ALL) - .border_style(Style::default().fg(Color::White)) - .border_type(BorderType::Rounded); - - let widths = [ - Percentage(5), - Percentage(15), - Fill(1), - Percentage(5), - Percentage(5), - Length(5), - Length(5), - Length(5), - ]; - - let table = Table::new(rows, widths) - .block(block) - .header(header) - .highlight_style(selected_style); - - f.render_stateful_widget(table, layout[0], &mut self.state); - f.render_stateful_widget( - scrollbar, - layout[0].inner(&Margin { - vertical: 1, - horizontal: 1, - }), - &mut self.scrollbar_state, - ); - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use std::collections::VecDeque; - - #[test] - fn test_brt_process_new() { - let process = BrtProcess::new(); - assert_eq!(process.pid, 0); - assert_eq!(process.cpus, VecDeque::from(vec![0_f64; 10])); - } - - #[test] - fn test_process_jump() { - let mut process = Process::new(); - process.process_map = process.get_processes(); - assert_eq!(process.state.selected(), Some(0)); - process.jump(5); - assert_eq!(process.state.selected(), Some(5)); - process.jump(5); - assert_eq!(process.state.selected(), Some(10)); - process.jump(-15); - assert_eq!( - process.state.selected(), - Some(process.process_map.len() - 5) - ); - process.jump(4); - assert_eq!( - process.state.selected(), - Some(process.process_map.len() - 1) - ); - process.jump(1); - assert_eq!(process.state.selected(), Some(0)); - process.jump(1); - assert_eq!(process.state.selected(), Some(1)); - } -} diff --git a/src/config.rs b/src/config.rs deleted file mode 100644 index c3a71d9..0000000 --- a/src/config.rs +++ /dev/null @@ -1,558 +0,0 @@ -use std::{collections::HashMap, path::PathBuf}; - -use color_eyre::eyre::Result; -use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; -use derive_deref::{Deref, DerefMut}; -use ratatui::style::{Color, Modifier, Style}; -use serde::{de::Deserializer, Deserialize}; - -use crate::{action::Action, app::Mode}; - -const CONFIG: &str = include_str!("../.config/config.json5"); - -#[derive(Clone, Debug, Deserialize, Default)] -pub struct AppConfig { - #[serde(default)] - pub _data_dir: PathBuf, - #[serde(default)] - pub _config_dir: PathBuf, -} - -#[derive(Clone, Debug, Default, Deserialize)] -pub struct Config { - #[serde(default, flatten)] - pub config: AppConfig, - #[serde(default)] - pub keybindings: KeyBindings, - #[serde(default)] - pub styles: Styles, -} - -impl Config { - pub fn new() -> Result { - let default_config: Config = json5::from_str(CONFIG).unwrap(); - let data_dir = crate::utils::get_data_dir(); - let config_dir = crate::utils::get_config_dir(); - let mut builder = config::Config::builder() - .set_default("_data_dir", data_dir.to_str().unwrap())? - .set_default("_config_dir", config_dir.to_str().unwrap())?; - - let config_files = [ - ("config.json5", config::FileFormat::Json5), - ("config.json", config::FileFormat::Json), - ("config.yaml", config::FileFormat::Yaml), - ("config.toml", config::FileFormat::Toml), - ("config.ini", config::FileFormat::Ini), - ]; - let mut found_config = false; - for (file, format) in &config_files { - builder = builder.add_source( - config::File::from(config_dir.join(file)) - .format(*format) - .required(false), - ); - if config_dir.join(file).exists() { - found_config = true - } - } - if !found_config { - log::error!("No configuration file found. Application may not behave as expected"); - } - - let mut cfg: Self = builder.build()?.try_deserialize()?; - - for (mode, default_bindings) in default_config.keybindings.iter() { - let user_bindings = cfg.keybindings.entry(*mode).or_default(); - for (key, cmd) in default_bindings.iter() { - user_bindings - .entry(key.clone()) - .or_insert_with(|| cmd.clone()); - } - } - for (mode, default_styles) in default_config.styles.iter() { - let user_styles = cfg.styles.entry(*mode).or_default(); - for (style_key, style) in default_styles.iter() { - user_styles - .entry(style_key.clone()) - .or_insert_with(|| *style); - } - } - - Ok(cfg) - } -} - -#[derive(Clone, Debug, Default, Deref, DerefMut)] -pub struct KeyBindings(pub HashMap, Action>>); - -impl<'de> Deserialize<'de> for KeyBindings { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let parsed_map = HashMap::>::deserialize(deserializer)?; - - let keybindings = parsed_map - .into_iter() - .map(|(mode, inner_map)| { - let converted_inner_map = inner_map - .into_iter() - .map(|(key_str, cmd)| (parse_key_sequence(&key_str).unwrap(), cmd)) - .collect(); - (mode, converted_inner_map) - }) - .collect(); - - Ok(KeyBindings(keybindings)) - } -} - -fn parse_key_event(raw: &str) -> Result { - let raw_lower = raw.to_ascii_lowercase(); - let (remaining, modifiers) = extract_modifiers(&raw_lower); - parse_key_code_with_modifiers(remaining, modifiers) -} - -fn extract_modifiers(raw: &str) -> (&str, KeyModifiers) { - let mut modifiers = KeyModifiers::empty(); - let mut current = raw; - - loop { - match current { - rest if rest.starts_with("ctrl-") => { - modifiers.insert(KeyModifiers::CONTROL); - current = &rest[5..]; - } - rest if rest.starts_with("alt-") => { - modifiers.insert(KeyModifiers::ALT); - current = &rest[4..]; - } - rest if rest.starts_with("shift-") => { - modifiers.insert(KeyModifiers::SHIFT); - current = &rest[6..]; - } - _ => break, // break out of the loop if no known prefix is detected - }; - } - - (current, modifiers) -} - -fn parse_key_code_with_modifiers( - raw: &str, - mut modifiers: KeyModifiers, -) -> Result { - let c = match raw { - "esc" => KeyCode::Esc, - "enter" => KeyCode::Enter, - "left" => KeyCode::Left, - "right" => KeyCode::Right, - "up" => KeyCode::Up, - "down" => KeyCode::Down, - "home" => KeyCode::Home, - "end" => KeyCode::End, - "pageup" => KeyCode::PageUp, - "pagedown" => KeyCode::PageDown, - "backtab" => { - modifiers.insert(KeyModifiers::SHIFT); - KeyCode::BackTab - } - "backspace" => KeyCode::Backspace, - "delete" => KeyCode::Delete, - "insert" => KeyCode::Insert, - "f1" => KeyCode::F(1), - "f2" => KeyCode::F(2), - "f3" => KeyCode::F(3), - "f4" => KeyCode::F(4), - "f5" => KeyCode::F(5), - "f6" => KeyCode::F(6), - "f7" => KeyCode::F(7), - "f8" => KeyCode::F(8), - "f9" => KeyCode::F(9), - "f10" => KeyCode::F(10), - "f11" => KeyCode::F(11), - "f12" => KeyCode::F(12), - "space" => KeyCode::Char(' '), - "hyphen" => KeyCode::Char('-'), - "minus" => KeyCode::Char('-'), - "tab" => KeyCode::Tab, - c if c.len() == 1 => { - let mut c = c.chars().next().unwrap(); - if modifiers.contains(KeyModifiers::SHIFT) { - c = c.to_ascii_uppercase(); - } - KeyCode::Char(c) - } - _ => return Err(format!("Unable to parse {raw}")), - }; - Ok(KeyEvent::new(c, modifiers)) -} - -pub fn key_event_to_string(key_event: &KeyEvent) -> String { - let char; - let key_code = match key_event.code { - KeyCode::Backspace => "backspace", - KeyCode::Enter => "enter", - KeyCode::Left => "left", - KeyCode::Right => "right", - KeyCode::Up => "up", - KeyCode::Down => "down", - KeyCode::Home => "home", - KeyCode::End => "end", - KeyCode::PageUp => "pageup", - KeyCode::PageDown => "pagedown", - KeyCode::Tab => "tab", - KeyCode::BackTab => "backtab", - KeyCode::Delete => "delete", - KeyCode::Insert => "insert", - KeyCode::F(c) => { - char = format!("f({c})"); - &char - } - KeyCode::Char(' ') => "space", - KeyCode::Char(c) => { - char = c.to_string(); - &char - } - KeyCode::Esc => "esc", - KeyCode::Null => "", - KeyCode::CapsLock => "", - KeyCode::Menu => "", - KeyCode::ScrollLock => "", - KeyCode::Media(_) => "", - KeyCode::NumLock => "", - KeyCode::PrintScreen => "", - KeyCode::Pause => "", - KeyCode::KeypadBegin => "", - KeyCode::Modifier(_) => "", - }; - - let mut modifiers = Vec::with_capacity(3); - - if key_event.modifiers.intersects(KeyModifiers::CONTROL) { - modifiers.push("ctrl"); - } - - if key_event.modifiers.intersects(KeyModifiers::SHIFT) { - modifiers.push("shift"); - } - - if key_event.modifiers.intersects(KeyModifiers::ALT) { - modifiers.push("alt"); - } - - let mut key = modifiers.join("-"); - - if !key.is_empty() { - key.push('-'); - } - key.push_str(key_code); - - key -} - -pub fn parse_key_sequence(raw: &str) -> Result, String> { - if raw.chars().filter(|c| *c == '>').count() != raw.chars().filter(|c| *c == '<').count() { - return Err(format!("Unable to parse `{}`", raw)); - } - let raw = if !raw.contains("><") { - let raw = raw.strip_prefix('<').unwrap_or(raw); - let raw = raw.strip_prefix('>').unwrap_or(raw); - raw - } else { - raw - }; - let sequences = raw - .split("><") - .map(|seq| { - if let Some(s) = seq.strip_prefix('<') { - s - } else if let Some(s) = seq.strip_suffix('>') { - s - } else { - seq - } - }) - .collect::>(); - - sequences.into_iter().map(parse_key_event).collect() -} - -#[derive(Clone, Debug, Default, Deref, DerefMut)] -pub struct Styles(pub HashMap>); - -impl<'de> Deserialize<'de> for Styles { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let parsed_map = HashMap::>::deserialize(deserializer)?; - - let styles = parsed_map - .into_iter() - .map(|(mode, inner_map)| { - let converted_inner_map = inner_map - .into_iter() - .map(|(str, style)| (str, parse_style(&style))) - .collect(); - (mode, converted_inner_map) - }) - .collect(); - - Ok(Styles(styles)) - } -} - -pub fn parse_style(line: &str) -> Style { - let (foreground, background) = - line.split_at(line.to_lowercase().find("on ").unwrap_or(line.len())); - let foreground = process_color_string(foreground); - let background = process_color_string(&background.replace("on ", "")); - - let mut style = Style::default(); - if let Some(fg) = parse_color(&foreground.0) { - style = style.fg(fg); - } - if let Some(bg) = parse_color(&background.0) { - style = style.bg(bg); - } - style = style.add_modifier(foreground.1 | background.1); - style -} - -fn process_color_string(color_str: &str) -> (String, Modifier) { - let color = color_str - .replace("grey", "gray") - .replace("bright ", "") - .replace("bold ", "") - .replace("underline ", "") - .replace("inverse ", ""); - - let mut modifiers = Modifier::empty(); - if color_str.contains("underline") { - modifiers |= Modifier::UNDERLINED; - } - if color_str.contains("bold") { - modifiers |= Modifier::BOLD; - } - if color_str.contains("inverse") { - modifiers |= Modifier::REVERSED; - } - - (color, modifiers) -} - -fn parse_color(s: &str) -> Option { - let s = s.trim_start(); - let s = s.trim_end(); - if s.contains("bright color") { - let s = s.trim_start_matches("bright "); - let c = s - .trim_start_matches("color") - .parse::() - .unwrap_or_default(); - Some(Color::Indexed(c.wrapping_shl(8))) - } else if s.contains("color") { - let c = s - .trim_start_matches("color") - .parse::() - .unwrap_or_default(); - Some(Color::Indexed(c)) - } else if s.contains("gray") { - let c = 232 - + s.trim_start_matches("gray") - .parse::() - .unwrap_or_default(); - Some(Color::Indexed(c)) - } else if s.contains("rgb") { - let red = (s.as_bytes()[3] as char).to_digit(10).unwrap_or_default() as u8; - let green = (s.as_bytes()[4] as char).to_digit(10).unwrap_or_default() as u8; - let blue = (s.as_bytes()[5] as char).to_digit(10).unwrap_or_default() as u8; - let c = 16 + red * 36 + green * 6 + blue; - Some(Color::Indexed(c)) - } else if s == "bold black" { - Some(Color::Indexed(8)) - } else if s == "bold red" { - Some(Color::Indexed(9)) - } else if s == "bold green" { - Some(Color::Indexed(10)) - } else if s == "bold yellow" { - Some(Color::Indexed(11)) - } else if s == "bold blue" { - Some(Color::Indexed(12)) - } else if s == "bold magenta" { - Some(Color::Indexed(13)) - } else if s == "bold cyan" { - Some(Color::Indexed(14)) - } else if s == "bold white" { - Some(Color::Indexed(15)) - } else if s == "black" { - Some(Color::Indexed(0)) - } else if s == "red" { - Some(Color::Indexed(1)) - } else if s == "green" { - Some(Color::Indexed(2)) - } else if s == "yellow" { - Some(Color::Indexed(3)) - } else if s == "blue" { - Some(Color::Indexed(4)) - } else if s == "magenta" { - Some(Color::Indexed(5)) - } else if s == "cyan" { - Some(Color::Indexed(6)) - } else if s == "white" { - Some(Color::Indexed(7)) - } else { - None - } -} - -#[cfg(test)] -mod tests { - use pretty_assertions::assert_eq; - - use super::*; - - #[test] - fn test_parse_style_default() { - let style = parse_style(""); - assert_eq!(style, Style::default()); - } - - #[test] - fn test_parse_style_foreground() { - let style = parse_style("red"); - assert_eq!(style.fg, Some(Color::Indexed(1))); - } - - #[test] - fn test_parse_style_background() { - let style = parse_style("on blue"); - assert_eq!(style.bg, Some(Color::Indexed(4))); - } - - #[test] - fn test_parse_style_modifiers() { - let style = parse_style("underline red on blue"); - assert_eq!(style.fg, Some(Color::Indexed(1))); - assert_eq!(style.bg, Some(Color::Indexed(4))); - } - - #[test] - fn test_process_color_string() { - let (color, modifiers) = process_color_string("underline bold inverse gray"); - assert_eq!(color, "gray"); - assert!(modifiers.contains(Modifier::UNDERLINED)); - assert!(modifiers.contains(Modifier::BOLD)); - assert!(modifiers.contains(Modifier::REVERSED)); - } - - #[test] - fn test_parse_color_rgb() { - let color = parse_color("rgb123"); - let expected = 67; - assert_eq!(color, Some(Color::Indexed(expected))); - } - - #[test] - fn test_parse_color_unknown() { - let color = parse_color("unknown"); - assert_eq!(color, None); - } - - #[test] - fn test_config() -> Result<()> { - let c = Config::new()?; - assert_eq!( - c.keybindings - .get(&Mode::Process) - .unwrap() - .get(&parse_key_sequence("").unwrap_or_default()) - .unwrap(), - &Action::Quit - ); - Ok(()) - } - - #[test] - fn test_simple_keys() { - assert_eq!( - parse_key_event("a").unwrap(), - KeyEvent::new(KeyCode::Char('a'), KeyModifiers::empty()) - ); - - assert_eq!( - parse_key_event("enter").unwrap(), - KeyEvent::new(KeyCode::Enter, KeyModifiers::empty()) - ); - - assert_eq!( - parse_key_event("esc").unwrap(), - KeyEvent::new(KeyCode::Esc, KeyModifiers::empty()) - ); - } - - #[test] - fn test_with_modifiers() { - assert_eq!( - parse_key_event("ctrl-a").unwrap(), - KeyEvent::new(KeyCode::Char('a'), KeyModifiers::CONTROL) - ); - - assert_eq!( - parse_key_event("alt-enter").unwrap(), - KeyEvent::new(KeyCode::Enter, KeyModifiers::ALT) - ); - - assert_eq!( - parse_key_event("shift-esc").unwrap(), - KeyEvent::new(KeyCode::Esc, KeyModifiers::SHIFT) - ); - } - - #[test] - fn test_multiple_modifiers() { - assert_eq!( - parse_key_event("ctrl-alt-a").unwrap(), - KeyEvent::new( - KeyCode::Char('a'), - KeyModifiers::CONTROL | KeyModifiers::ALT - ) - ); - - assert_eq!( - parse_key_event("ctrl-shift-enter").unwrap(), - KeyEvent::new(KeyCode::Enter, KeyModifiers::CONTROL | KeyModifiers::SHIFT) - ); - } - - #[test] - fn test_reverse_multiple_modifiers() { - assert_eq!( - key_event_to_string(&KeyEvent::new( - KeyCode::Char('a'), - KeyModifiers::CONTROL | KeyModifiers::ALT - )), - "ctrl-alt-a".to_string() - ); - } - - #[test] - fn test_invalid_keys() { - assert!(parse_key_event("invalid-key").is_err()); - assert!(parse_key_event("ctrl-invalid-key").is_err()); - } - - #[test] - fn test_case_insensitivity() { - assert_eq!( - parse_key_event("CTRL-a").unwrap(), - KeyEvent::new(KeyCode::Char('a'), KeyModifiers::CONTROL) - ); - - assert_eq!( - parse_key_event("AlT-eNtEr").unwrap(), - KeyEvent::new(KeyCode::Enter, KeyModifiers::ALT) - ); - } -} diff --git a/src/logger.rs b/src/logger.rs deleted file mode 100644 index 4f6ebfe..0000000 --- a/src/logger.rs +++ /dev/null @@ -1,45 +0,0 @@ -use log::LevelFilter; -use log4rs::append::file::FileAppender; -use log4rs::config::{Appender, Logger, Root}; -use log4rs::encode::pattern::PatternEncoder; -use log4rs::Config; -use std::path::PathBuf; - -const LOG_PATTERN: &str = "{d(%Y-%m-%d %H:%M:%S)} | {l} | {f}:{L} | {m}{n}"; - -pub fn initialize_logging() { - let data_local_dir = if let Ok(s) = std::env::var("BRT_DATA") { - PathBuf::from(s) - } else { - dirs::data_local_dir() - .expect("Unable to find data directory for brt") - .join("brt") - }; - - std::fs::create_dir_all(&data_local_dir) - .unwrap_or_else(|_| panic!("Unable to create {:?}", data_local_dir)); - - let logfile = FileAppender::builder() - .encoder(Box::new(PatternEncoder::new(LOG_PATTERN))) - .build(data_local_dir.join("brt.log")) - .expect("Failed to build log file appender."); - - let levelfilter = match std::env::var("BRT_LOG_LEVEL") - .unwrap_or_else(|_| "info".to_string()) - .as_str() - { - "off" => LevelFilter::Off, - "warn" => LevelFilter::Warn, - "info" => LevelFilter::Info, - "debug" => LevelFilter::Debug, - "trace" => LevelFilter::Trace, - _ => LevelFilter::Info, - }; - let config = Config::builder() - .appender(Appender::builder().build("logfile", Box::new(logfile))) - .logger(Logger::builder().build("brt", levelfilter)) - .build(Root::builder().appender("logfile").build(LevelFilter::Info)) - .expect("Failed to build logging config."); - - log4rs::init_config(config).expect("Failed to initialize logging."); -} diff --git a/src/main.rs b/src/main.rs index 37e07b3..47457aa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,40 +1,209 @@ -pub mod action; -pub mod app; -pub mod cli; -pub mod components; -pub mod config; -pub mod model; -pub mod tui; -pub mod utils; -pub mod widgets; +use std::sync::{Arc, RwLock}; +use std::time::Duration; -use clap::Parser; -use cli::Cli; -use color_eyre::eyre::Result; +use color_eyre::Result; +use crossterm::event::{Event, EventStream, KeyCode, KeyEventKind}; +use octocrab::params::pulls::Sort; +use octocrab::params::Direction; +use octocrab::Page; +use ratatui::buffer::Buffer; +use ratatui::layout::{Constraint, Layout, Rect}; +use ratatui::style::{Style, Stylize}; +use ratatui::text::Line; +use ratatui::widgets::{Block, HighlightSpacing, Row, StatefulWidget, Table, TableState, Widget}; +use ratatui::{DefaultTerminal, Frame}; +use tokio_stream::StreamExt; -use crate::{ - app::App, - utils::{initialize_logging, initialize_panic_handler}, -}; +#[tokio::main] +async fn main() -> Result<()> { + color_eyre::install()?; + let terminal = ratatui::init(); + let app_result = App::default().run(terminal).await; + ratatui::restore(); + app_result +} -async fn tokio_main() -> Result<()> { - initialize_logging()?; +#[derive(Debug, Default)] +struct App { + should_quit: bool, + pull_requests: PullRequestListWidget, +} - initialize_panic_handler()?; +impl App { + const FRAMES_PER_SECOND: f32 = 60.0; - let args = Cli::parse(); - let mut app = App::new(args.tick_rate, args.frame_rate, args.debug)?; - app.run().await?; + pub async fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> { + self.pull_requests.run(); - Ok(()) -} + let period = Duration::from_secs_f32(1.0 / Self::FRAMES_PER_SECOND); + let mut interval = tokio::time::interval(period); + let mut events = EventStream::new(); -#[tokio::main] -async fn main() -> Result<()> { - if let Err(e) = tokio_main().await { - eprintln!("{} error: Something went wrong", env!("CARGO_PKG_NAME")); - Err(e) - } else { + while !self.should_quit { + tokio::select! { + _ = interval.tick() => { terminal.draw(|frame| self.draw(frame))?; }, + Some(Ok(event)) = events.next() => self.handle_event(&event), + } + } Ok(()) } + + fn draw(&self, frame: &mut Frame) { + let vertical = Layout::vertical([Constraint::Length(1), Constraint::Fill(1)]); + let [title_area, body_area] = vertical.areas(frame.area()); + let title = Line::from("Ratatui async example").centered().bold(); + frame.render_widget(title, title_area); + frame.render_widget(&self.pull_requests, body_area); + } + + fn handle_event(&mut self, event: &Event) { + if let Event::Key(key) = event { + if key.kind == KeyEventKind::Press { + match key.code { + KeyCode::Char('q') | KeyCode::Esc => self.should_quit = true, + KeyCode::Char('j') | KeyCode::Down => self.pull_requests.scroll_down(), + KeyCode::Char('k') | KeyCode::Up => self.pull_requests.scroll_up(), + _ => {} + } + } + } + } +} + +/// A widget that displays a list of pull requests. +/// +/// This is an async widget that fetches the list of pull requests from the GitHub API. It contains +/// an inner `Arc>` that holds the state of the widget. Cloning the +/// widget will clone the Arc, so you can pass it around to other threads, and this is used to spawn +/// a background task to fetch the pull requests. +#[derive(Debug, Clone, Default)] +struct PullRequestListWidget { + state: Arc>, +} + +#[derive(Debug, Default)] +struct PullRequestListState { + pull_requests: Vec, + loading_state: LoadingState, + table_state: TableState, +} + +#[derive(Debug, Clone)] +struct PullRequest { + id: String, + title: String, + url: String, +} + +#[derive(Debug, Clone, Default, PartialEq, Eq)] +enum LoadingState { + #[default] + Idle, + Loading, + Loaded, + Error(String), +} + +impl PullRequestListWidget { + /// Start fetching the pull requests in the background. + /// + /// This method spawns a background task that fetches the pull requests from the GitHub API. + /// The result of the fetch is then passed to the `on_load` or `on_err` methods. + fn run(&self) { + let this = self.clone(); // clone the widget to pass to the background task + tokio::spawn(this.fetch_pulls()); + } + + async fn fetch_pulls(self) { + // this runs once, but you could also run this in a loop, using a channel that accepts + // messages to refresh on demand, or with an interval timer to refresh every N seconds + self.set_loading_state(LoadingState::Loading); + match octocrab::instance() + .pulls("ratatui", "ratatui") + .list() + .sort(Sort::Updated) + .direction(Direction::Descending) + .send() + .await + { + Ok(page) => self.on_load(&page), + Err(err) => self.on_err(&err), + } + } + fn on_load(&self, page: &Page) { + let prs = page.items.iter().map(Into::into); + let mut state = self.state.write().unwrap(); + state.loading_state = LoadingState::Loaded; + state.pull_requests.extend(prs); + if !state.pull_requests.is_empty() { + state.table_state.select(Some(0)); + } + } + + fn on_err(&self, err: &octocrab::Error) { + self.set_loading_state(LoadingState::Error(err.to_string())); + } + + fn set_loading_state(&self, state: LoadingState) { + self.state.write().unwrap().loading_state = state; + } + + fn scroll_down(&self) { + self.state.write().unwrap().table_state.scroll_down_by(1); + } + + fn scroll_up(&self) { + self.state.write().unwrap().table_state.scroll_up_by(1); + } +} + +type OctoPullRequest = octocrab::models::pulls::PullRequest; + +impl From<&OctoPullRequest> for PullRequest { + fn from(pr: &OctoPullRequest) -> Self { + Self { + id: pr.number.to_string(), + title: pr.title.as_ref().unwrap().to_string(), + url: pr + .html_url + .as_ref() + .map(ToString::to_string) + .unwrap_or_default(), + } + } +} + +impl Widget for &PullRequestListWidget { + fn render(self, area: Rect, buf: &mut Buffer) { + let mut state = self.state.write().unwrap(); + + // a block with a right aligned title with the loading state on the right + let loading_state = Line::from(format!("{:?}", state.loading_state)).right_aligned(); + let block = Block::bordered() + .title("Pull Requests") + .title(loading_state) + .title_bottom("j/k to scroll, q to quit"); + + // a table with the list of pull requests + let rows = state.pull_requests.iter(); + let widths = [ + Constraint::Length(5), + Constraint::Fill(1), + Constraint::Max(49), + ]; + let table = Table::new(rows, widths) + .block(block) + .highlight_spacing(HighlightSpacing::Always) + .highlight_symbol(">>") + .row_highlight_style(Style::new().on_blue()); + + StatefulWidget::render(table, area, buf, &mut state.table_state); + } +} + +impl From<&PullRequest> for Row<'_> { + fn from(pr: &PullRequest) -> Self { + let pr = pr.clone(); + Row::new(vec![pr.id, pr.title, pr.url]) + } } diff --git a/src/model.rs b/src/model.rs deleted file mode 100644 index e558df5..0000000 --- a/src/model.rs +++ /dev/null @@ -1,235 +0,0 @@ -use battery::Battery; -use humansize::{format_size, FormatSizeOptions, BINARY}; -use log::{debug, warn}; -use procfs::process::Process; -use procfs::{ticks_per_second, CpuInfo, Current, Uptime}; -use ratatui::layout::Alignment; -use ratatui::style::{Color, Style}; -use ratatui::text::Line; -use ratatui::widgets::{Cell, Row}; -use std::collections::{HashMap, VecDeque}; -use uzers::{get_user_by_uid, User}; - -pub fn get_battery() -> Battery { - let manager = battery::Manager::new().unwrap(); - manager.batteries().unwrap().next().unwrap().unwrap() -} - -pub fn create_rows<'a>(processes: &Vec) -> Vec> { - let mut rows = Vec::new(); - for process in processes { - let row = create_row(process); - rows.push(row); - } - rows -} - -pub fn create_row<'a>(process: &BrtProcess) -> Row<'a> { - let user = process.user.clone(); - let username = if user.is_some() { - #[allow(clippy::unnecessary_unwrap)] - user.unwrap().name().to_os_string().into_string().unwrap() - } else { - "unknown".to_string() - }; - - let special_style = Style::default().fg(Color::Rgb(0x0D, 0xE7, 0x56)); - - let humansize_options: FormatSizeOptions = FormatSizeOptions::from(BINARY) - .space_after_value(false) - .decimal_places(1) - .decimal_zeroes(0); - - Row::new([ - Cell::new(Line::from(process.pid.to_string()).alignment(Alignment::Right)), - Cell::new(process.program.to_string()).style(special_style), - Cell::new(process.command.to_string()), - Cell::new( - Line::from(process.number_of_threads.to_string()) - .alignment(Alignment::Right) - .style(special_style), - ), - Cell::new(username), - Cell::new(format_size(process.resident_memory, humansize_options)).style(special_style), - Cell::new(process.cpu_graph.to_string()), - Cell::new(format!("{:.2}", process.cpu)).style(special_style), - ]) -} - -fn between(status: &f64, min: f64, max: f64) -> bool { - status >= &min && status < &max -} - -fn get_points(cpu: &f64) -> i32 { - match cpu { - status if between(status, 0_f64, 0.001_f64) => 0, - status if between(status, 0.001_f64, 0.2_f64) => 1, - status if between(status, 0.2_f64, 0.5_f64) => 2, - status if between(status, 0.5_f64, 0.7_f64) => 3, - status if between(status, 0.7_f64, 100_f64) => 4, - _ => { - warn!("Invalid cpu found: {}; setting to zero.", cpu); - 0 - } - } -} - -pub fn get_cpu_graph(cpus: &VecDeque) -> String { - let blocks: HashMap<&str, &str> = HashMap::from([ - ("00", " "), - ("01", "⢀"), - ("02", "⢠"), - ("03", "⢰"), - ("04", "⢸"), - ("10", "⡀"), - ("11", "⣀"), - ("12", "⣠"), - ("13", "⣰"), - ("14", "⣸"), - ("20", "⡄"), - ("21", "⣄"), - ("22", "⣤"), - ("23", "⣴"), - ("24", "⣼"), - ("30", "⡆"), - ("31", "⣆"), - ("32", "⣦"), - ("33", "⣶"), - ("34", "⣾"), - ("40", "⡇"), - ("41", "⣇"), - ("42", "⣧"), - ("43", "⣷"), - ("44", "⣿"), - ]); - let mut graph = "".to_string(); - let v: Vec<&f64> = cpus.iter().collect(); - for cpu in v.chunks(2) { - let first = get_points(cpu[0]); - let second = get_points(cpu[1]); - let slot = blocks.get(format!("{}{}", first, second).as_str()).unwrap(); - graph += slot; - } - graph -} - -#[derive(Default, Clone, Debug)] -pub struct BrtProcess { - pub pid: i32, - pub ppid: i32, - pub program: String, - pub command: String, - pub number_of_threads: i64, - pub user: Option, - pub resident_memory: u64, - pub cpus: VecDeque, - pub cpu_graph: String, - pub cpu: f64, -} - -impl BrtProcess { - pub fn new() -> BrtProcess { - BrtProcess { - cpus: VecDeque::from(vec![0_f64; 10]), - ..Default::default() - } - } -} - -fn create_command(cmdline: &[String]) -> String { - let mut command = "".to_string(); - for part in cmdline.iter() { - command += format!("{} ", part).as_str(); - } - command -} - -pub fn to_brt_process(process: &Process) -> Option { - let mut brt_process: BrtProcess = BrtProcess::new(); - let stat_result = process.stat(); - match stat_result { - Ok(stat) => { - brt_process.pid = stat.pid; - brt_process.ppid = stat.ppid; - brt_process.program = stat.comm; - brt_process.number_of_threads = stat.num_threads; - - // command - let cmd_result = process.cmdline(); - match cmd_result { - Ok(cmd) => { - brt_process.command = create_command(&cmd); - } - Err(_e) => { - brt_process.command = "zombie".to_string(); - } - } - - // user - let uid_result = process.uid(); - match uid_result { - Ok(uid) => { - brt_process.user = get_user_by_uid(uid); - } - Err(_e) => { - warn!("No user found for process {}.", process.pid().to_string()); - brt_process.user = None; - } - } - - // memory - let resident_memory = get_memory(process); - brt_process.resident_memory = resident_memory; - - // cpu(s) - let cpu = get_cpu(process); - brt_process.cpu = cpu; - brt_process.cpus.push_back(cpu); - brt_process.cpus.pop_front(); - brt_process.cpu_graph = get_cpu_graph(&brt_process.cpus); - } - Err(_e) => { - warn!("Stat not found for process {}.", process.pid().to_string()); - return None; - } - } - Some(brt_process) -} - -pub fn get_memory(process: &Process) -> u64 { - let statm = process.statm().unwrap(); // TODO: this can be: NotFound(Some("/proc/3955386/statm")) - let page_size = procfs::page_size(); - statm.resident * page_size -} - -fn get_cpu(process: &Process) -> f64 { - let stat = process.stat().unwrap(); - - let usage = stat.utime / ticks_per_second() + stat.stime / ticks_per_second(); - debug!("usage: {}s", usage); - - let uptime = Uptime::current().unwrap().uptime_duration().as_secs(); - debug!("Uptime: {}s", uptime); - - let starttime = stat.starttime / ticks_per_second(); - debug!("start time: {}s", starttime); - - let runtime = uptime - starttime; - debug!("runtime: {}s", runtime); - - let num_cores = CpuInfo::current().unwrap().num_cores(); - debug!("Uptime: {}s", uptime); - - usage as f64 * 100.0 / runtime as f64 / num_cores as f64 -} - -#[cfg(test)] -mod tests { - - #[test] - fn test_get_all_processes() { - // let all_processes = get_all_processes(); - // assert_eq!(all_processes.is_empty(), false) - assert_eq!(false, false) - } -} diff --git a/src/processbar.rs b/src/processbar.rs deleted file mode 100644 index a3cc6fc..0000000 --- a/src/processbar.rs +++ /dev/null @@ -1,54 +0,0 @@ -pub mod model; - -use anyhow::{Context, Result}; -use clap::Parser; -use log::debug; -use model::get_memory; -use owo_colors::OwoColorize; -use procfs::process::Process; -use procfs::{page_size, ticks_per_second, CpuInfo, Current, Uptime}; - -#[derive(Parser, Debug)] -#[command(version, about, long_about = None)] -struct Args { - #[arg(long)] - pid: i32, -} - -#[allow(dead_code)] -fn main() -> Result<()> { - let args = Args::parse(); - - let pid = args.pid; - - debug!("Checking pid {}...", pid); - let process = Process::new(pid).with_context(|| format!("Pid {pid} not found."))?; - let stat = process.stat().unwrap(); - - debug!("ticks per second: {}", ticks_per_second()); - debug!("pagesize: {}", page_size()); - let usage = stat.utime / ticks_per_second() + stat.stime / ticks_per_second(); - debug!("usage {} ", usage); - - let uptime = Uptime::current().unwrap().uptime_duration().as_secs(); - debug!("Uptime: {}", uptime); - let starttime = stat.starttime / ticks_per_second(); - debug!("Starttime: {}", starttime); - let runtime = uptime - starttime; - debug!("runtime: {}", runtime); - let num_cores = CpuInfo::current().unwrap().num_cores(); - debug!("num cores: {}", num_cores); - let percentage = usage as f64 * 100.0 / runtime as f64 / num_cores as f64; - - let memory = get_memory(&process); - - println!( - "Process {} ({}) has used {:.2}% of the cpu and is using {} bytes of memory.", - stat.comm.green(), - pid.yellow(), - percentage.yellow(), - memory.yellow(), - ); - - Ok(()) -} diff --git a/src/tui.rs b/src/tui.rs deleted file mode 100644 index ea89c0b..0000000 --- a/src/tui.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - time::Duration, -}; - -use color_eyre::eyre::Result; -use crossterm::{ - cursor, - event::{Event as CrosstermEvent, KeyEvent, KeyEventKind, MouseEvent}, - terminal::{EnterAlternateScreen, LeaveAlternateScreen}, -}; -use futures::{FutureExt, StreamExt}; -use ratatui::backend::CrosstermBackend as Backend; -use serde::{Deserialize, Serialize}; -use tokio::{ - sync::mpsc::{self, UnboundedReceiver, UnboundedSender}, - task::JoinHandle, -}; -use tokio_util::sync::CancellationToken; - -pub type Frame<'a> = ratatui::Frame<'a>; - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub enum Event { - Init, - Quit, - Error, - Closed, - Tick, - Render, - FocusGained, - FocusLost, - Paste(String), - Key(KeyEvent), - Mouse(MouseEvent), - Resize(u16, u16), -} - -pub struct Tui { - pub terminal: ratatui::Terminal>, - pub task: JoinHandle<()>, - pub cancellation_token: CancellationToken, - pub event_rx: UnboundedReceiver, - pub event_tx: UnboundedSender, - pub frame_rate: f64, - pub tick_rate: f64, -} - -impl Tui { - pub fn new() -> Result { - let tick_rate = 4.0; - let frame_rate = 60.0; - let terminal = ratatui::Terminal::new(Backend::new(std::io::stderr()))?; - let (event_tx, event_rx) = mpsc::unbounded_channel(); - let cancellation_token = CancellationToken::new(); - let task = tokio::spawn(async {}); - Ok(Self { - terminal, - task, - cancellation_token, - event_rx, - event_tx, - frame_rate, - tick_rate, - }) - } - - pub fn tick_rate(&mut self, tick_rate: f64) { - self.tick_rate = tick_rate; - } - - pub fn frame_rate(&mut self, frame_rate: f64) { - self.frame_rate = frame_rate; - } - - pub fn start(&mut self) { - let tick_delay = std::time::Duration::from_secs_f64(1.0 / self.tick_rate); - let render_delay = std::time::Duration::from_secs_f64(1.0 / self.frame_rate); - self.cancel(); - self.cancellation_token = CancellationToken::new(); - let _cancellation_token = self.cancellation_token.clone(); - let _event_tx = self.event_tx.clone(); - self.task = tokio::spawn(async move { - let mut reader = crossterm::event::EventStream::new(); - let mut tick_interval = tokio::time::interval(tick_delay); - let mut render_interval = tokio::time::interval(render_delay); - _event_tx.send(Event::Init).unwrap(); - loop { - let tick_delay = tick_interval.tick(); - let render_delay = render_interval.tick(); - let crossterm_event = reader.next().fuse(); - tokio::select! { - _ = _cancellation_token.cancelled() => { - break; - } - maybe_event = crossterm_event => { - match maybe_event { - Some(Ok(evt)) => { - match evt { - CrosstermEvent::Key(key) => { - if key.kind == KeyEventKind::Press { - _event_tx.send(Event::Key(key)).unwrap(); - } - }, - CrosstermEvent::Mouse(mouse) => { - _event_tx.send(Event::Mouse(mouse)).unwrap(); - }, - CrosstermEvent::Resize(x, y) => { - _event_tx.send(Event::Resize(x, y)).unwrap(); - }, - CrosstermEvent::FocusLost => { - _event_tx.send(Event::FocusLost).unwrap(); - }, - CrosstermEvent::FocusGained => { - _event_tx.send(Event::FocusGained).unwrap(); - }, - CrosstermEvent::Paste(s) => { - _event_tx.send(Event::Paste(s)).unwrap(); - }, - } - } - Some(Err(_)) => { - _event_tx.send(Event::Error).unwrap(); - } - None => {}, - } - }, - _ = tick_delay => { - _event_tx.send(Event::Tick).unwrap(); - }, - _ = render_delay => { - _event_tx.send(Event::Render).unwrap(); - }, - } - } - }); - } - - pub fn stop(&self) -> Result<()> { - self.cancel(); - let mut counter = 0; - while !self.task.is_finished() { - std::thread::sleep(Duration::from_millis(1)); - counter += 1; - if counter > 50 { - self.task.abort(); - } - if counter > 100 { - log::error!("Failed to abort task in 100 milliseconds for unknown reason"); - break; - } - } - Ok(()) - } - - pub fn enter(&mut self) -> Result<()> { - crossterm::terminal::enable_raw_mode()?; - crossterm::execute!(std::io::stderr(), EnterAlternateScreen, cursor::Hide)?; - self.start(); - Ok(()) - } - - pub fn exit(&mut self) -> Result<()> { - self.stop()?; - if crossterm::terminal::is_raw_mode_enabled()? { - self.flush()?; - crossterm::execute!(std::io::stderr(), LeaveAlternateScreen, cursor::Show)?; - crossterm::terminal::disable_raw_mode()?; - } - Ok(()) - } - - pub fn cancel(&self) { - self.cancellation_token.cancel(); - } - - pub fn suspend(&mut self) -> Result<()> { - self.exit()?; - #[cfg(not(windows))] - signal_hook::low_level::raise(signal_hook::consts::signal::SIGTSTP)?; - Ok(()) - } - - pub fn resume(&mut self) -> Result<()> { - self.enter()?; - Ok(()) - } - - pub async fn next(&mut self) -> Option { - self.event_rx.recv().await - } -} - -impl Deref for Tui { - type Target = ratatui::Terminal>; - - fn deref(&self) -> &Self::Target { - &self.terminal - } -} - -impl DerefMut for Tui { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.terminal - } -} - -impl Drop for Tui { - fn drop(&mut self) { - self.exit().unwrap(); - } -} diff --git a/src/utils.rs b/src/utils.rs deleted file mode 100644 index 6379dfc..0000000 --- a/src/utils.rs +++ /dev/null @@ -1,168 +0,0 @@ -use std::path::PathBuf; - -use color_eyre::eyre::Result; -use directories::ProjectDirs; -use lazy_static::lazy_static; -use tracing::error; -use tracing_error::ErrorLayer; -use tracing_subscriber::{ - self, prelude::__tracing_subscriber_SubscriberExt, util::SubscriberInitExt, Layer, -}; - -lazy_static! { - pub static ref PROJECT_NAME: String = env!("CARGO_CRATE_NAME").to_uppercase().to_string(); - pub static ref DATA_FOLDER: Option = - std::env::var(format!("{}_DATA", PROJECT_NAME.clone())) - .ok() - .map(PathBuf::from); - pub static ref CONFIG_FOLDER: Option = - std::env::var(format!("{}_CONFIG", PROJECT_NAME.clone())) - .ok() - .map(PathBuf::from); - pub static ref LOG_ENV: String = format!("{}_LOGLEVEL", PROJECT_NAME.clone()); - pub static ref LOG_FILE: String = format!("{}.log", env!("CARGO_PKG_NAME")); -} - -fn project_directory() -> Option { - ProjectDirs::from("com", "elevenbits", env!("CARGO_PKG_NAME")) -} - -pub fn initialize_panic_handler() -> Result<()> { - let (panic_hook, eyre_hook) = color_eyre::config::HookBuilder::default() - .panic_section(format!( - "This is a bug. Consider reporting it at {}", - env!("CARGO_PKG_REPOSITORY") - )) - .capture_span_trace_by_default(false) - .display_location_section(false) - .display_env_section(false) - .into_hooks(); - eyre_hook.install()?; - std::panic::set_hook(Box::new(move |panic_info| { - if let Ok(mut t) = crate::tui::Tui::new() { - if let Err(r) = t.exit() { - error!("Unable to exit Terminal: {:?}", r); - } - } - - #[cfg(not(debug_assertions))] - { - use human_panic::{metadata, setup_panic}; - setup_panic!(metadata!() - .authors(env!("CARGO_PKG_AUTHORS").replace(':', ", ")) - .homepage(env!("CARGO_PKG_HOMEPAGE"))); - } - let msg = format!("{}", panic_hook.panic_report(panic_info)); - log::error!("Error: {}", strip_ansi_escapes::strip_str(msg)); - - #[cfg(debug_assertions)] - { - // Better Panic stacktrace that is only enabled when debugging. - better_panic::Settings::auto() - .most_recent_first(false) - .lineno_suffix(true) - .verbosity(better_panic::Verbosity::Full) - .create_panic_handler()(panic_info); - } - - std::process::exit(libc::EXIT_FAILURE); - })); - Ok(()) -} - -pub fn get_data_dir() -> PathBuf { - let directory = if let Some(s) = DATA_FOLDER.clone() { - s - } else if let Some(proj_dirs) = project_directory() { - proj_dirs.data_local_dir().to_path_buf() - } else { - PathBuf::from(".").join(".data") - }; - directory -} - -pub fn get_config_dir() -> PathBuf { - let directory = if let Some(s) = CONFIG_FOLDER.clone() { - s - } else if let Some(proj_dirs) = project_directory() { - proj_dirs.config_local_dir().to_path_buf() - } else { - PathBuf::from(".").join(".config") - }; - directory -} - -pub fn initialize_logging() -> Result<()> { - let directory = get_data_dir(); - std::fs::create_dir_all(directory.clone())?; - let log_path = directory.join(LOG_FILE.clone()); - let log_file = std::fs::File::create(log_path)?; - std::env::set_var( - "RUST_LOG", - std::env::var("RUST_LOG") - .or_else(|_| std::env::var(LOG_ENV.clone())) - .unwrap_or_else(|_| format!("{}=info", env!("CARGO_CRATE_NAME"))), - ); - let file_subscriber = tracing_subscriber::fmt::layer() - .with_file(true) - .with_line_number(true) - .with_writer(log_file) - .with_target(false) - .with_ansi(false) - .with_filter(tracing_subscriber::filter::EnvFilter::from_default_env()); - tracing_subscriber::registry() - .with(file_subscriber) - .with(ErrorLayer::default()) - .init(); - Ok(()) -} - -/// Similar to the `std::dbg!` macro, but generates `tracing` events rather -/// than printing to stdout. -/// -/// By default, the verbosity level for the generated events is `DEBUG`, but -/// this can be customized. -#[macro_export] -macro_rules! trace_dbg { - (target: $target:expr, level: $level:expr, $ex:expr) => {{ - match $ex { - value => { - tracing::event!(target: $target, $level, ?value, stringify!($ex)); - value - } - } - }}; - (level: $level:expr, $ex:expr) => { - trace_dbg!(target: module_path!(), level: $level, $ex) - }; - (target: $target:expr, $ex:expr) => { - trace_dbg!(target: $target, level: tracing::Level::DEBUG, $ex) - }; - ($ex:expr) => { - trace_dbg!(level: tracing::Level::DEBUG, $ex) - }; -} - -pub fn version() -> String { - let author = clap::crate_authors!(); - - let mut commit_hash = "no hash"; - #[allow(clippy::option_env_unwrap)] - if option_env!("BRT_GIT_INFO").is_some() { - commit_hash = option_env!("BRT_GIT_INFO").unwrap() - }; - - // let current_exe_path = PathBuf::from(clap::crate_name!()).display().to_string(); - let config_dir_path = get_config_dir().display().to_string(); - let data_dir_path = get_data_dir().display().to_string(); - - format!( - "\ -({commit_hash}) - -Authors: {author} - -Config directory: {config_dir_path} -Data directory: {data_dir_path}" - ) -} diff --git a/src/widgets.rs b/src/widgets.rs deleted file mode 100644 index d3d9d5f..0000000 --- a/src/widgets.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod cpu_graph; diff --git a/src/widgets/cpu_graph.rs b/src/widgets/cpu_graph.rs deleted file mode 100644 index b9d99b4..0000000 --- a/src/widgets/cpu_graph.rs +++ /dev/null @@ -1,59 +0,0 @@ -use ratatui::buffer::Buffer; -use ratatui::layout::Rect; -use ratatui::{prelude::*, widgets::*}; -use std::collections::VecDeque; - -#[derive(Debug, Clone, PartialEq)] -pub struct CpuGraph<'a> { - block: Option>, - data: VecDeque, -} - -impl<'a> Default for CpuGraph<'a> { - fn default() -> CpuGraph<'a> { - CpuGraph { - block: None, - data: VecDeque::from(vec![0_u64, 25]), - } - } -} - -impl<'a> CpuGraph<'a> { - /// Surrounds the `CpuGraph` with a [`Block`]. - #[must_use = "method moves the value of self and returns the modified value"] - pub fn block(mut self, block: Block<'a>) -> Self { - self.block = Some(block); - self - } - - #[must_use = "method moves the value of self and returns the modified value"] - pub fn update(mut self, point: u64) -> Self { - self.data.push_back(point); - self.data.pop_front(); - self - } -} - -impl Widget for CpuGraph<'_> { - fn render(self, area: Rect, buf: &mut Buffer) { - self.render_ref(area, buf); - } -} - -impl WidgetRef for CpuGraph<'_> { - fn render_ref(&self, area: Rect, buf: &mut Buffer) { - self.block.render_ref(area, buf); - let inner = self.block.inner_if_some(area); - self.render_cpu_graph(inner, buf); - } -} - -impl CpuGraph<'_> { - fn render_cpu_graph(&self, gpu_graph_area: Rect, buf: &mut Buffer) { - if gpu_graph_area.is_empty() { - return; - } - let label = Span::raw(format!("{}", self.data.len())); - buf.set_span(0, 0, &label, 1); - } -} From a824e542bfa676bae18992c8b0783d0558bff8d0 Mon Sep 17 00:00:00 2001 From: jw Date: Wed, 9 Apr 2025 23:53:23 +0200 Subject: [PATCH 02/18] :sparkles: Replace the octocrab by battery information. --- Cargo.lock | 1347 +++++---------------------------------------------- Cargo.toml | 3 +- src/main.rs | 102 ++-- 3 files changed, 160 insertions(+), 1292 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcbe097..3ca4b35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,44 +44,12 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anyhow" version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - -[[package]] -name = "async-trait" -version = "0.1.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "atomic" version = "0.6.0" @@ -118,6 +86,23 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "battery" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b624268937c0e0a3edb7c27843f9e547c320d730c610d3b8e6e8e95b2026e4" +dependencies = [ + "cfg-if", + "core-foundation", + "lazycell", + "libc", + "mach", + "nix 0.19.1", + "num-traits", + "uom", + "winapi", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -161,21 +146,15 @@ dependencies = [ name = "brt" version = "0.1.8" dependencies = [ + "battery", "cargo-husky", "color-eyre", "crossterm 0.29.0", - "octocrab", "ratatui", "tokio", "tokio-stream", ] -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - [[package]] name = "bytemuck" version = "1.22.0" @@ -230,21 +209,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" -[[package]] -name = "chrono" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-link", -] - [[package]] name = "color-eyre" version = "0.6.3" @@ -297,9 +261,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.10.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ "core-foundation-sys", "libc", @@ -307,9 +271,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.7" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "cpufeatures" @@ -466,17 +430,6 @@ dependencies = [ "crypto-common", ] -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "document-features" version = "0.2.11" @@ -560,104 +513,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -668,19 +529,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - [[package]] name = "getrandom" version = "0.3.2" @@ -722,451 +570,151 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "http" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" +name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "httparse" -version = "1.10.1" +name = "indenter" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] -name = "hyper" -version = "1.6.0" +name = "indoc" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] -name = "hyper-rustls" -version = "0.27.5" +name = "instability" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "log", - "rustls", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "hyper-timeout" -version = "0.5.2" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "hyper", - "hyper-util", - "pin-project-lite", - "tokio", - "tower-service", + "either", ] [[package]] -name = "hyper-util" -version = "0.1.11" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "libc", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "iana-time-zone" -version = "0.1.63" +name = "lab" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] +checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f" [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "icu_collections" -version = "1.5.0" +name = "lazycell" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] -name = "icu_locid" -version = "1.5.0" +name = "libc" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] -name = "icu_locid_transform" -version = "1.5.0" +name = "line-clipping" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +checksum = "76364bf78d7ed059f98564fc5fb94c5a6eb2b6c9edd621cb1528febe1e918b29" dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", + "bitflags 2.9.0", ] [[package]] -name = "icu_locid_transform_data" -version = "1.5.1" +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] -name = "icu_normalizer" -version = "1.5.0" +name = "linux-raw-sys" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] -name = "icu_normalizer_data" -version = "1.5.1" +name = "litrs" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] -name = "icu_properties" -version = "1.5.1" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", + "autocfg", + "scopeguard", ] [[package]] -name = "icu_properties_data" -version = "1.5.1" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "icu_provider" -version = "1.5.0" +name = "lru" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", + "hashbrown", ] [[package]] -name = "icu_provider_macros" -version = "1.5.0" +name = "mac_address" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", + "nix 0.29.0", + "winapi", ] [[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "1.0.3" +name = "mach" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", + "libc", ] [[package]] -name = "idna_adapter" -version = "1.2.0" +name = "memchr" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indoc" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" - -[[package]] -name = "instability" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" -dependencies = [ - "darling", - "indoc", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "iri-string" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "jsonwebtoken" -version = "9.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" -dependencies = [ - "base64", - "js-sys", - "pem", - "ring", - "serde", - "serde_json", - "simple_asn1", -] - -[[package]] -name = "lab" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" - -[[package]] -name = "line-clipping" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76364bf78d7ed059f98564fc5fb94c5a6eb2b6c9edd621cb1528febe1e918b29" -dependencies = [ - "bitflags 2.9.0", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "linux-raw-sys" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" - -[[package]] -name = "litemap" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "lru" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "mac_address" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" -dependencies = [ - "nix", - "winapi", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmem" @@ -1210,6 +758,18 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "nix" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if", + "libc", +] + [[package]] name = "nix" version = "0.29.0" @@ -1233,16 +793,6 @@ dependencies = [ "minimal-lexical", ] -[[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-conv" version = "0.1.0" @@ -1260,15 +810,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1296,58 +837,12 @@ dependencies = [ "memchr", ] -[[package]] -name = "octocrab" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf799a9982a4d0b4b3fa15b4c1ff7daf5bd0597f46456744dcbb6ddc2e4c827" -dependencies = [ - "arc-swap", - "async-trait", - "base64", - "bytes", - "cfg-if", - "chrono", - "either", - "futures", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-timeout", - "hyper-util", - "jsonwebtoken", - "once_cell", - "percent-encoding", - "pin-project", - "secrecy", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "snafu", - "tokio", - "tower", - "tower-http", - "tracing", - "url", - "web-time", -] - [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - [[package]] name = "ordered-float" version = "4.6.0" @@ -1392,22 +887,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pem" -version = "3.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" -dependencies = [ - "base64", - "serde", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - [[package]] name = "pest" version = "2.8.0" @@ -1505,38 +984,12 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pin-project" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "pin-project-lite" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "powerfmt" version = "0.2.0" @@ -1704,20 +1157,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.15", - "libc", - "untrusted", - "windows-sys", -] - [[package]] name = "rustc-demangle" version = "0.1.24" @@ -1750,50 +1189,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "rustls" -version = "0.23.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" -dependencies = [ - "log", - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-native-certs" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" -dependencies = [ - "openssl-probe", - "rustls-pki-types", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pki-types" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" - -[[package]] -name = "rustls-webpki" -version = "0.103.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - [[package]] name = "rustversion" version = "1.0.16" @@ -1806,53 +1201,12 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "secrecy" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" -dependencies = [ - "zeroize", -] - -[[package]] -name = "security-framework" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" -dependencies = [ - "bitflags 2.9.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "serde" version = "1.0.201" @@ -1873,40 +1227,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "serde_json" -version = "1.0.140" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - [[package]] name = "sha2" version = "0.10.8" @@ -1961,61 +1281,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", -] - -[[package]] -name = "simple_asn1" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror 2.0.12", - "time", -] - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +] [[package]] -name = "snafu" -version = "0.8.5" +name = "siphasher" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "223891c85e2a29c3fe8fb900c1fae5e69c2e42415e3177752e8718475efa5019" -dependencies = [ - "snafu-derive", -] +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] -name = "snafu-derive" -version = "0.8.5" +name = "smallvec" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.100", -] +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -2027,12 +1305,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -2067,12 +1339,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - [[package]] name = "syn" version = "1.0.109" @@ -2095,23 +1361,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "terminfo" version = "0.9.0" @@ -2151,7 +1400,7 @@ dependencies = [ "libc", "log", "memmem", - "nix", + "nix 0.29.0", "num-derive", "num-traits", "ordered-float", @@ -2232,14 +1481,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", - "itoa", "libc", "num-conv", "num_threads", "powerfmt", "serde", "time-core", - "time-macros", ] [[package]] @@ -2248,26 +1495,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" -[[package]] -name = "time-macros" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tokio" version = "1.44.2" @@ -2297,16 +1524,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "tokio-rustls" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" -dependencies = [ - "rustls", - "tokio", -] - [[package]] name = "tokio-stream" version = "0.1.17" @@ -2318,90 +1535,16 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" -dependencies = [ - "bitflags 2.9.0", - "bytes", - "futures-util", - "http", - "http-body", - "iri-string", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - [[package]] name = "tracing" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "tracing-core" version = "0.1.32" @@ -2433,12 +1576,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "typenum" version = "1.18.0" @@ -2481,35 +1618,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.4" +name = "uom" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "e76503e636584f1e10b9b3b9498538279561adcef5412927ba00c2b32c4ce5ed" dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", + "num-traits", + "typenum", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -2523,7 +1640,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ "atomic", - "getrandom 0.3.2", + "getrandom", ] [[package]] @@ -2547,15 +1664,6 @@ dependencies = [ "utf8parse", ] -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2571,75 +1679,6 @@ dependencies = [ "wit-bindgen-rt", ] -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "wezterm-bidi" version = "0.2.3" @@ -2656,7 +1695,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692daff6d93d94e29e4114544ef6d5c942a7ed998b37abdc19b17136ea428eb7" dependencies = [ - "getrandom 0.3.2", + "getrandom", "mac_address", "sha2", "thiserror 1.0.69", @@ -2734,65 +1773,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-core" -version = "0.61.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-implement" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "windows-interface" -version = "0.59.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-result" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -2875,42 +1855,6 @@ dependencies = [ "bitflags 2.9.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.7.34" @@ -2930,52 +1874,3 @@ dependencies = [ "quote", "syn 2.0.100", ] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] diff --git a/Cargo.toml b/Cargo.toml index 2da0825..4cdbbbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,12 +14,13 @@ rust-version = "1.74.1" name = "brt" [dependencies] +battery = "0.7.8" color-eyre = "0.6.3" crossterm = { version = "0.29.0", features = ["serde", "event-stream"] } ratatui = { version = "0.30.0-alpha.2", features = ["default", "unstable-widget-ref"] } tokio = { version = "1.44.2", features = ["full"] } tokio-stream = "0.1.17" -octocrab = "0.44.0" + [dev-dependencies.cargo-husky] version = "1" diff --git a/src/main.rs b/src/main.rs index 47457aa..d357754 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,14 +3,11 @@ use std::time::Duration; use color_eyre::Result; use crossterm::event::{Event, EventStream, KeyCode, KeyEventKind}; -use octocrab::params::pulls::Sort; -use octocrab::params::Direction; -use octocrab::Page; use ratatui::buffer::Buffer; use ratatui::layout::{Constraint, Layout, Rect}; -use ratatui::style::{Style, Stylize}; +use ratatui::style::Stylize; use ratatui::text::Line; -use ratatui::widgets::{Block, HighlightSpacing, Row, StatefulWidget, Table, TableState, Widget}; +use ratatui::widgets::{Paragraph, Row, TableState, Widget}; use ratatui::{DefaultTerminal, Frame}; use tokio_stream::StreamExt; @@ -83,7 +80,7 @@ struct PullRequestListWidget { #[derive(Debug, Default)] struct PullRequestListState { - pull_requests: Vec, + pull_requests: String, loading_state: LoadingState, table_state: TableState, } @@ -101,7 +98,7 @@ enum LoadingState { Idle, Loading, Loaded, - Error(String), + // Error(String), } impl PullRequestListWidget { @@ -118,30 +115,25 @@ impl PullRequestListWidget { // this runs once, but you could also run this in a loop, using a channel that accepts // messages to refresh on demand, or with an interval timer to refresh every N seconds self.set_loading_state(LoadingState::Loading); - match octocrab::instance() - .pulls("ratatui", "ratatui") - .list() - .sort(Sort::Updated) - .direction(Direction::Descending) - .send() - .await - { - Ok(page) => self.on_load(&page), - Err(err) => self.on_err(&err), + let manager = battery::Manager::new().expect("Could not get battery"); + let mut battery_state = "".to_string(); + for (idx, maybe_battery) in manager.batteries().expect("No battery found").enumerate() { + let battery = maybe_battery.expect("No battery found"); + battery_state.push_str(format!("index #{}", idx).as_str()); + battery_state.push_str(format!(" Vendor: {:?}", battery.vendor()).as_str()); + battery_state.push_str(format!(" Model: {:?}", battery.model()).as_str()); + battery_state.push_str(format!(" State: {:?}", battery.state()).as_str()); + battery_state.push_str(format!(" Time to full charge: {:?}", battery.time_to_full()).as_str()); + battery_state.push_str(format!(" serial: {:?}", battery.serial_number()).as_str()); + battery_state.push_str(format!(" energy: {:?}", battery.energy()).as_str()); + battery_state.push_str(format!(" energy: {:?}", battery.energy_full_design()).as_str()); } + self.on_load(&battery_state) } - fn on_load(&self, page: &Page) { - let prs = page.items.iter().map(Into::into); + fn on_load(&self, page: &str) { let mut state = self.state.write().unwrap(); state.loading_state = LoadingState::Loaded; - state.pull_requests.extend(prs); - if !state.pull_requests.is_empty() { - state.table_state.select(Some(0)); - } - } - - fn on_err(&self, err: &octocrab::Error) { - self.set_loading_state(LoadingState::Error(err.to_string())); + state.pull_requests = page.to_string(); } fn set_loading_state(&self, state: LoadingState) { @@ -157,47 +149,27 @@ impl PullRequestListWidget { } } -type OctoPullRequest = octocrab::models::pulls::PullRequest; - -impl From<&OctoPullRequest> for PullRequest { - fn from(pr: &OctoPullRequest) -> Self { - Self { - id: pr.number.to_string(), - title: pr.title.as_ref().unwrap().to_string(), - url: pr - .html_url - .as_ref() - .map(ToString::to_string) - .unwrap_or_default(), - } - } -} +// type OctoPullRequest = octocrab::models::pulls::PullRequest; +// +// impl From<&OctoPullRequest> for PullRequest { +// fn from(pr: &OctoPullRequest) -> Self { +// Self { +// id: pr.number.to_string(), +// title: pr.title.as_ref().unwrap().to_string(), +// url: pr +// .html_url +// .as_ref() +// .map(ToString::to_string) +// .unwrap_or_default(), +// } +// } +// } impl Widget for &PullRequestListWidget { fn render(self, area: Rect, buf: &mut Buffer) { - let mut state = self.state.write().unwrap(); - - // a block with a right aligned title with the loading state on the right - let loading_state = Line::from(format!("{:?}", state.loading_state)).right_aligned(); - let block = Block::bordered() - .title("Pull Requests") - .title(loading_state) - .title_bottom("j/k to scroll, q to quit"); - - // a table with the list of pull requests - let rows = state.pull_requests.iter(); - let widths = [ - Constraint::Length(5), - Constraint::Fill(1), - Constraint::Max(49), - ]; - let table = Table::new(rows, widths) - .block(block) - .highlight_spacing(HighlightSpacing::Always) - .highlight_symbol(">>") - .row_highlight_style(Style::new().on_blue()); - - StatefulWidget::render(table, area, buf, &mut state.table_state); + let state = self.state.write().unwrap(); + let p = Paragraph::new(state.pull_requests.as_str()); + Widget::render(p, area, buf); } } From 8fe22e3a348f143b84a97c37b7974fb80425eff9 Mon Sep 17 00:00:00 2001 From: jw Date: Fri, 11 Apr 2025 18:47:45 +0200 Subject: [PATCH 03/18] :sparkles: Add a TimeWidget. --- Cargo.lock | 195 +++++++++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 1 + src/main.rs | 98 +++++++++++++++++--------- 3 files changed, 261 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ca4b35..34273f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,6 +44,21 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anyhow" version = "1.0.97" @@ -148,6 +163,7 @@ version = "0.1.8" dependencies = [ "battery", "cargo-husky", + "chrono", "color-eyre", "crossterm 0.29.0", "ratatui", @@ -155,6 +171,12 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + [[package]] name = "bytemuck" version = "1.22.0" @@ -209,6 +231,20 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + [[package]] name = "color-eyre" version = "0.6.3" @@ -265,7 +301,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.7.0", "libc", ] @@ -275,6 +311,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -569,6 +611,30 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys 0.8.7", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -615,6 +681,16 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + [[package]] name = "lab" version = "0.11.0" @@ -1679,6 +1755,64 @@ dependencies = [ "wit-bindgen-rt", ] +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + [[package]] name = "wezterm-bidi" version = "0.2.3" @@ -1773,6 +1907,65 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index 4cdbbbd..aedd1cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ name = "brt" [dependencies] battery = "0.7.8" +chrono = "0.4.40" color-eyre = "0.6.3" crossterm = { version = "0.29.0", features = ["serde", "event-stream"] } ratatui = { version = "0.30.0-alpha.2", features = ["default", "unstable-widget-ref"] } diff --git a/src/main.rs b/src/main.rs index d357754..a4cd90d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,11 @@ use std::sync::{Arc, RwLock}; use std::time::Duration; - +use chrono::{DateTime, Utc}; use color_eyre::Result; use crossterm::event::{Event, EventStream, KeyCode, KeyEventKind}; use ratatui::buffer::Buffer; -use ratatui::layout::{Constraint, Layout, Rect}; -use ratatui::style::Stylize; -use ratatui::text::Line; -use ratatui::widgets::{Paragraph, Row, TableState, Widget}; +use ratatui::layout::{Constraint, Direction, Layout, Rect}; +use ratatui::widgets::{Paragraph,TableState, Widget}; use ratatui::{DefaultTerminal, Frame}; use tokio_stream::StreamExt; @@ -23,14 +21,16 @@ async fn main() -> Result<()> { #[derive(Debug, Default)] struct App { should_quit: bool, - pull_requests: PullRequestListWidget, + battery_widget: BatteryWidget, + time_widget: TimeWidget, } impl App { const FRAMES_PER_SECOND: f32 = 60.0; pub async fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> { - self.pull_requests.run(); + self.battery_widget.run(); + self.time_widget.run(); let period = Duration::from_secs_f32(1.0 / Self::FRAMES_PER_SECOND); let mut interval = tokio::time::interval(period); @@ -46,11 +46,15 @@ impl App { } fn draw(&self, frame: &mut Frame) { - let vertical = Layout::vertical([Constraint::Length(1), Constraint::Fill(1)]); - let [title_area, body_area] = vertical.areas(frame.area()); - let title = Line::from("Ratatui async example").centered().bold(); - frame.render_widget(title, title_area); - frame.render_widget(&self.pull_requests, body_area); + let layout = Layout::default() + .direction(Direction::Vertical) + .constraints(vec![ + Constraint::Percentage(50), + Constraint::Percentage(50), + ]) + .split(frame.area()); + frame.render_widget(&self.battery_widget, layout[0]); + frame.render_widget(&self.time_widget, layout[1]); } fn handle_event(&mut self, event: &Event) { @@ -58,8 +62,8 @@ impl App { if key.kind == KeyEventKind::Press { match key.code { KeyCode::Char('q') | KeyCode::Esc => self.should_quit = true, - KeyCode::Char('j') | KeyCode::Down => self.pull_requests.scroll_down(), - KeyCode::Char('k') | KeyCode::Up => self.pull_requests.scroll_up(), + KeyCode::Char('j') | KeyCode::Down => self.battery_widget.scroll_down(), + KeyCode::Char('k') | KeyCode::Up => self.battery_widget.scroll_up(), _ => {} } } @@ -69,29 +73,22 @@ impl App { /// A widget that displays a list of pull requests. /// -/// This is an async widget that fetches the list of pull requests from the GitHub API. It contains -/// an inner `Arc>` that holds the state of the widget. Cloning the +/// This is an async widget that fetches the battery information. It contains +/// an inner `Arc>` that holds the state of the widget. Cloning the /// widget will clone the Arc, so you can pass it around to other threads, and this is used to spawn /// a background task to fetch the pull requests. #[derive(Debug, Clone, Default)] -struct PullRequestListWidget { - state: Arc>, +struct BatteryWidget { + state: Arc>, } #[derive(Debug, Default)] -struct PullRequestListState { +struct BatteryState { pull_requests: String, loading_state: LoadingState, table_state: TableState, } -#[derive(Debug, Clone)] -struct PullRequest { - id: String, - title: String, - url: String, -} - #[derive(Debug, Clone, Default, PartialEq, Eq)] enum LoadingState { #[default] @@ -101,7 +98,41 @@ enum LoadingState { // Error(String), } -impl PullRequestListWidget { +#[derive(Debug, Clone, Default)] +struct TimeWidget { + state: Arc>, +} + +#[derive(Debug, Clone)] +struct TimeState { + time: DateTime, +} + +impl Default for TimeState { + fn default() -> Self { Self { time: Utc::now() } } +} + +impl TimeWidget { + fn run(&self) { + let this = self.clone(); // clone the widget to pass to the background task + tokio::spawn(this.time()); + } + async fn time(self) { + let mut interval = tokio::time::interval(Duration::from_millis(100)); + loop { + let now = Utc::now(); + self.on_load(&now); + interval.tick().await; + } + } + fn on_load(&self, time: &DateTime) { + let mut state = self.state.write().unwrap(); + state.time = *time; + } +} + + +impl BatteryWidget { /// Start fetching the pull requests in the background. /// /// This method spawns a background task that fetches the pull requests from the GitHub API. @@ -165,7 +196,7 @@ impl PullRequestListWidget { // } // } -impl Widget for &PullRequestListWidget { +impl Widget for &BatteryWidget { fn render(self, area: Rect, buf: &mut Buffer) { let state = self.state.write().unwrap(); let p = Paragraph::new(state.pull_requests.as_str()); @@ -173,9 +204,12 @@ impl Widget for &PullRequestListWidget { } } -impl From<&PullRequest> for Row<'_> { - fn from(pr: &PullRequest) -> Self { - let pr = pr.clone(); - Row::new(vec![pr.id, pr.title, pr.url]) +impl Widget for &TimeWidget { + fn render(self, area: Rect, buf: &mut Buffer) { + let state = self.state.write().unwrap(); + let binding = state.time.format("%H:%M:%S%.3f").to_string(); + let p = Paragraph::new(binding.as_str()); + Widget::render(p, area, buf); } } + From e813310434c1ddf91f9c7ee8844306a6a5fd4487 Mon Sep 17 00:00:00 2001 From: jw Date: Fri, 11 Apr 2025 19:26:16 +0200 Subject: [PATCH 04/18] :recycle: Make sure the battery resources are correctly named. --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index a4cd90d..637d767 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,7 +84,7 @@ struct BatteryWidget { #[derive(Debug, Default)] struct BatteryState { - pull_requests: String, + battery: String, loading_state: LoadingState, table_state: TableState, } @@ -139,10 +139,10 @@ impl BatteryWidget { /// The result of the fetch is then passed to the `on_load` or `on_err` methods. fn run(&self) { let this = self.clone(); // clone the widget to pass to the background task - tokio::spawn(this.fetch_pulls()); + tokio::spawn(this.battery()); } - async fn fetch_pulls(self) { + async fn battery(self) { // this runs once, but you could also run this in a loop, using a channel that accepts // messages to refresh on demand, or with an interval timer to refresh every N seconds self.set_loading_state(LoadingState::Loading); @@ -161,10 +161,10 @@ impl BatteryWidget { } self.on_load(&battery_state) } - fn on_load(&self, page: &str) { + fn on_load(&self, battery: &str) { let mut state = self.state.write().unwrap(); state.loading_state = LoadingState::Loaded; - state.pull_requests = page.to_string(); + state.battery = battery.to_string(); } fn set_loading_state(&self, state: LoadingState) { @@ -199,7 +199,7 @@ impl BatteryWidget { impl Widget for &BatteryWidget { fn render(self, area: Rect, buf: &mut Buffer) { let state = self.state.write().unwrap(); - let p = Paragraph::new(state.pull_requests.as_str()); + let p = Paragraph::new(state.battery.as_str()); Widget::render(p, area, buf); } } From 49d45bb4e5abc2a797e7ef28d78cd974b8e69af2 Mon Sep 17 00:00:00 2001 From: jw Date: Sat, 12 Apr 2025 22:45:41 +0200 Subject: [PATCH 05/18] :sparkles: Refresh the battery information each 100ms. --- src/main.rs | 84 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 30 deletions(-) diff --git a/src/main.rs b/src/main.rs index 637d767..a05212d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,21 +1,25 @@ -use std::sync::{Arc, RwLock}; -use std::time::Duration; +use battery::units::{Energy, Ratio, Time}; +use battery::{Manager, State}; use chrono::{DateTime, Utc}; use color_eyre::Result; use crossterm::event::{Event, EventStream, KeyCode, KeyEventKind}; use ratatui::buffer::Buffer; use ratatui::layout::{Constraint, Direction, Layout, Rect}; -use ratatui::widgets::{Paragraph,TableState, Widget}; +use ratatui::widgets::{Paragraph, Widget}; use ratatui::{DefaultTerminal, Frame}; +use std::error::Error; +use std::fmt; +use std::sync::{Arc, RwLock}; +use std::time::Duration; use tokio_stream::StreamExt; #[tokio::main] async fn main() -> Result<()> { color_eyre::install()?; let terminal = ratatui::init(); - let app_result = App::default().run(terminal).await; + let result = App::default().run(terminal).await; ratatui::restore(); - app_result + result } #[derive(Debug, Default)] @@ -29,7 +33,7 @@ impl App { const FRAMES_PER_SECOND: f32 = 60.0; pub async fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> { - self.battery_widget.run(); + let _ = self.battery_widget.run(); self.time_widget.run(); let period = Duration::from_secs_f32(1.0 / Self::FRAMES_PER_SECOND); @@ -79,14 +83,29 @@ impl App { /// a background task to fetch the pull requests. #[derive(Debug, Clone, Default)] struct BatteryWidget { + // manager: Arc>, state: Arc>, } #[derive(Debug, Default)] struct BatteryState { - battery: String, loading_state: LoadingState, - table_state: TableState, + battery: BrtBattery, +} + +#[derive(Debug, Default, Clone, Copy)] +struct BrtBattery { + state_of_health: Ratio, + time_to_empty: Option