From 20517f09b44e3f787425c230b9a59a350520c94e Mon Sep 17 00:00:00 2001 From: facile pop culture reference Date: Fri, 14 Aug 2026 13:36:37 +0300 Subject: [PATCH 1/2] update deps; add profiling --- Cargo.lock | 1831 ++++++++++++++++++++++++++++++++----------------- Cargo.toml | 10 +- dizzle | 2 +- src/layout.rs | 4 + src/lib.rs | 3 +- 5 files changed, 1232 insertions(+), 618 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1b3d2d..ee91f7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,6 +46,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + [[package]] name = "allocator-api2" version = "0.2.21" @@ -54,23 +63,21 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-activity" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +checksum = "0f2a1bb052857d5dd49572219344a7332b31b76405648eabac5bc68978251bcd" dependencies = [ "android-properties", - "bitflags 2.11.0", + "bitflags 2.13.1", "cc", - "cesu8", "jni", - "jni-sys", "libc", "log", "ndk", "ndk-context", "ndk-sys", "num_enum", - "thiserror 1.0.69", + "thiserror 2.0.20", ] [[package]] @@ -81,9 +88,9 @@ checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" [[package]] name = "anyhow" -version = "1.0.101" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "approx" @@ -102,9 +109,9 @@ checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] name = "as-raw-xcb-connection" @@ -112,6 +119,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +[[package]] +name = "atomic" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" +dependencies = [ + "bytemuck", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -126,9 +142,9 @@ checksum = "628d228f918ac3b82fe590352cc719d30664a0c13ca3a60266fe02c7132d480a" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "backtrace" @@ -145,6 +161,12 @@ dependencies = [ "windows-link", ] +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "better-panic" version = "0.3.0" @@ -155,15 +177,30 @@ dependencies = [ "console", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec 0.6.3", +] + [[package]] name = "bit-set" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec", + "bit-vec 0.8.0", ] +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bit-vec" version = "0.8.0" @@ -178,9 +215,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.0" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] [[package]] name = "block2" @@ -193,9 +239,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "by_address" @@ -205,15 +251,15 @@ checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" [[package]] name = "bytemuck" -version = "1.25.0" +version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "calloop" @@ -221,7 +267,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "log", "polling", "rustix 0.38.44", @@ -241,12 +287,6 @@ dependencies = [ "wayland-client", ] -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" - [[package]] name = "castaway" version = "0.2.4" @@ -258,9 +298,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.56" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" +checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e" dependencies = [ "find-msvc-tools", "jobserver", @@ -268,12 +308,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cfg-if" version = "1.0.4" @@ -282,9 +316,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "combine" @@ -298,9 +332,9 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" +checksum = "9dfdd1c2274d9aa354115b09dc9a901d6c5576818cdf70d14cae2bdb47df00ab" dependencies = [ "castaway", "cfg-if", @@ -349,7 +383,7 @@ checksum = "eb0240417fe20ccf13397fa25e6f0a987dbbfaf27d9e13532419df7f593e65e8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", "unicode-xid", ] @@ -402,6 +436,21 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "crossbeam-deque" version = "0.8.7" @@ -423,25 +472,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crossterm" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" -dependencies = [ - "bitflags 2.11.0", - "crossterm_winapi", - "mio", - "parking_lot", - "rustix 0.38.44", - "signal-hook", - "signal-hook-mio", - "winapi", -] +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" [[package]] name = "crossterm" @@ -449,13 +482,13 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "crossterm_winapi", "derive_more", "document-features", "mio", "parking_lot", - "rustix 1.1.3", + "rustix 1.1.4", "signal-hook", "signal-hook-mio", "winapi", @@ -470,6 +503,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csscolorparser" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" +dependencies = [ + "lab", + "phf 0.11.3", +] + [[package]] name = "cursor-icon" version = "1.2.0" @@ -478,9 +531,9 @@ checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" [[package]] name = "darling" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +checksum = "88490bf1b990d87eaaa7ac8aa887f629a08e7359765b4911faf63c3763347d23" dependencies = [ "darling_core", "darling_macro", @@ -488,28 +541,40 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +checksum = "084e274f91c482280130e1e34e0b8d6e66776a060d7b6de7b84289ca778868c4" dependencies = [ "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 3.0.3", ] [[package]] name = "darling_macro" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +checksum = "68f5792fa0d41cd2325ce0ffa64f0a340eaebd4971a3a0c5e1ffd2cc488a355e" dependencies = [ "darling_core", "quote", - "syn", + "syn 3.0.3", ] +[[package]] +name = "deltae" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4" + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" + [[package]] name = "derive_more" version = "2.1.1" @@ -529,7 +594,17 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 2.0.119", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", ] [[package]] @@ -544,10 +619,10 @@ version = "0.1.0" dependencies = [ "const_panic", "dizzle_proc", - "itertools 0.14.0", + "itertools", "konst", "peg", - "thiserror 2.0.18", + "thiserror 2.0.20", ] [[package]] @@ -556,14 +631,14 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "dlib" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" dependencies = [ "libloading", ] @@ -591,9 +666,9 @@ checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" [[package]] name = "either" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "encode_unicode" @@ -618,22 +693,58 @@ dependencies = [ ] [[package]] -name = "fast-srgb8" -version = "1.0.0" +name = "euclid" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" +checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set 0.5.3", + "regex", +] [[package]] name = "fastrand" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[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 = "find-msvc-tools" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de" + +[[package]] +name = "finl_unicode" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9844ddc3a6e533d62bba727eb6c28b5d360921d5175e9ff0f1e621a5c590a4d5" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "fnv" @@ -643,9 +754,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.5" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "foreign-types" @@ -659,13 +770,13 @@ dependencies = [ [[package]] name = "foreign-types-macros" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -676,21 +787,21 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "futures-core" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" [[package]] name = "futures-task" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" [[package]] name = "futures-util" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ "futures-core", "futures-task", @@ -698,13 +809,23 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "gethostname" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" dependencies = [ - "rustix 1.1.3", + "rustix 1.1.4", "windows-link", ] @@ -727,21 +848,19 @@ checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", ] [[package]] name = "getrandom" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", - "r-efi", - "wasip2", - "wasip3", + "r-efi 6.0.0", ] [[package]] @@ -752,9 +871,9 @@ checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "hashbrown" -version = "0.15.5" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ "allocator-api2", "equivalent", @@ -763,9 +882,14 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "heck" @@ -780,10 +904,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] -name = "id-arena" -version = "2.3.0" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "ident_case" @@ -793,14 +917,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", - "serde", - "serde_core", + "hashbrown 0.17.1", ] [[package]] @@ -814,24 +936,15 @@ dependencies = [ [[package]] name = "instability" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357b7205c6cd18dd2c86ed312d1e70add149aea98e7ef72b9fdf0270e555c11d" +checksum = "2bf84e73fa6f27f299dec58e13223cf70db80da872eb921d4f6138342a0eabc8" dependencies = [ "darling", "indoc", "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", + "syn 3.0.3", ] [[package]] @@ -845,15 +958,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jack" version = "0.13.0" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "jack-sys", "lazy_static", "libc", @@ -864,7 +977,7 @@ dependencies = [ name = "jack-sys" version = "0.5.1" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "lazy_static", "libc", "libloading", @@ -874,51 +987,99 @@ dependencies = [ [[package]] name = "jni" -version = "0.21.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" dependencies = [ - "cesu8", "cfg-if", "combine", - "jni-sys", + "jni-macros", + "jni-sys 0.4.1", "log", - "thiserror 1.0.69", + "simd_cesu8", + "thiserror 2.0.20", "walkdir", - "windows-sys 0.45.0", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", ] [[package]] name = "jni-sys" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] [[package]] name = "jobserver" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.85" +version = "0.3.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" dependencies = [ - "once_cell", + "cfg-if", + "futures-util", "wasm-bindgen", ] [[package]] -name = "konst" -version = "0.3.16" +name = "kasuari" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4381b9b00c55f251f2ebe9473aef7c117e96828def1a7cb3bd3f0f903c6894e9" +checksum = "bde5057d6143cc94e861d90f591b9303d6716c6b9602309150bd068853c10899" +dependencies = [ + "hashbrown 0.16.1", + "portable-atomic", + "thiserror 2.0.20", +] + +[[package]] +name = "konst" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97feab15b395d1860944abe6a8dd8ed9f8eadfae01750fada8427abda531d887" dependencies = [ "const_panic", "konst_kernel", @@ -941,23 +1102,23 @@ version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00af7901ba50898c9e545c24d5c580c96a982298134e8037d8978b6594782c07" +[[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.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - [[package]] name = "libc" -version = "0.2.182" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libloading" @@ -970,14 +1131,30 @@ dependencies = [ ] [[package]] -name = "libredox" -version = "0.1.12" +name = "libm" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libredox" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2026a5056764a10b2bf5d56488cba40da507f5493a6a429340e2004d9ed085fa" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "libc", - "redox_syscall 0.7.1", + "plain", + "redox_syscall 0.9.2", +] + +[[package]] +name = "line-clipping" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e752191d037c44ad111a8caa762921926658402f01cc1253f7bef2020ece4f5e" +dependencies = [ + "bitflags 2.13.1", ] [[package]] @@ -988,9 +1165,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litrs" @@ -1009,34 +1186,59 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "lru" -version = "0.12.5" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +checksum = "5d2f2f9b4ba7e6b24d95e7e899329d35be83bcded72c8540cdd5368932d1d90a" dependencies = [ - "hashbrown 0.15.5", + "hashbrown 0.17.1", +] + +[[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.8.0" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memmap2" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0" dependencies = [ "libc", ] +[[package]] +name = "memmem" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "midly" version = "0.5.3" @@ -1046,6 +1248,12 @@ dependencies = [ "rayon", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -1057,9 +1265,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" dependencies = [ "libc", "log", @@ -1073,8 +1281,8 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.11.0", - "jni-sys", + "bitflags 2.13.1", + "jni-sys 0.3.1", "log", "ndk-sys", "num_enum", @@ -1094,7 +1302,56 @@ version = "0.6.0+11769913" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" dependencies = [ - "jni-sys", + "jni-sys 0.3.1", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.13.1", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[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.119", ] [[package]] @@ -1108,9 +1365,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" dependencies = [ "num_enum_derive", "rustversion", @@ -1118,14 +1375,23 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.119", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", ] [[package]] @@ -1150,7 +1416,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "libc", "objc2", @@ -1166,7 +1432,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "objc2", "objc2-core-location", @@ -1190,7 +1456,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "objc2", "objc2-foundation", @@ -1232,7 +1498,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "dispatch", "libc", @@ -1257,7 +1523,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "objc2", "objc2-foundation", @@ -1269,7 +1535,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "objc2", "objc2-foundation", @@ -1292,7 +1558,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "objc2", "objc2-cloud-kit", @@ -1324,7 +1590,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "objc2", "objc2-core-location", @@ -1342,20 +1608,29 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "orbclient" -version = "0.3.50" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ad2c6bae700b7aa5d1cc30c59bdd3a1c180b09dbaea51e2ae2b8e1cf211fdd" +checksum = "5df339f526ea9a60e371768d50efc2f2508c7203290731565d1f7a6f71d21747" dependencies = [ "libc", "libredox", ] +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + [[package]] name = "owned_ttf_parser" version = "0.25.1" @@ -1367,27 +1642,37 @@ dependencies = [ [[package]] name = "palette" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" +checksum = "ddeed8580d347d2abf3dcf06a5f0b3dc020258338526b277847cd4248a70fc64" dependencies = [ "approx", - "fast-srgb8", + "libm", "palette_derive", - "phf", - "rand 0.8.5", + "palette_math", + "phf 0.13.1", + "rand 0.8.7", ] [[package]] name = "palette_derive" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" +checksum = "88537020289b719d81be994ccf1bbf4990f477e2f69ee52fe3e45f43a02e56be" dependencies = [ "by_address", "proc-macro2", "quote", - "syn", + "syn 2.0.119", +] + +[[package]] +name = "palette_math" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e6eb142958d64335fb0e345c5b9ead2ecd6fc438c307e9d7d3c4fd428dbaf12" +dependencies = [ + "libm", ] [[package]] @@ -1413,12 +1698,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "peg" version = "0.8.6" @@ -1452,6 +1731,48 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "pest" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a07a60cc7a4d00c91f95c685609d1d2f79050e6804b70ebedd7650f0b839bcf" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a83744a5c8455b8b3e0dc5031362780a347c878bdd11584d1a8984228cc88d" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0cd3451aa3de60d4b9a1e736885e4dea6b31617598026f12256ad566d63304a" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pest_meta" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d3a0849e241d7dfce834c83b1c5edc8622009e8dd51a12ba1927c32f05496" +dependencies = [ + "pest", +] + [[package]] name = "phf" version = "0.11.3" @@ -1459,7 +1780,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", - "phf_shared", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_shared 0.13.1", +] + +[[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 0.11.3", ] [[package]] @@ -1468,8 +1808,8 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared", - "rand 0.8.5", + "phf_shared 0.11.3", + "rand 0.8.7", ] [[package]] @@ -1479,10 +1819,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", - "phf_shared", + "phf_shared 0.11.3", "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1495,36 +1835,51 @@ dependencies = [ ] [[package]] -name = "pin-project" -version = "1.1.10" +name = "phf_shared" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.10" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "polling" @@ -1536,10 +1891,22 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.1.3", + "rustix 1.1.4", "windows-sys 0.61.2", ] +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.21" @@ -1549,45 +1916,55 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro-crate" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] -name = "proptest" -version = "1.10.0" +name = "profiling" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" +checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" dependencies = [ - "bit-set", - "bit-vec", - "bitflags 2.11.0", + "profiling-procmacros", + "tracing", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bit-set 0.8.0", + "bit-vec 0.8.0", + "bitflags 2.13.1", "num-traits", - "rand 0.9.2", + "rand 0.9.5", "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", @@ -1604,7 +1981,7 @@ checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1630,18 +2007,18 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-xml" -version = "0.38.4" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -1653,10 +2030,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] -name = "rand" -version = "0.8.5" +name = "r-efi" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -1665,9 +2048,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -1722,23 +2105,103 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.29.0" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" +checksum = "3274ba0a2c5e1bcad2a2005d20f4dc59dad26b2eb0940fb094500dba4099d57d" dependencies = [ - "bitflags 2.11.0", - "cassowary", - "compact_str", - "crossterm 0.28.1", - "indoc", "instability", - "itertools 0.13.0", + "ratatui-core", + "ratatui-crossterm", + "ratatui-macros", + "ratatui-termina", + "ratatui-termwiz", + "ratatui-widgets", + "serde", +] + +[[package]] +name = "ratatui-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbb175c433c8e28a809d1f5773a2ae96e68c0ce40db865cbab1020bf33ae479c" +dependencies = [ + "bitflags 2.13.1", + "compact_str", + "critical-section", + "hashbrown 0.17.1", + "itertools", + "kasuari", "lru", - "paste", + "palette", + "serde", "strum", + "thiserror 2.0.20", "unicode-segmentation", "unicode-truncate", - "unicode-width 0.2.0", + "unicode-width", +] + +[[package]] +name = "ratatui-crossterm" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567584a3b0e6a8203c23de40b4861497266725eb5363dbfd18a1edd603cca9f0" +dependencies = [ + "cfg-if", + "crossterm", + "instability", + "ratatui-core", +] + +[[package]] +name = "ratatui-macros" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7dc68daa7498a43e4d68e0eb078427e10c38fbcfbb1e42d955f1fa2140d814" +dependencies = [ + "ratatui-core", + "ratatui-widgets", +] + +[[package]] +name = "ratatui-termina" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0bf912d9e66f057a759d92e386a280ea886b352ab757d6ac4d653c7ed2c43c2" +dependencies = [ + "instability", + "ratatui-core", + "termina", +] + +[[package]] +name = "ratatui-termwiz" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf03e0380b7744054d6cb74224fe3adf062a029754933f575ca1e3b4c2ce977" +dependencies = [ + "ratatui-core", + "termwiz", +] + +[[package]] +name = "ratatui-widgets" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66e3d19bcc9130ca376277d93b60767ff121ace3be06f5f95f81dd68956407d1" +dependencies = [ + "bitflags 2.13.1", + "hashbrown 0.17.1", + "indoc", + "instability", + "itertools", + "line-clipping", + "ratatui-core", + "serde", + "strum", + "time", + "unicode-segmentation", + "unicode-width", ] [[package]] @@ -1747,7 +2210,7 @@ version = "11.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", ] [[package]] @@ -1791,29 +2254,52 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", ] [[package]] name = "redox_syscall" -version = "0.7.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35985aa610addc02e24fc232012c86fd11f14111180f902b67e2d5331f8ebf2b" +checksum = "f1c93da5bb2c5d4e6c0ef7abeead62c89169a0a4882bfb83ac892f2423aea2fe" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rustc-demangle" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" [[package]] name = "rustc_version" @@ -1830,7 +2316,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "errno", "libc", "linux-raw-sys 0.4.15", @@ -1839,22 +2325,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "errno", "libc", - "linux-raw-sys 0.11.0", + "linux-raw-sys 0.12.1", "windows-sys 0.61.2", ] [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "rusty-fork" @@ -1910,57 +2396,65 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", + "serde_derive", ] [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] -name = "serde_json" -version = "1.0.149" +name = "sha2" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", ] [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "signal-hook" @@ -1994,10 +2488,26 @@ dependencies = [ ] [[package]] -name = "siphasher" -version = "1.0.2" +name = "simd_cesu8" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "siphasher" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" [[package]] name = "slab" @@ -2007,9 +2517,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "smithay-client-toolkit" @@ -2017,7 +2527,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "calloop", "calloop-wayland-source", "cursor-icon", @@ -2065,24 +2575,34 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.4" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" dependencies = [ "heck", "proc-macro2", "quote", - "rustversion", - "syn", + "syn 2.0.119", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] @@ -2097,15 +2617,26 @@ dependencies = [ ] [[package]] -name = "tempfile" -version = "3.25.0" +name = "syn" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.1", + "getrandom 0.4.3", "once_cell", - "rustix 1.1.3", + "rustix 1.1.4", "windows-sys 0.61.2", ] @@ -2117,21 +2648,101 @@ dependencies = [ "atomic_float", "better-panic", "bumpalo", - "crossterm 0.29.0", + "crossterm", "dizzle", "jack", "midly", "palette", + "profiling", "proptest", "proptest-derive", "quanta", - "rand 0.8.5", + "rand 0.8.7", "ratatui", "tengri", - "unicode-width 0.2.0", + "tracing", + "tracing-flame", + "tracing-subscriber", + "unicode-width", "winit", ] +[[package]] +name = "termina" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9048a889effe34a5cddee0af7f53285198b16dca3be510858d38dfdb3e62a04e" +dependencies = [ + "bitflags 2.13.1", + "parking_lot", + "rustix 1.1.4", + "signal-hook", + "windows-sys 0.61.2", +] + +[[package]] +name = "terminfo" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662" +dependencies = [ + "fnv", + "nom", + "phf 0.11.3", + "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.13.1", + "fancy-regex", + "filedescriptor", + "finl_unicode", + "fixedbitset", + "hex", + "lazy_static", + "libc", + "log", + "memmem", + "nix", + "num-derive", + "num-traits", + "ordered-float", + "pest", + "pest_derive", + "phf 0.11.3", + "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" @@ -2143,11 +2754,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" dependencies = [ - "thiserror-impl 2.0.18", + "thiserror-impl 2.0.20", ] [[package]] @@ -2158,20 +2769,50 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] +[[package]] +name = "thread_local" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" +dependencies = [ + "deranged", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + [[package]] name = "tiny-skia" version = "0.11.4" @@ -2199,18 +2840,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.5+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.23.10+spec-1.0.0" +version = "0.25.13+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" dependencies = [ "indexmap", "toml_datetime", @@ -2220,9 +2861,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.9+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] @@ -2234,14 +2875,66 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "tracing-core" version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-flame" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bae117ee14789185e129aaee5d93750abe67fdc5a9a62650452bfe4e122a3a9" +dependencies = [ + "lazy_static", + "tracing", + "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.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] [[package]] name = "ttf-parser" @@ -2250,10 +2943,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" [[package]] -name = "typewit" -version = "1.14.2" +name = "typenum" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c1ae7cc0fdb8b842d65d127cb981574b0d2b249b74d1c7a2986863dc134f71" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "typewit" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214ca0b2191785cbc06209b9ca1861e048e39b5ba33574b3cedd58363d5bb5f6" dependencies = [ "typewit_proc_macros", ] @@ -2264,6 +2963,12 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e36a83ea2b3c704935a01b4642946aadd445cea40b10935e3f8bd8052b8193d6" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unarray" version = "0.1.4" @@ -2278,32 +2983,26 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-truncate" -version = "1.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" +checksum = "16b380a1238663e5f8a691f9039c73e1cdae598a30e9855f541d29b08b53e9a5" dependencies = [ - "itertools 0.13.0", + "itertools", "unicode-segmentation", - "unicode-width 0.1.14", + "unicode-width", ] [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -2311,12 +3010,45 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" +dependencies = [ + "atomic", + "getrandom 0.4.3", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vtparse" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9b2acfb050df409c972a37d3b8e08cdea3bddb0c09db9d53137e504cfabed0" +dependencies = [ + "utf8parse", +] + [[package]] name = "wait-timeout" version = "0.2.1" @@ -2344,27 +3076,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.108" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" dependencies = [ "cfg-if", "once_cell", @@ -2375,23 +3098,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.58" +version = "0.4.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950" dependencies = [ - "cfg-if", - "futures-util", "js-sys", - "once_cell", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.108" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2399,69 +3118,35 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.108" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn", + "syn 2.0.119", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.108" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags 2.11.0", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - [[package]] name = "wayland-backend" -version = "0.3.12" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9" +checksum = "016ccf01d1c58b6f8999612813e17c9b2390f7d70671428869913310f83f54b8" dependencies = [ "cc", "downcast-rs", - "rustix 1.1.3", + "rustix 1.1.4", "scoped-tls", "smallvec", "wayland-sys", @@ -2469,12 +3154,12 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.12" +version = "0.31.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec" +checksum = "e3c36a0f861ad76d0901f2800b46321410d9f73f2ea88aac0650d86c32688073" dependencies = [ - "bitflags 2.11.0", - "rustix 1.1.3", + "bitflags 2.13.1", + "rustix 1.1.4", "wayland-backend", "wayland-scanner", ] @@ -2485,29 +3170,29 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "cursor-icon", "wayland-backend", ] [[package]] name = "wayland-cursor" -version = "0.31.12" +version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078" +checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d" dependencies = [ - "rustix 1.1.3", + "rustix 1.1.4", "wayland-client", "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.32.10" +version = "0.32.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3" +checksum = "23d0c813de3daa2ed6520af85a3bd49b0e722a3078506899aa9686fea58dc4b6" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "wayland-backend", "wayland-client", "wayland-scanner", @@ -2515,11 +3200,11 @@ dependencies = [ [[package]] name = "wayland-protocols-plasma" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b" +checksum = "2b6d8cf1eb2c1c31ed1f5643c88a6e53538129d4af80030c8cabd1f9fa884d91" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "wayland-backend", "wayland-client", "wayland-protocols", @@ -2528,11 +3213,11 @@ dependencies = [ [[package]] name = "wayland-protocols-wlr" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3" +checksum = "eb04e52f7836d7c7976c78ca0250d61e33873c34156a2a1fc9474828ec268234" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "wayland-backend", "wayland-client", "wayland-protocols", @@ -2541,9 +3226,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.8" +version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5423e94b6a63e68e439803a3e153a9252d5ead12fd853334e2ad33997e3889e3" +checksum = "338e30461b3a2b67d70eb30a6d89f8e0c93a833e07d2ae89085cd070c4a00ac0" dependencies = [ "proc-macro2", "quick-xml", @@ -2552,9 +3237,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.8" +version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6dbfc3ac5ef974c92a2235805cc0114033018ae1290a72e474aa8b28cbbdfd" +checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be" dependencies = [ "dlib", "log", @@ -2564,9 +3249,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.85" +version = "0.3.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30" dependencies = [ "js-sys", "wasm-bindgen", @@ -2582,6 +3267,78 @@ dependencies = [ "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.4", + "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 = "7012add459f951456ec9d6c7e6fc340b1ce15d6fc9629f8c42853412c029e57e" +dependencies = [ + "bitflags 1.3.2", + "euclid", + "lazy_static", + "serde", + "wezterm-dynamic", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2619,22 +3376,13 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2643,7 +3391,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2655,67 +3403,34 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2728,48 +3443,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -2778,14 +3469,14 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" -version = "0.30.12" +version = "0.30.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66d4b9ed69c4009f6321f762d6e61ad8a2389cd431b97cb1e146812e9e6c732" +checksum = "a6755fa58a9f8350bd1e472d4c3fcc25f824ec358933bba33306d0b63df5978d" dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.11.0", + "bitflags 2.13.1", "block2", "bytemuck", "calloop", @@ -2830,100 +3521,18 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.14" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen" -version = "0.51.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags 2.11.0", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "x11-dl" @@ -2947,7 +3556,7 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix 1.1.3", + "rustix 1.1.4", "x11rb-protocol", ] @@ -2959,9 +3568,9 @@ checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" [[package]] name = "xcursor" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" +checksum = "163b33ed8786455e2fa5d72f554057ce3f3182425434f756cd39c99839d88e23" [[package]] name = "xkbcommon-dl" @@ -2969,7 +3578,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.1", "dlib", "log", "once_cell", @@ -2984,26 +3593,20 @@ checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "zerocopy" -version = "0.8.39" +version = "0.8.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" +checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.39" +version = "0.8.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" +checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 4811fb1..8623115 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,8 @@ description = "UI metaframework." [features] default = ["lang", "sing", "midi", "draw", "play", "term", "text", "time", "rand", "okhsl", "eval", "exit"] -bumpalo = ["dep:bumpalo"] +prof = ["dep:profiling", "dep:tracing", "dep:tracing-flame", "dep:tracing-subscriber"] +bump = ["dep:bumpalo"] draw = [] gui = ["draw", "dep:winit"] eval = [] @@ -34,10 +35,15 @@ midly = { optional = true, version = "0.5" } palette = { optional = true, version = "0.7.6", features = [ "random" ] } quanta = { optional = true, version = "0.12.3" } rand = { optional = true, version = "0.8.5" } -ratatui = { optional = true, version = "0.29.0", features = [ "unstable-widget-ref", "underline-color" ] } +ratatui = { optional = true, version = "^0.30.2", features = [ "unstable-widget-ref", "underline-color" ] } unicode-width = { optional = true, version = "0.2" } winit = { optional = true, version = "0.30.4", features = [ "x11" ]} +profiling = { version = "1.0.18", optional = true, features = ["profile-with-tracing"] } +tracing = { version = "0.1", optional = true, default-features = false, features = [ "std" ] } +tracing-subscriber = { version = "0.3", optional = true } +tracing-flame = { version = "0.2", optional = true } + [dev-dependencies] proptest = { version = "^1" } proptest-derive = { version = "^0.5.1" } diff --git a/dizzle b/dizzle index ab177b0..947a2f3 160000 --- a/dizzle +++ b/dizzle @@ -1 +1 @@ -Subproject commit ab177b0d0d1ccdff0c69f915847be9a23a364663 +Subproject commit 947a2f36a60869ee9aab40aa43d06e1e1c100730 diff --git a/src/layout.rs b/src/layout.rs index 09755a1..3ae27fc 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -211,9 +211,11 @@ impl Sizer { } fn_kw_layout!($kw_name |state, output, expr| { + #[cfg(feature = "prof")] profiling::scope!(stringify!(match $kw_name)); let head = expr.head()?; let mut frags = head.src()?.unwrap_or_default().split("/"); Ok(matches!(frags.next(), Some($name)).then(||{ + #[cfg(feature = "prof")] profiling::scope!(stringify!(inner $kw_name)); let args = expr.tail(); let arg0 = args.head(); let tail0 = args.tail(); @@ -253,9 +255,11 @@ impl Sizer { } fn_kw_layout!($kw_name |state, output, expr| { + #[cfg(feature = "prof")] profiling::scope!(stringify!(match $kw_name)); let head = expr.head()?; let mut frags = head.src()?.unwrap_or_default().split("/"); Ok(matches!(frags.next(), Some($name)).then(||{ + #[cfg(feature = "prof")] profiling::scope!(stringify!(inner $kw_name)); let args = expr.tail(); let arg0 = args.head(); eval_xy!( diff --git a/src/lib.rs b/src/lib.rs index 494a73b..be344bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1205,7 +1205,8 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } Ok(Self { exit: exit.clone(), perf: perf.clone(), - join: Builder::new().name("tengri tui output".into()).spawn(move || { + join: Builder::new().name("tengri task".into()).spawn(move || { + #[cfg(feature = "prof")] profiling::register_thread!(); while !exit.fetch_and(true, Relaxed) { let _ = perf.cycle(&mut call); } From a9f2fa2cdd5fac6ea0f7aee7e9c9d4acec8eac39 Mon Sep 17 00:00:00 2001 From: facile pop culture reference Date: Tue, 18 Aug 2026 10:46:20 +0300 Subject: [PATCH 2/2] add lifetime to Draw trait --- Cargo.lock | 58 +----- Cargo.toml | 1 + dizzle | 2 +- examples/mode_02.rs | 12 +- src/layout.rs | 129 ++++--------- src/layout/area.rs | 14 +- src/layout/axis.rs | 416 ++++++++++++++++++++++++++++++++++-------- src/layout/azimuth.rs | 217 +++++++++++----------- src/layout/cond.rs | 30 ++- src/layout/iter.rs | 53 +++--- src/lib.rs | 91 +++++---- src/term.rs | 47 ++--- src/term/border.rs | 12 +- src/term/keys.rs | 4 +- src/term/modify.rs | 48 ++--- src/term/phat.rs | 8 +- src/term/scroll.rs | 4 +- 17 files changed, 655 insertions(+), 491 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee91f7e..1acd8b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -367,26 +367,13 @@ dependencies = [ [[package]] name = "const_panic" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e262cdaac42494e3ae34c43969f9cdeb7da178bdb4b66fa6a1ea2edb4c8ae652" +checksum = "9603f79528ece8163c496f8932121cb36cfe46259e9c907bb3d8205139d7caa3" dependencies = [ - "const_panic_proc_macros", "typewit", ] -[[package]] -name = "const_panic_proc_macros" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0240417fe20ccf13397fa25e6f0a987dbbfaf27d9e13532419df7f593e65e8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", - "unicode-xid", -] - [[package]] name = "convert_case" version = "0.10.0" @@ -617,12 +604,13 @@ checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" name = "dizzle" version = "0.1.0" dependencies = [ - "const_panic", "dizzle_proc", "itertools", - "konst", - "peg", + "profiling", "thiserror 2.0.20", + "tracing", + "tracing-flame", + "tracing-subscriber", ] [[package]] @@ -1698,33 +1686,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "peg" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aad070be5b63aa72103f2fcdd70a83adbd5e90112ce5b574171ff1c65501773" -dependencies = [ - "peg-macros", - "peg-runtime", -] - -[[package]] -name = "peg-macros" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd8ef6825cae95355031ae26a99b616a2a21f22ba2de0197c43dfb05acbe7ee" -dependencies = [ - "peg-runtime", - "proc-macro2", - "quote", -] - -[[package]] -name = "peg-runtime" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7011d97b484a5ebdc4b1fdb3b12d5e4bbbea56e9d22b688f2e79e04b65a7d8a6" - [[package]] name = "percent-encoding" version = "2.3.2" @@ -2651,6 +2612,7 @@ dependencies = [ "crossterm", "dizzle", "jack", + "konst", "midly", "palette", "profiling", @@ -3004,12 +2966,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "utf8parse" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index 8623115..fea5807 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ term = ["draw", "dep:ratatui", "dep:crossterm"] anyhow = { version = "1.0" } atomic_float = { version = "1" } better-panic = { version = "0.3.0" } +konst = { version = "0.3.16", features = [ "rust_1_83" ] } bumpalo = { optional = true, version = "3.19.0" } crossterm = { optional = true, version = "0.29.0" } diff --git a/dizzle b/dizzle index 947a2f3..648be30 160000 --- a/dizzle +++ b/dizzle @@ -1 +1 @@ -Subproject commit 947a2f36a60869ee9aab40aa43d06e1e1c100730 +Subproject commit 648be30918bef0a975bd225c0499911aaa88bc13 diff --git a/examples/mode_02.rs b/examples/mode_02.rs index 1ec2069..ab8b3e8 100644 --- a/examples/mode_02.rs +++ b/examples/mode_02.rs @@ -45,16 +45,20 @@ impl_keywords!(Tui, XYWH, State [ kw_tui_bg ]); -impl Interpret>> for State { - fn interpret_word (&self, to: &mut Tui, sym: &impl Language) -> Perhaps> { - match sym.src()? { +impl<'a> Interpret<'a, Tui, Option>> for State { + fn interpret_word + ?Sized> (&'a self, to: &mut Tui, lang: &'a L) + -> Drawn<'a, u16> + { + match lang.src()? { Some(":foo") => "foo".draw(to), Some(":bar") => "bar".draw(to), Some(":foobar") => "FOOBAR".draw(to), src => todo!("src: {src:?}") } } - fn interpret_expr (&self, to: &mut Tui, src: &impl Expression) -> Perhaps> { + fn interpret_expr + ?Sized> (&self, to: &mut Tui, src: &'a L) + -> Drawn<'a, u16> + { if let Some(area) = self.keyword(to, src)? { Ok(Some(area)) } else { diff --git a/src/layout.rs b/src/layout.rs index 3ae27fc..77d8658 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -1,44 +1,44 @@ use crate::*; -impl> Layout for T {} +impl<'a, S: Screen, T: Draw<'a, S>> Layout<'a, S> for T {} -pub trait Layout: Draw + Sized { - fn origin (self, azimuth: impl Into>) -> impl Draw { +pub trait Layout<'a, S: Screen>: Draw<'a, S> + Sized { + fn origin (self, azimuth: impl Into>) -> impl Draw<'a, S> { Origin(azimuth.into(), self) } - fn origin_c (self) -> impl Draw { + fn origin_c (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::C), self) } - fn origin_x (self) -> impl Draw { + fn origin_x (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::X), self) } - fn origin_y (self) -> impl Draw { + fn origin_y (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::Y), self) } - fn origin_n (self) -> impl Draw { + fn origin_n (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::N), self) } - fn origin_s (self) -> impl Draw { + fn origin_s (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::S), self) } - fn origin_e (self) -> impl Draw { + fn origin_e (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::E), self) } - fn origin_w (self) -> impl Draw { + fn origin_w (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::W), self) } - fn origin_ne (self) -> impl Draw { + fn origin_ne (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::NE), self) } - fn origin_se (self) -> impl Draw { + fn origin_se (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::SE), self) } - fn origin_nw (self) -> impl Draw { + fn origin_nw (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::NW), self) } - fn origin_sw (self) -> impl Draw { + fn origin_sw (self) -> impl Draw<'a, S> { Origin(Some(Azimuth::SW), self) } } @@ -76,7 +76,7 @@ impl PartialEq for Sizer { } impl Sizer { - pub const fn of (&self, of: impl Draw) -> impl Draw { + pub const fn of <'a, T: Screen> (&self, of: impl Draw<'a, T>) -> impl Draw<'a, T> { draw(move|to: &mut T|{ let area = of.draw(to)?; self.0.store(area.map(|a|a.w()).unwrap_or(T::Unit::zero()).into(), Relaxed); @@ -99,70 +99,13 @@ impl Sizer { } }}); -/// Some layout operations exist in XY, X, and Y variants that take 3 or 2 arguments. -/// Their handling in [eval_view] is uniform and goes like this: -#[macro_export] macro_rules! eval_xy ( - // Valueless variant: - // (fill/x ...) - // (fill/y ...) - // (fill/xy ...) - ( - $name:expr => $expr:expr, $head:expr, $output:ident, $state:ident, - $variant:expr, $xy:ident, $x:ident, $y:ident, $arg:expr, - ) => {{ - // frags.next(): 2nd slash-delimited fragment: /x, /y, /xy - let variant = $variant; - let thunk = draw(move|screen|$state.interpret(screen, &$arg)); - match variant { - // X variant - Some("x") => thunk.$x().draw($output), - // Y variant - Some("y") => thunk.$y().draw($output), - // XY variant (can be omitted) - Some("xy") | None => thunk.$xy().draw($output), - // Other namespace members are invalid - frag => invalid_variant($name, frag, $expr, $head) - } - }}; - - // Variadic variant: - // (push/x n ...) - // (push/y n ...) - // (push/xy n m ...) - ( - $name:expr => $expr:expr, $head:expr, $output:ident, $state:ident, - $variant:expr, $xy:ident, $x:ident, $y:ident, $arg0:expr, $arg1:expr, $arg2:expr, - ) => {{ - // frags.next(): 2nd slash-delimited fragment: /x, /y, /xy - let variant = $variant; - let thunk = draw(move|screen|$state.interpret(screen, &match variant { - Some("x") | Some("y") => $arg1, - Some("xy") | None => $arg2, - _ => panic!("{}: unsupported axis {variant:?}; try /x, /y, /xy", $name) - })); - match variant { - // X variant - Some("x") => thunk.$x($state.namespace($arg0?)?) - .draw($output), - // Y variant - Some("y") => thunk.$y($state.namespace($arg0?)?) - .draw($output), - // XY variant (can be omitted) - Some("xy") | None => thunk.$xy($state.namespace($arg0?)?, $state.namespace($arg1?)?) - .draw($output), - // Other namespace members are invalid - frag => invalid_variant($name, frag, $expr, $head) - } - }}; -); - #[macro_export] macro_rules! fn_kw_layout { ($name:ident |$state:ident, $output: ident, $expr:ident| $body:block) => { #[cfg(all(feature = "draw", feature = "eval"))] - pub fn $name ( - $state: &S, $output: &mut O, $expr: &str - ) -> Perhaps> where - S: Interpret>> + pub fn $name <'a, O: Screen, S> ( + $state: &'a S, $output: &mut O, $expr: &'a str + ) -> PerhapsRef<'a, XYWH> where + S: Interpret<'a, O, Option>> + Namespace + Namespace + Namespace> @@ -173,10 +116,10 @@ impl Sizer { #[macro_export] macro_rules! fn_kw_layout_tui { ($name:ident |$state:ident, $output: ident, $expr:ident| $body:block) => { #[cfg(all(feature = "draw", feature = "eval", feature = "term"))] - pub fn $name ( - $state: &S, $output: &mut Tui, $expr: &str - ) -> Perhaps> where - S: Interpret>> + pub fn $name <'a, S> ( + $state: &'a S, $output: &mut Tui, $expr: &'a str + ) -> PerhapsRef<'a, XYWH> where + S: Interpret<'a, Tui, Option>> + Namespace + Namespace + Namespace> @@ -191,9 +134,9 @@ impl Sizer { $Struct:ident { $X:ident $Y:ident $XY:ident } $kw_name:ident $name:literal |$self:ident, $to:ident| $body:block ) => { - impl> $Trait for T {} + impl> $Trait for T {} - pub trait $Trait: Draw + Sized { + pub trait $Trait: Draw<'a, S> + Sized { fn $fn_x > + Copy> (self, x: N) -> $Struct { $Struct::$X(self, x) } fn $fn_y > + Copy> (self, y: N) @@ -202,11 +145,11 @@ impl Sizer { -> $Struct { $Struct::$XY(self, x, y) } } - pub enum $Struct, X: Into>> { + pub enum $Struct, X: Into>> { __(PhantomData), $X(I, X), $Y(I, X), $XY(I, X, X), } - impl , X: Into> + Copy> Draw for $Struct { + impl , X: Into> + Copy> Draw<'a, S> for $Struct { fn draw (&$self, $to: &mut S) -> Perhaps> { $body } } @@ -216,16 +159,10 @@ impl Sizer { let mut frags = head.src()?.unwrap_or_default().split("/"); Ok(matches!(frags.next(), Some($name)).then(||{ #[cfg(feature = "prof")] profiling::scope!(stringify!(inner $kw_name)); - let args = expr.tail(); - let arg0 = args.head(); - let tail0 = args.tail(); - let arg1 = tail0.head(); - let tail1 = tail0.tail(); - let arg2 = tail1.head(); eval_xy!( $name => expr, head, output, state, frags.next(), $fn_xy, $fn_x, $fn_y, - arg0, arg1, arg2, + expr.nth(1), expr.nth(2), expr.nth(3), ) }).transpose()?.flatten()) }); @@ -238,9 +175,9 @@ impl Sizer { $Struct:ident { $X:ident $Y:ident $XY:ident } $kw_name:ident $name:literal |$self:ident, $to:ident| $body:block ) => { - impl> $Trait for T {} + impl> $Trait for T {} - pub trait $Trait: Draw + Sized { + pub trait $Trait: Draw<'a, S> + Sized { fn $fn_x (self) -> $Struct { $Struct::$X(self) } fn $fn_y (self) -> $Struct { $Struct::$Y(self) } fn $fn_xy (self) -> $Struct { $Struct::$XY(self) } @@ -250,7 +187,7 @@ impl Sizer { __(PhantomData), $X(I), $Y(I), $XY(I), } - impl > Draw for $Struct { + impl <'a, S: Screen, I: Draw<'a, S>> Draw<'a, S> for $Struct { fn draw (&$self, $to: &mut S) -> Perhaps> { $body } } @@ -260,11 +197,9 @@ impl Sizer { let mut frags = head.src()?.unwrap_or_default().split("/"); Ok(matches!(frags.next(), Some($name)).then(||{ #[cfg(feature = "prof")] profiling::scope!(stringify!(inner $kw_name)); - let args = expr.tail(); - let arg0 = args.head(); eval_xy!( $name => expr, head, output, state, frags.next(), - $fn_xy, $fn_x, $fn_y, arg0, + $fn_xy, $fn_x, $fn_y, expr.nth(1), ) }).transpose()?.flatten()) }); diff --git a/src/layout/area.rs b/src/layout/area.rs index a806c92..09f827e 100644 --- a/src/layout/area.rs +++ b/src/layout/area.rs @@ -6,17 +6,19 @@ use crate::*; /// let _ = area(XYWH(1, 2, 3, 4), "southeast"); /// let _ = area(Some(XYWH(1, 2, 3, 4)), "southeast"); /// ``` -pub fn area , U: Into>>> ( +pub fn area <'a, S: Screen, T: Draw<'a, S>, U: Into>>> ( origin: U, it: T ) -> Area { Area(origin.into(), it) } -pub struct Area>( +pub struct Area( pub Option>, - pub T + pub T, ); -impl_draw!(,>|self: Area, to: S|{ - to.draw(self.0, &self.1) -}); +impl<'a, S: Screen, T: Draw<'a, S>> Draw<'a, S> for Area { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { + to.draw(self.0, &self.1) + } +} diff --git a/src/layout/axis.rs b/src/layout/axis.rs index 28002d5..600c8b6 100644 --- a/src/layout/axis.rs +++ b/src/layout/axis.rs @@ -1,8 +1,296 @@ use crate::*; -def_layout_modifier_flat!( - LayoutFull (full_w full_h full_wh), - Full { W H WH } kw_full "full" |self, to| { +pub enum Full<'a, S: Screen, I: Draw<'a, S>> { + __(PhantomData<&'a S>), W(I), H(I), WH(I), +} + +pub enum Exact<'a, S: Screen, I: Draw<'a, S>, X: Into>> { + __(PhantomData<&'a S>), W(I, X), H(I, X), WH(I, X, X), +} + +pub enum Push<'a, S: Screen, I: Draw<'a, S>, X: Into>> { + __(PhantomData<&'a S>), X(I, X), Y(I, X), XY(I, X, X), +} + +pub enum Pull<'a, S: Screen, I: Draw<'a, S>, X: Into>> { + __(PhantomData<&'a S>), X(I, X), Y(I, X), XY(I, X, X), +} + +pub enum Min<'a, S: Screen, I: Draw<'a, S>, X: Into>> { + __(PhantomData<&'a S>), W(I, X), H(I, X), WH(I, X, X), +} + +pub enum Max<'a, S: Screen, I: Draw<'a, S>, X: Into>> { + __(PhantomData<&'a S>), W(I, X), H(I, X), WH(I, X, X), +} + +pub enum Pad<'a, S: Screen, I: Draw<'a, S>, X: Into>> { + __(PhantomData<&'a S>), X(I, X), Y(I, X), XY(I, X, X), +} + +/// ``` +/// # fn test_layout_full () -> Usually<()> { +/// assert_eq!(check_layout("1")?, Some(XYWH(1u16, 1, 1, 1))); +/// assert_eq!(check_layout("1".full_w())?, Some(XYWH(1u16, 1, 80, 1))); +/// assert_eq!(check_layout("1".full_h())?, Some(XYWH(1u16, 1, 1, 25))); +/// assert_eq!(check_layout("1".full_wh())?, Some(XYWH(1u16, 1, 80, 25))); +/// # Ok(()) }} +/// ``` +pub trait LayoutFull<'a, S: Screen>: Draw<'a, S> + Sized { + fn full_w (self) -> Full<'a, S, Self> { Full::W(self) } + fn full_h (self) -> Full<'a, S, Self> { Full::H(self) } + fn full_wh (self) -> Full<'a, S, Self> { Full::WH(self) } +} + +/// ``` +/// # fn test_layout_exact () -> Usually<()> { +/// assert_eq!(check_layout("FOOBAR\nKILROY")?, Some(XYWH(1, 1, 6, 2))); +/// assert_eq!(check_layout("FOOBAR\nKILROY".exact_w(3))?, Some(XYWH(1, 1, 3, 2))); +/// assert_eq!(check_layout("FOOBAR\nKILROY".exact_h(1))?, Some(XYWH(1, 1, 6, 1))); +/// assert_eq!(check_layout("FOOBAR\nKILROY".exact_wh(2, 1))?, Some(XYWH(1, 1, 2, 1))); +/// # Ok(()) }} +/// ``` +pub trait LayoutExact<'a, S: Screen>: Draw<'a, S> + Sized { + fn exact_w > + Copy> (self, w: X) + -> Exact<'a, S, Self, X> { Exact::W(self, w) } + fn exact_h > + Copy> (self, h: X) + -> Exact<'a, S, Self, X> { Exact::H(self, h) } + fn exact_wh > + Copy> (self, w: X, h: X) + -> Exact<'a, S, Self, X> { Exact::WH(self, w, h) } +} + +/// ``` +/// # fn test_layout_min () -> Usually<()> { +/// assert_eq!(check_layout("1".min_w(5))?, Some(XYWH(1u16, 1, 5, 1))); +/// assert_eq!(check_layout("1".min_h(5))?, Some(XYWH(1u16, 1, 1, 5))); +/// assert_eq!(check_layout("1".min_wh(5, 5))?, Some(XYWH(1u16, 1, 5, 5))); +/// assert_eq!(check_layout("123456".min_w(5))?, Some(XYWH(1u16, 1, 6, 1))); +/// # Ok(()) }} +/// ``` +pub trait LayoutMin<'a, S: Screen>: Draw<'a, S> + Sized { + fn min_w > + Copy> (self, w: X) + -> Min<'a, S, Self, X> { Min::W(self, w) } + fn min_h > + Copy> (self, h: X) + -> Min<'a, S, Self, X> { Min::H(self, h) } + fn min_wh > + Copy> (self, w: X, h: X) + -> Min<'a, S, Self, X> { Min::WH(self, w, h) } +} + +pub trait LayoutMax<'a, S: Screen>: Draw<'a, S> + Sized { + fn max_w > + Copy> (self, w: X) + -> Max<'a, S, Self, X> { Max::W(self, w) } + fn max_h > + Copy> (self, h: X) + -> Max<'a, S, Self, X> { Max::H(self, h) } + fn max_wh > + Copy> (self, w: X, h: X) + -> Max<'a, S, Self, X> { Max::WH(self, w, h) } +} + +pub trait LayoutPad<'a, S: Screen>: Draw<'a, S> + Sized { + fn pad_w > + Copy> (self, w: X) + -> Pad<'a, S, Self, X> { Pad::X(self, w) } + fn pad_h > + Copy> (self, h: X) + -> Pad<'a, S, Self, X> { Pad::Y(self, h) } + fn pad_wh > + Copy> (self, w: X, h: X) + -> Pad<'a, S, Self, X> { Pad::XY(self, w, h) } +} + +/// ``` +/// # fn test_layout_pull () -> Usually<()> { +/// assert_eq!(check_layout("1")?, Some(XYWH(1u16, 1, 1, 1))); +/// assert_eq!(check_layout("1".push_x(1))?, Some(XYWH(2u16, 1, 1, 1))); +/// assert_eq!(check_layout("1".push_y(1))?, Some(XYWH(1u16, 2, 1, 1))); +/// assert_eq!(check_layout("1".push_xy(1, 1))?, Some(XYWH(2u16, 2, 1, 1))); +/// # Ok(()) } +/// ``` +pub trait LayoutPush<'a, S: Screen>: Draw<'a, S> + Sized { + fn push_x > + Copy> (self, w: X) + -> Push<'a, S, Self, X> { Push::X(self, w) } + fn push_y > + Copy> (self, h: X) + -> Push<'a, S, Self, X> { Push::Y(self, h) } + fn push_xy > + Copy> (self, w: X, h: X) + -> Push<'a, S, Self, X> { Push::XY(self, w, h) } +} + +/// ``` +/// # fn test_layout_push () -> Usually<()> { +/// assert_eq!(check_layout("1")?, Some(XYWH(1u16, 1, 1, 1))); +/// assert_eq!(check_layout("1".pull_x(1))?, Some(XYWH(0u16, 1, 1, 1))); +/// assert_eq!(check_layout("1".pull_y(1))?, Some(XYWH(1u16, 0, 1, 1))); +/// assert_eq!(check_layout("1".pull_xy(1, 1))?, Some(XYWH(0u16, 0, 1, 1))); +/// # Ok(()) } +/// ``` +pub trait LayoutPull<'a, S: Screen>: Draw<'a, S> + Sized { + fn pull_x > + Copy> (self, w: X) + -> Pull<'a, S, Self, X> { Pull::X(self, w) } + fn pull_y > + Copy> (self, h: X) + -> Pull<'a, S, Self, X> { Pull::Y(self, h) } + fn pull_xy > + Copy> (self, w: X, h: X) + -> Pull<'a, S, Self, X> { Pull::XY(self, w, h) } +} + +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_full <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> PerhapsRef<'a, XYWH> +where + O: Screen + 'a, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.nth(1)?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("full/x") | Some("full/w") => Full::W(thunk).draw(to)?, + Some("full/y") | Some("full/h") => Full::H(thunk).draw(to)?, + Some("full/xy") | Some("full/wh") => Full::WH(thunk).draw(to)?, + frag => return Err(format!("invalid variant: {frag:?}").into()) + }) +} + +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_exact <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> PerhapsRef<'a, XYWH> +where + O: Screen + 'a, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.last()?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("exact/w") => thunk.exact_w( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("exact/h") => thunk.exact_h( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("exact/wh") => thunk.exact_wh( + state.namespace(expr.nth(1)?)?, + state.namespace(expr.nth(2)?)?, + ).draw(to)?, + _ => return Err(format!("invalid variant: {:?}", expr.head()?).into()) + }) +} + +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_min <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> PerhapsRef<'a, XYWH> +where + O: Screen + 'a, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.last()?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("min/w") => thunk.min_w( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("min/h") => thunk.min_h( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("min/wh") => thunk.min_wh( + state.namespace(expr.nth(1)?)?, + state.namespace(expr.nth(2)?)?, + ).draw(to)?, + _ => return Err(format!("invalid variant: {:?}", expr.head()?).into()) + }) +} + +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_max <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> PerhapsRef<'a, XYWH> +where + O: Screen + 'a, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.last()?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("max/w") => thunk.max_w( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("max/h") => thunk.max_h( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("max/wh") => thunk.max_wh( + state.namespace(expr.nth(1)?)?, + state.namespace(expr.nth(2)?)?, + ).draw(to)?, + _ => return Err(format!("invalid variant: {:?}", expr.head()?).into()) + }) +} + +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_push <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> PerhapsRef<'a, XYWH> +where + O: Screen + 'a, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.last()?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("push/w") => thunk.push_x(state.namespace(expr.nth(1)?)?).draw(to)?, + Some("push/h") => thunk.push_y(state.namespace(expr.nth(1)?)?).draw(to)?, + Some("push/wh") => thunk.push_xy(state.namespace(expr.nth(1)?)?, state.namespace(expr.nth(2)?)?,).draw(to)?, + _ => return Err(format!("invalid variant: {:?}", expr.head()?).into()) + }) +} + +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_pull <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> PerhapsRef<'a, XYWH> +where + O: Screen + 'a, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.last()?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("pull/w") => thunk.pull_x(state.namespace(expr.nth(1)?)?).draw(to)?, + Some("pull/h") => thunk.pull_y(state.namespace(expr.nth(1)?)?).draw(to)?, + Some("pull/wh") => thunk.pull_xy(state.namespace(expr.nth(1)?)?, state.namespace(expr.nth(2)?)?,).draw(to)?, + _ => return Err(format!("invalid variant: {:?}", expr.head()?).into()) + }) +} + +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_pad <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> PerhapsRef<'a, XYWH> +where + O: Screen + 'a, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.last()?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("pad/w") => thunk.pad_w( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("pad/h") => thunk.pad_h( + state.namespace(expr.nth(1)?)? + ).draw(to)?, + Some("pad/wh") => thunk.pad_wh( + state.namespace(expr.nth(1)?)?, + state.namespace(expr.nth(2)?)?, + ).draw(to)?, + _ => return Err(format!("invalid variant: {:?}", expr.head()?).into()) + }) +} + +impl <'a, S: Screen, I: Draw<'a, S>> Draw<'a, S> for Full<'a, S, I> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { let XYWH(x0, y0, w0, h0) = to.area(); let item = match self { Self::W(i) => i, Self::H(i) => i, Self::WH(i) => i, _ => unreachable!() @@ -17,19 +305,10 @@ def_layout_modifier_flat!( x1.unwrap_or(x2), y1.unwrap_or(y2), w1.unwrap_or(w2), h1.unwrap_or(h2), ))) } -); - -#[cfg(test)] #[test] fn test_layout_full () -> Usually<()> { - assert_eq!(check_layout("1")?, Some(XYWH(1u16, 1, 1, 1))); - assert_eq!(check_layout("1".full_w())?, Some(XYWH(1u16, 1, 80, 1))); - assert_eq!(check_layout("1".full_h())?, Some(XYWH(1u16, 1, 1, 25))); - assert_eq!(check_layout("1".full_wh())?, Some(XYWH(1u16, 1, 80, 25))); - Ok(()) } -def_layout_modifier!( - LayoutExact (exact_w exact_h exact_wh), - Exact { W H WH } kw_exact "exact" |self, to| { +impl <'a, S: Screen, I: Draw<'a, S>, X: Into> + Copy> Draw<'a, S> for Exact<'a, S, I, X> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { let XYWH(x0, y0, w0, h0) = to.area(); let (item, w1, h1) = match self { Self::W(item, w1) => (item, (*w1).into(), None), @@ -48,19 +327,10 @@ def_layout_modifier!( _ => unreachable!() })) } -); - -#[cfg(test)] #[test] fn test_layout_exact () -> Usually<()> { - assert_eq!(check_layout("FOOBAR\nKILROY")?, Some(XYWH(1, 1, 6, 2))); - assert_eq!(check_layout("FOOBAR\nKILROY".exact_w(3))?, Some(XYWH(1, 1, 3, 2))); - assert_eq!(check_layout("FOOBAR\nKILROY".exact_h(1))?, Some(XYWH(1, 1, 6, 1))); - assert_eq!(check_layout("FOOBAR\nKILROY".exact_wh(2, 1))?, Some(XYWH(1, 1, 2, 1))); - Ok(()) } -def_layout_modifier!( - LayoutMin (min_w min_h min_wh), - Min { W H WH } kw_min "min" |self, to| { +impl <'a, S: Screen, I: Draw<'a, S>, X: Into> + Copy> Draw<'a, S> for Min<'a, S, I, X> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { let XYWH(x0, y0, w0, h0) = to.area(); let (item, w1, h1) = match self { Self::W(item, w1) => (item, (*w1).into(), None), @@ -78,19 +348,10 @@ def_layout_modifier!( h1.map(|h1|h1.max(h2)).unwrap_or(h2) ))) } -); - -#[cfg(test)] #[test] fn test_layout_min () -> Usually<()> { - assert_eq!(check_layout("1".min_w(5))?, Some(XYWH(1u16, 1, 5, 1))); - assert_eq!(check_layout("1".min_h(5))?, Some(XYWH(1u16, 1, 1, 5))); - assert_eq!(check_layout("1".min_wh(5, 5))?, Some(XYWH(1u16, 1, 5, 5))); - assert_eq!(check_layout("123456".min_w(5))?, Some(XYWH(1u16, 1, 6, 1))); - Ok(()) } -def_layout_modifier!( - LayoutMax (max_w max_h max_wh), - Max { W H WH } kw_max "max" |self, to| { +impl <'a, S: Screen, I: Draw<'a, S>, X: Into> + Copy> Draw<'a, S> for Max<'a, S, I, X> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { let XYWH(x, y, w0, h0) = to.area(); let (item, w, h) = match self { Self::W(item, w) => (item, (*w).into().unwrap_or(w0), h0), @@ -100,31 +361,10 @@ def_layout_modifier!( }; to.draw(XYWH(x, y, if w0 > w { w } else { w0 }, if h0 > h { h } else { h0 }), item) } -); +} -def_layout_modifier!( - LayoutPad (pad_w pad_h pad_wh), - Pad { X Y XY } kw_pad "pad" |self, to| { - let XYWH(x, y, w0, h0) = to.area(); - let (item, w, h) = match self { - Self::X(item, w) => (item, (*w).into().unwrap_or_default(), Default::default()), - Self::Y(item, h) => (item, Default::default(), (*h).into().unwrap_or_default()), - Self::XY(item, w, h) => (item, (*w).into().unwrap_or_default(), - (*h).into().unwrap_or_default()), - _ => return Ok(None) - }; - to.draw(XYWH( - x.plus(w), - y.plus(h), - w0.minus(w).minus(w), - h0.minus(h).minus(h), - ), item) - } -); - -def_layout_modifier!( - LayoutPush (push_x push_y push_xy), - Push { X Y XY } kw_push "push" |self, to| { +impl <'a, S: Screen, I: Draw<'a, S>, X: Into> + Copy> Draw<'a, S> for Push<'a, S, I, X> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { match self { Self::__(_) => unreachable!(), Self::X(item, x1) if let Some(XYWH(x, y, w, h)) = to.size(None, item)? => { @@ -139,19 +379,10 @@ def_layout_modifier!( _ => Ok(None) } } -); - -#[cfg(test)] #[test] fn test_layout_push () -> Usually<()> { - assert_eq!(check_layout("1")?, Some(XYWH(1u16, 1, 1, 1))); - assert_eq!(check_layout("1".push_x(1))?, Some(XYWH(2u16, 1, 1, 1))); - assert_eq!(check_layout("1".push_y(1))?, Some(XYWH(1u16, 2, 1, 1))); - assert_eq!(check_layout("1".push_xy(1, 1))?, Some(XYWH(2u16, 2, 1, 1))); - Ok(()) } -def_layout_modifier!( - LayoutPull (pull_x pull_y pull_xy), - Pull { X Y XY } kw_pull "pull" |self, to| { +impl <'a, S: Screen, I: Draw<'a, S>, X: Into> + Copy> Draw<'a, S> for Pull<'a, S, I, X> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { match self { Self::__(_) => unreachable!(), Self::X(item, x1) if let Some(XYWH(x, y, w, h)) = to.size(None, item)? => { @@ -172,16 +403,41 @@ def_layout_modifier!( _ => Ok(None) } } -); - -#[cfg(test)] #[test] fn test_layout_pull () -> Usually<()> { - assert_eq!(check_layout("1")?, Some(XYWH(1u16, 1, 1, 1))); - assert_eq!(check_layout("1".pull_x(1))?, Some(XYWH(0u16, 1, 1, 1))); - assert_eq!(check_layout("1".pull_y(1))?, Some(XYWH(1u16, 0, 1, 1))); - assert_eq!(check_layout("1".pull_xy(1, 1))?, Some(XYWH(0u16, 0, 1, 1))); - Ok(()) } -#[cfg(test)] fn check_layout (t: impl Draw) -> Perhaps> { +impl <'a, S: Screen, I: Draw<'a, S>, X: Into> + Copy> Draw<'a, S> for Pad<'a, S, I, X> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { + let XYWH(x, y, w0, h0) = to.area(); + let (item, w, h) = match self { + Self::X(item, w) => (item, (*w).into().unwrap_or_default(), Default::default()), + Self::Y(item, h) => (item, Default::default(), (*h).into().unwrap_or_default()), + Self::XY(item, w, h) => (item, (*w).into().unwrap_or_default(), + (*h).into().unwrap_or_default()), + _ => return Ok(None) + }; + to.draw(XYWH( + x.plus(w), + y.plus(h), + w0.minus(w).minus(w), + h0.minus(h).minus(h), + ), item) + } +} + +impl<'a, S: Screen, T: Draw<'a, S>> LayoutFull<'a, S> for T {} + +impl<'a, S: Screen, T: Draw<'a, S>> LayoutExact<'a, S> for T {} + +impl<'a, S: Screen, T: Draw<'a, S>> LayoutMin<'a, S> for T {} + +impl<'a, S: Screen, T: Draw<'a, S>> LayoutMax<'a, S> for T {} + +impl<'a, S: Screen, T: Draw<'a, S>> LayoutPush<'a, S> for T {} + +impl<'a, S: Screen, T: Draw<'a, S>> LayoutPull<'a, S> for T {} + +impl<'a, S: Screen, T: Draw<'a, S>> LayoutPad<'a, S> for T {} + +#[cfg(test)] fn check_layout <'a> (t: impl Draw<'a, Tui>) -> Drawn<'a, u16> { Tui::Layout(XYWH(1u16, 1, 80, 25)).size(None, t) } diff --git a/src/layout/azimuth.rs b/src/layout/azimuth.rs index bfb4d80..484bfc7 100644 --- a/src/layout/azimuth.rs +++ b/src/layout/azimuth.rs @@ -18,9 +18,11 @@ pub struct Origin( pub(crate) T ); -impl_draw!(,>|self: Origin, _to: S|{ - todo!() -}); +impl<'a, S: Screen, T: Draw<'a, S>> Draw<'a, S> for Origin { + fn draw (&self, _to: &mut S) -> Drawn<'a, S::Unit> { + todo!() + } +} /// Something that has `[0, 0]` at a particular point. pub trait HasOrigin { @@ -33,25 +35,47 @@ impl> HasOrigin for T { } } -fn_kw_layout!(kw_align |state, output, expr| { - let head = expr.head(); - let mut frags = head.src()?.unwrap_or_default().split("/"); - Ok(matches!(frags.next(), Some("align")).then(||{ - draw(move|output: &mut O|{state.interpret(output, &expr.tail().head())}).align( - eval_enum!("align", output, state, - expr.head().src()?.unwrap_or_default().split("/").skip(1).next(), - Azimuth { - "c" => C, "x" => X, "y" => Y, - "n" => N, "s" => S, "e" => E, "w" => W, - "nw" => NW, "sw" => SW, "ne" => NE, "se" => SE, - }) - ).draw(output) - }).transpose()?.flatten()) -}); +#[cfg(all(feature = "draw", feature = "eval"))] +pub fn kw_align <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str) + -> Drawn<'a, O::Unit> +where + O: Screen, + S: Interpret<'a, O, Option>> + + Namespace + + Namespace + + Namespace> +{ + let thunk = draw(move|screen|ok_flat(expr.nth(1)?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("align/c") => Align(Some(Azimuth::C), thunk).draw(to)?, + Some("align/x") => Align(Some(Azimuth::X), thunk).draw(to)?, + Some("align/y") => Align(Some(Azimuth::Y), thunk).draw(to)?, + Some("align/n") => Align(Some(Azimuth::N), thunk).draw(to)?, + Some("align/s") => Align(Some(Azimuth::S), thunk).draw(to)?, + Some("align/e") => Align(Some(Azimuth::E), thunk).draw(to)?, + Some("align/w") => Align(Some(Azimuth::W), thunk).draw(to)?, + Some("align/nw") => Align(Some(Azimuth::NW), thunk).draw(to)?, + Some("align/sw") => Align(Some(Azimuth::SW), thunk).draw(to)?, + Some("align/ne") => Align(Some(Azimuth::NE), thunk).draw(to)?, + Some("align/se") => Align(Some(Azimuth::SE), thunk).draw(to)?, + frag => return Err(format!("invalid variant: {frag:?}").into()) + }) + //Ok(matches!(expr.head().src()?.unwrap_or_default().split("/").next(), Some("align")).then(||{ + //draw(move|output: &mut O|{state.interpret(output, &expr.nth(1))}).align( + //eval_enum!("align", output, state, + //expr.head().src()?.unwrap_or_default().split("/").skip(1).next(), + //Azimuth { + //"c" => C, "x" => X, "y" => Y, + //"n" => N, "s" => S, "e" => E, "w" => W, + //"nw" => NW, "sw" => SW, "ne" => NE, "se" => SE, + //}) + //).draw(output) + //}).transpose()?.flatten()) +} -impl> CanAlign for T {} +impl<'a, S: Screen, T: Draw<'a, S>> CanAlign<'a, S> for T {} -pub trait CanAlign: Draw + Sized { +pub trait CanAlign<'a, S: Screen>: Draw<'a, S> + Sized { fn align (self, azimuth: impl Into>) -> Align { Align(azimuth.into(), self) } @@ -95,8 +119,8 @@ pub struct Align( pub(crate) T, ); -impl> Draw for Align { - fn draw (&self, to: &mut S) -> Perhaps> { +impl<'a, S: Screen, T: Draw<'a, S>> Draw<'a, S> for Align { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { let Self(azimuth, item) = self; let area0 = to.area(); let size = to.size(area0, item)?; @@ -133,25 +157,17 @@ fn align ( } fn_kw_layout!(kw_split |state, output, expr| { - let head = expr.head(); - let mut frags = head.src()?.unwrap_or_default().split("/"); - Ok(matches!(frags.next(), Some("bsp")).then(||{ - eval_enum!("bsp", output, state, frags.next(), Split { - "n" => North, - "s" => South, - "e" => East, - "w" => West, - "a" => Above, - "b" => Below - }).stack( - draw(move|output: &mut O|{ - state.interpret(output, &expr.tail().head()?) - }), - draw(move|output: &mut O|{ - state.interpret(output, &expr.tail().tail().head()?) - }), - ).draw(output) - }).transpose()?.flatten()) + let thunk_a = draw(move|screen|ok_flat(expr.nth(1)?.map(|x: &'a str|state.interpret(screen, x)))); + let thunk_b = draw(move|screen|ok_flat(expr.nth(2)?.map(|x: &'a str|state.interpret(screen, x)))); + Ok(match expr.head()? { + Some("bsp/n") => Split::North.stack(thunk_a, thunk_b).draw(output)?, + Some("bsp/s") => Split::South.stack(thunk_a, thunk_b).draw(output)?, + Some("bsp/e") => Split::East.stack(thunk_a, thunk_b).draw(output)?, + Some("bsp/w") => Split::West.stack(thunk_a, thunk_b).draw(output)?, + Some("bsp/a") => Split::Above.stack(thunk_a, thunk_b).draw(output)?, + Some("bsp/b") => Split::Below.stack(thunk_a, thunk_b).draw(output)?, + frag => return Err(format!("invalid variant: {frag:?}").into()) + }) }); /// Split along an axis. Direction determines order. @@ -165,16 +181,28 @@ fn_kw_layout!(kw_split |state, output, expr| { #[default] Below } -pub struct Pair, B: Draw>(Split, A, B, PhantomData); +pub struct Pair(Split, A, B); -pub fn split , B: Draw> ( +/// ``` +/// # fn test_split_stack () -> Usually<()> { +/// use Split::*; +/// fn size_of , B: Draw> (stack: &Pair) -> Drawn<'a, S::Unit> { +/// Tui::Layout(XYWH(0, 0, 80, 25)).size(None, stack) +/// } +/// assert_eq!(size_of(&split(East, "foo", "bar"))?, Some(XYWH(0, 0, 6, 1))); +/// assert_eq!(size_of(&split(South, "foo", "bar"))?, Some(XYWH(0, 0, 3, 2))); +/// assert_eq!(size_of(&split(South, split(East, "foo", "bar"), "baz"))?, Some(XYWH(0, 0, 6, 2))); +/// assert_eq!(size_of(&split(East, split(South, "foo", "bar"), "baz"))?, Some(XYWH(0, 0, 6, 2))); +/// # return Ok(()); } +/// ``` +pub fn split <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> ( split: Split, a: A, b: B -) -> Pair { - Pair(split, a, b, PhantomData) +) -> Pair { + Pair(split, a, b) } -impl, B: Draw> Draw for Pair { - fn draw (&self, to: &mut S) -> Drawn { +impl<'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> Draw<'a, S> for Pair { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { let Self(split, a, b, ..) = self; let (area_a, area_b) = stack_areas(split, to, a, b)?; let (drawn_a, drawn_b) = draw_stacks(split, to, a, area_a, None, b, area_b, None)?; @@ -182,16 +210,16 @@ impl, B: Draw> Draw for Pair { } } -fn draw_stacks ( +fn draw_stacks <'a, S: Screen> ( split: &Split, to: &mut S, - a: impl Draw, + a: impl Draw<'a, S>, area_a: impl Into>>, origin_a: impl Into>, - b: impl Draw, + b: impl Draw<'a, S>, area_b: impl Into>>, origin_b: impl Into>, -) -> Usually<(Option>, Option>)> { +) -> UsuallyRef<'a, (Option>, Option>)> { let draw_a = |to: &mut S|Ok::<_, Box>(match origin_a.into() { Some(origin_a) => to.draw(area_a.into(), a.align(origin_a))?, None => to.draw(area_a.into(), a)? @@ -209,12 +237,25 @@ fn draw_stacks ( }) } -pub fn stack_areas ( +/// ``` +/// # fn test_stack_areas () -> Usually<()> { +/// let area = XYWH(0u16, 0, 80, 25); +/// assert_eq!(stack_areas(&Split::East, &mut Tui::Layout(area), &"foo", &"bar")?, ( +/// Some(XYWH(0u16, 0, 3, 1)), +/// Some(XYWH(3u16, 0, 3, 1)), +/// )); +/// assert_eq!(stack_areas(&Split::South, &mut Tui::Layout(area), &"foo", &"bar")?, ( +/// Some(XYWH(0u16, 0, 3, 1)), +/// Some(XYWH(0u16, 1, 3, 1)), +/// )); +/// # Ok(()) } +/// ``` +pub fn stack_areas <'a, S: Screen> ( split: &Split, to: &mut S, - a: impl Draw, - b: impl Draw, -) -> Usually<(Option>, Option>)> { + a: impl Draw<'a, S>, + b: impl Draw<'a, S>, +) -> UsuallyRef<'a, (Option>, Option>)> { let area_a = to.size(None, a)?; Ok(match split { Split::South => ( @@ -289,8 +330,10 @@ impl Split { /// let _ = Split::East.stack(&"", &""); /// let _ = Split::West.stack(&"", &""); /// ``` - pub const fn stack , B: Draw> (&self, a: A, b: B) -> impl Draw { - Pair(*self, a, b, PhantomData) + pub const fn stack <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (&self, a: A, b: B) + -> impl Draw<'a, S> + { + Pair(*self, a, b) } /// ``` @@ -302,7 +345,9 @@ impl Split { /// let _ = Split::East.half(&"", &""); /// let _ = Split::West.half(&"", &""); /// ``` - pub const fn half , B: Draw> (&self, a: &A, b: &B) -> impl Draw { + pub const fn half <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (&self, a: &A, b: &B) + -> impl Draw<'a, S> + { draw(move|to: &mut S|{ let (area_a, area_b) = to.xywh().split_half(self); let (origin_a, origin_b) = self.origins(); @@ -356,28 +401,28 @@ impl Split { } -pub const fn east , B: Draw> (a: A, b: B) -> impl Draw { - Pair(Split::East, a, b, PhantomData) +pub const fn east <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (a: A, b: B) -> impl Draw<'a, S> { + Pair(Split::East, a, b) } -pub const fn north , B: Draw> (a: A, b: B) -> impl Draw { - Pair(Split::North, a, b, PhantomData) +pub const fn north <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (a: A, b: B) -> impl Draw<'a, S> { + Pair(Split::North, a, b) } -pub const fn west , B: Draw> (a: A, b: B) -> impl Draw { - Pair(Split::West, a, b, PhantomData) +pub const fn west <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (a: A, b: B) -> impl Draw<'a, S> { + Pair(Split::West, a, b) } -pub const fn south , B: Draw> (a: A, b: B) -> impl Draw { - Pair(Split::South, a, b, PhantomData) +pub const fn south <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (a: A, b: B) -> impl Draw<'a, S> { + Pair(Split::South, a, b) } -pub const fn above , B: Draw> (a: A, b: B) -> impl Draw { - Pair(Split::Above, a, b, PhantomData) +pub const fn above <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (a: A, b: B) -> impl Draw<'a, S> { + Pair(Split::Above, a, b) } -pub const fn below , B: Draw> (a: A, b: B) -> impl Draw { - Pair(Split::Below, a, b, PhantomData) +pub const fn below <'a, S: Screen, A: Draw<'a, S>, B: Draw<'a, S>> (a: A, b: B) -> impl Draw<'a, S> { + Pair(Split::Below, a, b) } #[macro_export] macro_rules! north { @@ -410,38 +455,6 @@ pub const fn below , B: Draw> (a: A, b: B) -> impl Draw ($head:expr, $($tail:expr),* $(,)?) => { below($head, below!($($tail,)*)) }; } -#[cfg(test)] #[test] fn test_stack_areas () -> Usually<()> { - let area = XYWH(0u16, 0, 80, 25); - - assert_eq!(stack_areas(&Split::East, &mut Tui::Layout(area), &"foo", &"bar")?, ( - Some(XYWH(0u16, 0, 3, 1)), - Some(XYWH(3u16, 0, 3, 1)), - )); - - assert_eq!(stack_areas(&Split::South, &mut Tui::Layout(area), &"foo", &"bar")?, ( - Some(XYWH(0u16, 0, 3, 1)), - Some(XYWH(0u16, 1, 3, 1)), - )); - - Ok(()) -} - -#[cfg(test)] #[test] fn test_split_stack () -> Usually<()> { - use Split::*; - fn size_of , B: Draw> (stack: &Pair) -> Perhaps> { - Tui::Layout(XYWH(0, 0, 80, 25)).size(None, stack) - } - assert_eq!(size_of(&split(East, "foo", "bar"))?, - Some(XYWH(0, 0, 6, 1))); - assert_eq!(size_of(&split(South, "foo", "bar"))?, - Some(XYWH(0, 0, 3, 2))); - assert_eq!(size_of(&split(South, split(East, "foo", "bar"), "baz"))?, - Some(XYWH(0, 0, 6, 2))); - assert_eq!(size_of(&split(East, split(South, "foo", "bar"), "baz"))?, - Some(XYWH(0, 0, 6, 2))); - return Ok(()); -} - #[cfg(test)] #[test] fn test_align () -> Usually<()> { let mut screen = Tui::Layout(XYWH(0, 0, 80, 25)); assert_eq!("FOOBAR\nKILROY".draw(&mut screen)?, Some(XYWH(0, 0, 6, 2))); diff --git a/src/layout/cond.rs b/src/layout/cond.rs index a95d8f1..6315d34 100644 --- a/src/layout/cond.rs +++ b/src/layout/cond.rs @@ -1,11 +1,10 @@ use crate::*; fn_kw_layout!(kw_when |state, output, expr| { - Ok(matches!(expr.head()?, Some("when")).then(||{ - when(state.namespace(expr.tail().head())?.unwrap(), - draw(move|output: &mut O|{state.interpret(output, &expr.tail().tail().head())}) - ).draw(output) - }).transpose()?.flatten()) + let thunk = draw(move|screen|ok_flat(expr.nth(2)?.map(|x: &'a str|state.interpret(screen, x)))); + ok_flat(matches!(expr.head()?, Some("when")).then(||{ + when(state.namespace(expr.nth(1)?)?.unwrap(), thunk) .draw(output) + })) }); /// Only render when condition is true. @@ -16,21 +15,16 @@ fn_kw_layout!(kw_when |state, output, expr| { /// when(true, "Yes") /// # } /// ``` -pub const fn when (condition: bool, item: impl Draw) -> impl Draw { +pub const fn when <'a, T: Screen> (condition: bool, item: impl Draw<'a, T>) -> impl Draw<'a, T> { draw(move|to: &mut T|if condition { item.draw(to) } else { Ok(Default::default()) }) } fn_kw_layout!(kw_either |state, output, expr| { - Ok(matches!(expr.head()?, Some("either")).then(||{ - either(state.namespace(expr.tail().head()?)?.unwrap(), - draw(move|output: &mut O|{ - state.interpret(output, &expr.tail().tail().head()?) - }), - draw(move|output: &mut O|{ - state.interpret(output, &expr.tail().tail().tail().head()?) - }), - ).draw(output) - }).transpose()?.flatten()) + let thunk_a = draw(move|screen|ok_flat(expr.nth(2)?.map(|x: &'a str|state.interpret(screen, x)))); + let thunk_b = draw(move|screen|ok_flat(expr.nth(3)?.map(|x: &'a str|state.interpret(screen, x)))); + ok_flat(matches!(expr.head()?, Some("either")).then(||{ + either(state.namespace(expr.nth(1)?)?.unwrap(), thunk_a, thunk_b).draw(output) + })) }); /// Render one thing if a condition is true and another false. @@ -41,6 +35,8 @@ fn_kw_layout!(kw_either |state, output, expr| { /// either(true, "Yes", "No") /// # } /// ``` -pub const fn either (condition: bool, a: impl Draw, b: impl Draw) -> impl Draw { +pub const fn either <'a, T: Screen> ( + condition: bool, a: impl Draw<'a, T>, b: impl Draw<'a, T> +) -> impl Draw<'a, T> { draw(move|to: &mut T|if condition { a.draw(to) } else { b.draw(to) }) } diff --git a/src/layout/iter.rs b/src/layout/iter.rs index 1662c0c..cede6d6 100644 --- a/src/layout/iter.rs +++ b/src/layout/iter.rs @@ -1,8 +1,8 @@ use super::*; -pub fn iter_south <'a, S: Screen, D: Draw, I: Iterator> ( +pub fn iter_south <'a, S: Screen, D: Draw<'a, S>, I: Iterator> ( iter: impl Fn()->I -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|to: &mut S|{ let XYWH(x, y, w, h) = to.area(); let mut y_next = y; @@ -22,9 +22,9 @@ pub fn iter_south <'a, S: Screen, D: Draw, I: Iterator> ( }) } -pub fn iter_east <'a, S: Screen, D: Draw, I: Iterator> ( +pub fn iter_east <'a, S: Screen, D: Draw<'a, S>, I: Iterator> ( iter: impl Fn()->I -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|to: &mut S|{ let XYWH(x, y, w, h) = to.area(); let mut x_next = x; @@ -45,74 +45,75 @@ pub fn iter_east <'a, S: Screen, D: Draw, I: Iterator> ( } /// Iterate over a collection of the same kind of [Draw]able: -pub fn iter <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( +pub fn iter <'a, S: Screen, D: 'a, I: Iterator, U: Draw<'a, S>> ( _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|_to: &mut S|{ todo!() }) } /// Iterate over a collection of the same kind of [Draw]able: -pub fn iter_once <'a, S: Screen, D: 'a, U: Draw> ( +pub fn iter_once <'a, S: Screen, D: 'a, U: Draw<'a, S>> ( _iter: impl Iterator, _draw: impl Fn(D, usize)->U, -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|_to: &mut S|{ todo!() }) } /// Iterate over a collection of various [Draw]ables: pub fn iter_dyn < + 'a, S: Screen, // Target screen D, // Input doesn't need to be [Draw]able, output does V: Fn()->I, // Function that returns the iterator I: Iterator, // Type of the iterator - F: Fn(&D, usize)->dyn Draw, // Function that returns [Draw]able from iterator item -> (_items: V, _cb: F) -> impl Draw { + F: Fn(&D, usize)->dyn Draw<'a, S>, // Function that returns [Draw]able from iterator item +> (_items: V, _cb: F) -> impl Draw<'a, S> { draw(move|_to: &mut S|{ todo!() }) } -pub fn iter_north <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( +pub fn iter_north <'a, S: Screen, D: 'a, I: Iterator, U: Draw<'a, S>> ( _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|_to: &mut S|{ todo!() }) } -pub fn iter_east_fixed <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( +pub fn iter_east_fixed <'a, S: Screen, D: 'a, I: Iterator, U: Draw<'a, S>> ( _height: S::Unit, _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|_to: &mut S|{ todo!() }) } -pub fn iter_south_fixed <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( +pub fn iter_south_fixed <'a, S: Screen, D: 'a, I: Iterator, U: Draw<'a, S>> ( _height: S::Unit, _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|_to: &mut S|{ todo!() }) } -pub fn iter_west <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( +pub fn iter_west <'a, S: Screen, D: 'a, I: Iterator, U: Draw<'a, S>> ( _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, -) -> impl Draw { +) -> impl Draw<'a, S> { draw(move|_to: &mut S|{ todo!() }) } -pub fn row_south (south: S::Unit, height: S::Unit, content: impl Draw) - -> impl Draw +pub fn row_south <'a, S: Screen + 'a> (south: S::Unit, height: S::Unit, content: impl Draw<'a, S>) + -> impl Draw<'a, S> { content.exact_h(height).push_y(south) } -pub fn row_north (north: S::Unit, height: S::Unit, content: impl Draw) - -> impl Draw +pub fn row_north <'a, S: Screen + 'a> (north: S::Unit, height: S::Unit, content: impl Draw<'a, S>) + -> impl Draw<'a, S> { content.exact_h(height).pull_y(north) } -pub fn col_east (east: S::Unit, width: S::Unit, content: impl Draw) - -> impl Draw +pub fn col_east <'a, S: Screen + 'a> (east: S::Unit, width: S::Unit, content: impl Draw<'a, S>) + -> impl Draw<'a, S> { content.exact_w(width).push_x(east) } -pub fn col_west (west: S::Unit, width: S::Unit, content: impl Draw) - -> impl Draw +pub fn col_west <'a, S: Screen + 'a> (west: S::Unit, width: S::Unit, content: impl Draw<'a, S>) + -> impl Draw<'a, S> { content.exact_w(width).pull_x(west) } diff --git a/src/lib.rs b/src/lib.rs index be344bc..ac7b155 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1265,17 +1265,17 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } draw: &impl Fn(&mut Self)->T ) -> T; /// Determine used area without drawing - fn size ( + fn size <'a> ( &mut self, area: impl Into>>, - draw: impl Draw - ) -> Perhaps>; + draw: impl Draw<'a, Self> + ) -> Drawn<'a, Self::Unit>; /// Draw - fn draw ( + fn draw <'a> ( &mut self, area: impl Into>>, - draw: impl Draw - ) -> Perhaps>; + draw: impl Draw<'a, Self> + ) -> Drawn<'a, Self::Unit>; } /// Implement the [Draw] trait for a particular drawable and [Screen]. @@ -1290,7 +1290,7 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } #[macro_export] macro_rules! impl_draw ( ($(<$($T:ident: $Trait:path,)+>)?| $self:ident:$Self:path, $to:ident:$To:ty - |$draw:block)=>{ impl$(<$($T:$Trait),+>)? Draw<$To> for $Self { + |$draw:block)=>{ impl$(<$($T:$Trait),+>)? Draw<'_, $To> for $Self { fn draw (&$self, $to: &mut $To) -> Perhaps::Unit>> $draw } }; ($(<$($T:ident: $Trait:path,)+>)?| @@ -1321,8 +1321,8 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } /// } /// } /// ``` - pub trait Draw { - fn draw (&self, to: &mut S) -> Drawn; + pub trait Draw<'a, S: Screen> { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit>; } /// Emit a [Draw]able. @@ -1345,14 +1345,14 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } /// let _ = view::(||"drawable"); /// let _ = view::(||Some("drawable")); /// ``` - pub const fn view , F: Fn()->T> (view: F) -> impl View { + pub const fn view Draw<'a, S>, F: Fn()->T> (view: F) -> impl View { ViewThunk(view, PhantomData) } /// Because we can't implement [Draw] for `F: FnOnce...` without conflicts. pub struct ViewThunk(pub F, std::marker::PhantomData); - impl, F: Fn()->T> View for ViewThunk { + impl Draw<'a, S>, F: Fn()->T> View for ViewThunk { fn view (&self) -> impl Draw { self.0() } @@ -1361,8 +1361,8 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } /// Because we can't implement [Draw] for `F: FnOnce...` without conflicts. pub struct DrawThunk(pub F, std::marker::PhantomData); - implPerhaps>> Draw for DrawThunk { - fn draw (&self, to: &mut T) -> Perhaps> { + impl<'a, T: Screen, F: Fn(&mut T)->PerhapsRef<'a, XYWH>> Draw<'a, T> for DrawThunk { + fn draw (&self, to: &mut T) -> PerhapsRef<'a, XYWH> { to.clip(None, &self.0) } } @@ -1373,23 +1373,25 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } /// # use tengri::*; /// let _ = draw(|to: &mut Tui|Ok(Some(to.area()))); // draws nothing /// ``` - pub const fn draw Perhaps>> ( + pub const fn draw <'a, T: Screen, F: Fn(&mut T)->PerhapsRef<'a, XYWH>> ( item: F ) -> DrawThunk { DrawThunk(item, std::marker::PhantomData) } - pub type Drawn = Perhaps>; + pub type Drawn<'a, U> = PerhapsRef<'a, XYWH>; - impl Draw for () { - fn draw (&self, _: &mut S) -> Drawn { + impl<'a, S: Screen> Draw<'a, S> for () { + fn draw (&self, _: &mut S) -> Drawn<'a, S::Unit> { Ok(None) } } - impl_draw!(,>|self: Option, to: S|{ - self.as_ref().map(|it|it.draw(to)).transpose().map(Option::unwrap_or_default) - }); + impl<'a, S: Screen, D: Draw<'a, S>> Draw<'a, S> for Option { + fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> { + self.as_ref().map(|it|it.draw(to)).transpose().map(Option::unwrap_or_default) + } + } //impl> Draw for RwLock { //fn draw (&self, __: &mut S) -> Drawn { @@ -1403,8 +1405,8 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } //} //} - impl> Draw for &V { - fn draw (&self, to: &mut T) -> Perhaps> { + impl<'a, T: Screen, V: Draw<'a, T>> Draw<'a, T> for &V { + fn draw (&self, to: &mut T) -> Drawn<'a, T::Unit> { (*self).draw(to) } } @@ -1717,7 +1719,7 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } impl ItemTheme { #[cfg(feature = "term")] pub const G: [Self;256] = { - let mut builder = dizzle::konst::array::ArrayBuilder::new(); + let mut builder = ::konst::array::ArrayBuilder::new(); while !builder.is_full() { let index = builder.len() as u8; let light = (index as f64 * 1.15) as u8; @@ -1788,23 +1790,26 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } } } - pub trait ColorDsl: Sized { - fn new_g (expr: T, try_to_u8: impl Fn(Perhaps<&str>)->Perhaps) -> Usually; - fn new_rgb (expr: T, try_to_u8: impl Fn(Perhaps<&str>)->Perhaps) -> Usually; + pub trait ColorDsl<'a, T>: Sized { + fn new_g (expr: &'a T, try_to_u8: impl Fn(PerhapsRef<'a, &'a str>)->PerhapsRef<'a, u8>) + -> UsuallyRef<'a, Self>; + fn new_rgb (expr: &'a T, try_to_u8: impl Fn(PerhapsRef<'a, &str>)->PerhapsRef<'a, u8>) + -> UsuallyRef<'a, Self>; } - impl ColorDsl for Color { - fn new_g (expr: T, try_to_u8: impl Fn(Perhaps<&str>)->Perhaps) -> Usually { + impl<'a, T: Language<'a> + 'a> ColorDsl<'a, T> for Color { + fn new_g (expr: &'a T, try_to_u8: impl Fn(PerhapsRef<'a, &'a str>)->PerhapsRef<'a, u8>) + -> Result> + { let n = try_to_u8(expr.tail().map_err(Into::into))?.ok_or(Domain("not gray"))?; Ok(Self::Rgb(n, n, n)) } - fn new_rgb (expr: T, try_to_u8: impl Fn(Perhaps<&str>)->Perhaps) -> Usually { - let r = try_to_u8(expr.tail().map_err(Into::into))? - .ok_or(Domain("not red"))?; - let g = try_to_u8(expr.tail().tail().head().map_err(Into::into))? - .ok_or(Domain("not green"))?; - let b = try_to_u8(expr.tail().tail().tail().head().map_err(Into::into))? - .ok_or(Domain("not blue"))?; + fn new_rgb (expr: &'a T, try_to_u8: impl Fn(PerhapsRef<'a, &str>)->PerhapsRef<'a, u8>) + -> Result> + { + let r = try_to_u8(expr.nth(1).map_err(Into::into))?.ok_or(Domain("not red"))?; + let g = try_to_u8(expr.nth(2).map_err(Into::into))?.ok_or(Domain("not green"))?; + let b = try_to_u8(expr.nth(3).map_err(Into::into))?.ok_or(Domain("not blue"))?; Ok(Color::Rgb(r, g, b)) } } @@ -1902,7 +1907,7 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } /// } /// /// impl Interpret>> for App { - /// fn interpret_expr <'a> (&'a self, to: &mut Tui, lang: &'a impl Expression) + /// fn interpret_expr <'a> (&'a self, to: &mut Tui, lang: &'a impl Language) /// -> Usually>> /// { /// self.keyword(to, lang) @@ -1931,7 +1936,7 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } /// ``` pub trait Keywords : 'static { fn keywords () -> impl Iterator Perhaps>; - fn keyword (&self, to: &mut U, expr: &impl Expression) -> Perhaps { + fn keyword <'a> (&self, to: &mut U, expr: &'a impl Language<'a>) -> PerhapsRef<'a, V> { if let Some(expr) = expr.src()? { for keyword in Self::keywords() { if let Some(result) = keyword(self, to, &expr)? { @@ -1954,17 +1959,5 @@ pub trait AsMutOpt { fn as_mut_opt (&mut self) -> Option<&mut T>; } } } -pub fn invalid_variant ( - name: &str, - frag: impl Language, - expr: impl Language, - head: impl Language, -) -> Usually { - unimplemented!( - "{name}/{frag:?} ({expr:?}) ({head:?}) ({:?})", - head.src()?.unwrap_or_default().split("/").next() - ) -} - #[cfg(feature = "term")] pub use self::term::*; #[cfg(feature = "term")] mod term; diff --git a/src/term.rs b/src/term.rs index d41a823..97ba47d 100644 --- a/src/term.rs +++ b/src/term.rs @@ -96,14 +96,14 @@ impl Screen for Tui { fn area (&self) -> XYWH { self.into() } - fn size ( - &mut self, area: impl Into>>, draw: impl Draw, - ) -> Perhaps> { + fn size <'a> ( + &mut self, area: impl Into>>, draw: impl Draw<'a, Self>, + ) -> Drawn<'a, Self::Unit> { Self::Layout(self.area()).clip(area, &|to|draw.draw(to)) } - fn draw ( - &mut self, area: impl Into>>, draw: impl Draw - ) -> Perhaps> { + fn draw <'a> ( + &mut self, area: impl Into>>, draw: impl Draw<'a, Tui> + ) -> Drawn<'a, Self::Unit> { self.clip(area, &|to|draw.draw(to)) } fn clip ( @@ -289,7 +289,7 @@ impl Tui { /// let _ = tengri::Tui::catcher(&variant); /// } /// ``` - pub fn catcher > (result: &Usually) -> impl Draw { + pub fn catcher <'a, T: Draw<'a, Tui>> (result: &Usually) -> impl Draw<'a, Tui> { draw(move|to: &mut Tui|match result { Ok(content) => content.draw(to), Err(e) => { @@ -369,7 +369,7 @@ impl<'a: 'b, 'b> From<&'a mut Tui> for &'b mut XYWH { } } -pub const fn fill_char (c: char) -> impl Draw { +pub const fn fill_char <'a> (c: char) -> impl Draw<'a, Tui> { draw(move|to: &mut Tui|Ok(Some(to.update(&|cell,_,_|{ cell.set_char(c); })))) @@ -378,8 +378,8 @@ pub const fn fill_char (c: char) -> impl Draw { /// FIXME: Don't use `format!` but implement number blitting pub struct ShowSize; -impl Draw for ShowSize { - fn draw (&self, to: &mut Tui) -> Drawn { +impl<'a> Draw<'a, Tui> for ShowSize { + fn draw (&self, to: &mut Tui) -> Drawn<'a, u16> { let area = to.area(); let info = format!("{area:?}"); to.text(&info, area.0, area.1, info.len() as u16) @@ -388,8 +388,8 @@ impl Draw for ShowSize { pub struct ShowSizeOf(pub T); -impl> Draw for ShowSizeOf { - fn draw (&self, to: &mut Tui) -> Drawn { +impl<'a, T: Draw<'a, Tui>> Draw<'a, Tui> for ShowSizeOf { + fn draw (&self, to: &mut Tui) -> Drawn<'a, u16> { Ok(self.0.draw(to)?.map(|used|{ let _ = to.text(&format!("{used:?}"), used.0, used.1, u16::MAX); used @@ -398,13 +398,14 @@ impl> Draw for ShowSizeOf { } #[cfg(feature = "eval")] fn_kw_layout_tui!(kw_tui_text |_state, output, expr| { - Ok(matches!(expr.head()?, Some("text")).then(||{ - if let Some(src) = expr.tail().src()? && src.len() > 0 { - (&src[1..]).draw(output) - } else { - return Ok(None) - } - }).transpose()?.flatten()) + Ok(if matches!(expr.head()?, Some("text")) { + expr.tail()? + .and_then(|src|(src.len() > 0).then(||(&src[1..]).draw(output))) + .transpose()? + .flatten() + } else { + None + }) }); #[cfg(feature = "text")] pub use self::tui_text::*; @@ -473,8 +474,8 @@ impl> Draw for ShowSizeOf { self.as_ref().draw(to) }); - impl Draw for &str { - fn draw (&self, to: &mut Tui) -> Drawn { + impl<'a> Draw<'a, Tui> for &str { + fn draw (&self, to: &mut Tui) -> Drawn<'a, u16> { let XYWH(x, y, w, h) = to.area(); let mut max_w = 0u16; let mut max_h = 0u16; @@ -493,8 +494,8 @@ impl> Draw for ShowSizeOf { } } - impl<'t, T: AsRef> Draw for TrimStr<'_, T> { - fn draw (&self, to: &mut Tui) -> Drawn { + impl<'a, T: AsRef> Draw<'a, Tui> for TrimStr<'a, T> { + fn draw (&self, to: &mut Tui) -> Drawn<'a, u16> { let text = self.1.as_ref(); let area = layout_text_u16(text, to.area())?.unwrap(); let XYWH(x, y, w, ..) = to.area(); diff --git a/src/term/border.rs b/src/term/border.rs index 1edbc5a..c7167ab 100644 --- a/src/term/border.rs +++ b/src/term/border.rs @@ -5,7 +5,9 @@ use crate::*; /// ``` /// /// TODO /// ``` -pub fn border (on: bool, style: impl BorderStyle, item: impl Draw) -> impl Draw { +pub fn border <'a> ( + on: bool, style: impl BorderStyle<'a>, item: impl Draw<'a, Tui> +) -> impl Draw<'a, Tui> { let content = item.pad_wh(1, 1); let outline = when(on, draw(move|to: &mut Tui|{ let XYWH(x, y, w, h) = to.area(); @@ -33,7 +35,7 @@ macro_rules! border { $nw:literal $n:literal $ne:literal $w:literal $e:literal $sw:literal $s:literal $se:literal $($x:tt)* }),+) => {$( - impl BorderStyle for $T { + impl<'a> BorderStyle<'a> for $T { const NW: &'static str = $nw; const N: &'static str = $n; const NE: &'static str = $ne; @@ -47,7 +49,7 @@ macro_rules! border { } #[derive(Copy, Clone)] pub struct $T(pub bool, pub Style); //impl Layout for $T {} - impl Draw for $T { + impl<'a> Draw<'a, Tui> for $T { fn draw (&self, to: &mut Tui) -> Perhaps> { when(self.enabled(), draw(|to: &mut Tui|BorderStyle::draw(*self, to).map(Some))).draw(to) } @@ -161,7 +163,7 @@ border! { } } -pub trait BorderStyle: Draw + Copy { +pub trait BorderStyle<'a>: Draw<'a, Tui> + Copy { fn enabled (&self) -> bool; fn border_n (&self) -> &str { Self::N } fn border_s (&self) -> &str { Self::S } @@ -172,7 +174,7 @@ pub trait BorderStyle: Draw + Copy { fn border_sw (&self) -> &str { Self::SW } fn border_se (&self) -> &str { Self::SE } - #[inline] fn draw <'a> (self, to: &mut Tui) -> Usually> { + #[inline] fn draw (self, to: &mut Tui) -> Usually> { if self.enabled() { self.draw_h(to, None)?; self.draw_v(to, None)?; diff --git a/src/term/keys.rs b/src/term/keys.rs index f4ab04e..ace0cf6 100644 --- a/src/term/keys.rs +++ b/src/term/keys.rs @@ -1,4 +1,4 @@ -use ::dizzle::{Language, Symbol, Usually}; +use ::dizzle::*; use ::crossterm::event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState}; /// TUI key spec. @@ -70,7 +70,7 @@ impl TuiKey { } #[cfg(feature = "lang")] - pub fn from_dsl (dsl: impl Language) -> Usually { + pub fn from_dsl <'a> (dsl: &'a impl Language<'a>) -> UsuallyRef<'a, Self> { if let Some(word) = dsl.word()? { let word = word.trim(); Ok(if word == ":char" { diff --git a/src/term/modify.rs b/src/term/modify.rs index 9542452..0ba0c37 100644 --- a/src/term/modify.rs +++ b/src/term/modify.rs @@ -2,36 +2,30 @@ use crate::*; use Color::*; fn_kw_layout_tui!(kw_tui_fg |state, output, expr| { + let thunk = draw(move|screen|ok_flat(expr.nth(2)?.map(|x: &'a str|state.interpret(screen, x)))); Ok(matches!(expr.head()?, Some("fg")).then(||{ - let args = expr.tail(); - let arg0 = args.head(); - let tail0 = args.tail(); - let arg1 = tail0.head(); - if let Some(color) = state.namespace(arg0?.expect("fg: expected arg 0 (color)"))? { - fg(color, draw(move|to: &mut Tui|state.interpret(to, &arg1))).draw(output) + if let Some(color) = state.namespace(expr.nth(1)?.expect("fg: expected arg 0 (color)"))? { + fg(color, thunk).draw(output) } else { - return Err(format!("fg: {arg0:?}: not a color").into()) + return Err(format!("fg: {:?}: not a color", expr.nth(1)).into()) } }).transpose()?.flatten()) }); fn_kw_layout_tui!(kw_tui_bg |state, output, expr| { + let thunk = draw(move|screen|ok_flat(expr.nth(2)?.map(|x: &'a str|state.interpret(screen, x)))); Ok(matches!(expr.head()?, Some("bg")).then(||{ - let args = expr.tail(); - let arg0 = args.head(); - let tail0 = args.tail(); - let arg1 = tail0.head(); - if let Some(color) = state.namespace(arg0?.expect("bg: expected arg 0 (color)"))? { - bg(color, draw(move|to: &mut Tui|state.interpret(to, &arg1))).draw(output) + if let Some(color) = state.namespace(expr.nth(1)?.expect("bg: expected arg 0 (color)"))? { + bg(color, thunk).draw(output) } else { - return Err(format!("bg: {arg0:?}: not a color").into()) + return Err(format!("bg: {:?}: not a color", expr.nth(1)?).into()) } }).transpose()?.flatten()) }); impl Tui { - pub fn eval_color_expr (state: &impl Namespace, src: impl Language) - -> Perhaps + pub fn eval_color_expr <'a> (state: &impl Namespace, src: &'a impl Language<'a>) + -> Result, Box> { if let Some(expr) = src.expr()? { match (expr.head()?, expr.tail()?) { @@ -63,7 +57,9 @@ impl Tui { } /// Apply foreground color. -pub const fn fg (fg: Color, item: impl Draw) -> impl Draw { +pub const fn fg <'a> (fg: Color, item: impl Draw<'a, Tui>) + -> impl Draw<'a, Tui> +{ draw(move|to: &mut Tui|{ if let Some(size) = to.size(None, &item)? { to.draw(Some(size), draw(|to: &mut Tui|{ @@ -77,7 +73,9 @@ pub const fn fg (fg: Color, item: impl Draw) -> impl Draw { } /// Apply background color. -pub const fn bg (bg: Color, item: impl Draw) -> impl Draw { +pub const fn bg <'a> (bg: Color, item: impl Draw<'a, Tui>) + -> impl Draw<'a, Tui> +{ draw(move|to: &mut Tui|{ if let Some(size) = to.size(None, &item)? { let _ = to.draw(Some(size), draw(|to: &mut Tui|{ @@ -90,7 +88,9 @@ pub const fn bg (bg: Color, item: impl Draw) -> impl Draw { }) } -pub const fn fg_bg (fg: Color, bg: Color, item: impl Draw) -> impl Draw { +pub const fn fg_bg <'a> (fg: Color, bg: Color, item: impl Draw<'a, Tui>) + -> impl Draw<'a, Tui> +{ draw(move|to: &mut Tui|{ if let Some(size) = to.size(None, &item)? { let _ = to.draw(Some(size), draw(|to: &mut Tui|{ @@ -104,14 +104,16 @@ pub const fn fg_bg (fg: Color, bg: Color, item: impl Draw) -> impl Draw) -> impl Draw { +pub const fn modify <'a> (on: bool, modifier: Modifier, item: impl Draw<'a, Tui>) + -> impl Draw<'a, Tui> +{ draw(move|to: &mut Tui|{ fill_mod(on, modifier).draw(to)?; item.draw(to) }) } -pub const fn fill_mod (on: bool, modifier: Modifier) -> impl Draw { +pub const fn fill_mod <'a> (on: bool, modifier: Modifier) -> impl Draw<'a, Tui> { draw(move|to: &mut Tui|Ok(Some({ if on { to.update(&|cell,_,_|cell.modifier.insert(modifier)) @@ -122,11 +124,11 @@ pub const fn fill_mod (on: bool, modifier: Modifier) -> impl Draw { } /// Draw contents with bold modifier applied. -pub const fn bold (on: bool, item: impl Draw) -> impl Draw { +pub const fn bold <'a> (on: bool, item: impl Draw<'a, Tui>) -> impl Draw<'a, Tui> { modify(on, Modifier::BOLD, item) } -pub const fn fill_ul (color: Option) -> impl Draw { +pub const fn fill_ul <'a> (color: Option) -> impl Draw<'a, Tui> { draw(move|to: &mut Tui|Ok(Some(if let Some(color) = color { to.update(&|cell,_,_|{ cell.modifier.insert(Modifier::UNDERLINED); diff --git a/src/term/phat.rs b/src/term/phat.rs index c430939..e494a20 100644 --- a/src/term/phat.rs +++ b/src/term/phat.rs @@ -5,7 +5,9 @@ use crate::*; /// ``` /// /// TODO /// ``` -pub fn phat (w: u16, h: u16, [fg, bg, hi, lo]: [Color;4], draw: impl Draw) -> impl Draw { +pub fn phat <'a> ( + w: u16, h: u16, [fg, bg, hi, lo]: [Color;4], draw: impl Draw<'a, Tui> +) -> impl Draw<'a, Tui> { let top = phat_lo(bg, hi).exact_h(1); let low = phat_hi(bg, lo).exact_h(1); let draw = fg_bg(fg, bg, draw); @@ -17,11 +19,11 @@ pub const LO: &'static str = "▄"; pub const HI: &'static str = "▀"; /// A phat line -fn phat_lo (fg: Color, bg: Color) -> impl Draw { +fn phat_lo <'a> (fg: Color, bg: Color) -> impl Draw<'a, Tui> { fg_bg(fg, bg, x_repeat(LO)).exact_h(1) } /// A phat line -fn phat_hi (fg: Color, bg: Color) -> impl Draw { +fn phat_hi <'a> (fg: Color, bg: Color) -> impl Draw<'a, Tui> { fg_bg(fg, bg, x_repeat(HI)).exact_h(1) } diff --git a/src/term/scroll.rs b/src/term/scroll.rs index 0c1bf75..8dc16a8 100644 --- a/src/term/scroll.rs +++ b/src/term/scroll.rs @@ -6,7 +6,7 @@ pub const ICON_INC_V: &[char] = &['▼']; pub const ICON_DEC_H: &[char] = &[' ', '🞀', ' ']; pub const ICON_INC_H: &[char] = &[' ', '🞂', ' ']; -pub fn x_scroll () -> impl Draw { +pub fn x_scroll <'a> () -> impl Draw<'a, Tui> { draw(|to: &mut Tui|{ let XYWH(x1, y1, w, _h) = to.area(); let x2 = x1 + w; @@ -37,7 +37,7 @@ pub fn x_scroll () -> impl Draw { }) } -pub fn y_scroll () -> impl Draw { +pub fn y_scroll <'a> () -> impl Draw<'a, Tui> { draw(|to: &mut Tui|{ let XYWH(x1, y1, _w, h) = to.area(); let y2 = y1 + h;