Repo of no-std crates for my personal embedded projects

Add configuration of static byte strings

+346 -117
+283 -109
Cargo.lock
··· 28 28 29 29 [[package]] 30 30 name = "anyhow" 31 - version = "1.0.100" 31 + version = "1.0.102" 32 32 source = "registry+https://github.com/rust-lang/crates.io-index" 33 - checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" 33 + checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" 34 34 35 35 [[package]] 36 36 name = "autocfg" ··· 63 63 ] 64 64 65 65 [[package]] 66 + name = "base64ct" 67 + version = "1.8.3" 68 + source = "registry+https://github.com/rust-lang/crates.io-index" 69 + checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" 70 + 71 + [[package]] 66 72 name = "bitflags" 67 73 version = "1.3.2" 68 74 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 70 76 71 77 [[package]] 72 78 name = "bitflags" 73 - version = "2.10.0" 79 + version = "2.11.0" 74 80 source = "registry+https://github.com/rust-lang/crates.io-index" 75 - checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 81 + checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" 76 82 77 83 [[package]] 78 84 name = "block-buffer" ··· 91 97 92 98 [[package]] 93 99 name = "bytes" 94 - version = "1.11.0" 100 + version = "1.11.1" 95 101 source = "registry+https://github.com/rust-lang/crates.io-index" 96 - checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" 102 + checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" 97 103 dependencies = [ 98 104 "portable-atomic", 99 105 ] ··· 106 112 107 113 [[package]] 108 114 name = "cc" 109 - version = "1.2.51" 115 + version = "1.2.56" 110 116 source = "registry+https://github.com/rust-lang/crates.io-index" 111 - checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" 117 + checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" 112 118 dependencies = [ 113 119 "find-msvc-tools", 114 120 "shlex", ··· 234 240 source = "registry+https://github.com/rust-lang/crates.io-index" 235 241 checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" 236 242 dependencies = [ 237 - "thiserror 2.0.17", 243 + "thiserror 2.0.18", 238 244 ] 239 245 240 246 [[package]] ··· 462 468 463 469 [[package]] 464 470 name = "find-msvc-tools" 465 - version = "0.1.6" 471 + version = "0.1.9" 466 472 source = "registry+https://github.com/rust-lang/crates.io-index" 467 - checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" 473 + checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" 468 474 469 475 [[package]] 470 476 name = "fixedbitset" ··· 479 485 checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 480 486 481 487 [[package]] 488 + name = "foldhash" 489 + version = "0.1.5" 490 + source = "registry+https://github.com/rust-lang/crates.io-index" 491 + checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" 492 + 493 + [[package]] 482 494 name = "futures-core" 483 - version = "0.3.31" 495 + version = "0.3.32" 484 496 source = "registry+https://github.com/rust-lang/crates.io-index" 485 - checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 497 + checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" 486 498 487 499 [[package]] 488 500 name = "futures-sink" 489 - version = "0.3.31" 501 + version = "0.3.32" 490 502 source = "registry+https://github.com/rust-lang/crates.io-index" 491 - checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 503 + checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" 492 504 493 505 [[package]] 494 506 name = "generic-array" ··· 502 514 503 515 [[package]] 504 516 name = "getrandom" 505 - version = "0.3.4" 517 + version = "0.4.2" 506 518 source = "registry+https://github.com/rust-lang/crates.io-index" 507 - checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" 519 + checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" 508 520 dependencies = [ 509 521 "cfg-if", 510 522 "libc", 511 523 "r-efi", 512 524 "wasip2", 525 + "wasip3", 513 526 ] 514 527 515 528 [[package]] ··· 524 537 source = "registry+https://github.com/rust-lang/crates.io-index" 525 538 checksum = "09831ec59b80be69e75d29cf36e16afbbe5fd1af9c1bf4689ad91c77db5aa6a6" 526 539 dependencies = [ 527 - "bitflags 2.10.0", 540 + "bitflags 2.11.0", 528 541 "libc", 529 542 "nix 0.27.1", 530 543 ] ··· 542 555 "pest_derive", 543 556 "serde", 544 557 "serde_json", 545 - "thiserror 2.0.17", 558 + "thiserror 2.0.18", 546 559 ] 547 560 548 561 [[package]] ··· 552 565 checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" 553 566 dependencies = [ 554 567 "byteorder", 568 + ] 569 + 570 + [[package]] 571 + name = "hashbrown" 572 + version = "0.15.5" 573 + source = "registry+https://github.com/rust-lang/crates.io-index" 574 + checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" 575 + dependencies = [ 576 + "foldhash", 555 577 ] 556 578 557 579 [[package]] ··· 602 624 source = "registry+https://github.com/rust-lang/crates.io-index" 603 625 checksum = "9b940f7497c4f95b863b21cd34c3737b53a67d80d94cf29055d7f7eeca6ffdb4" 604 626 dependencies = [ 605 - "bitflags 2.10.0", 627 + "bitflags 2.11.0", 606 628 "byteorder", 607 629 "libc", 608 630 "nix 0.26.4", 609 631 ] 610 632 611 633 [[package]] 634 + name = "id-arena" 635 + version = "2.3.0" 636 + source = "registry+https://github.com/rust-lang/crates.io-index" 637 + checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" 638 + 639 + [[package]] 612 640 name = "ident_case" 613 641 version = "1.0.1" 614 642 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 616 644 617 645 [[package]] 618 646 name = "indexmap" 619 - version = "2.12.1" 647 + version = "2.13.0" 620 648 source = "registry+https://github.com/rust-lang/crates.io-index" 621 - checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" 649 + checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" 622 650 dependencies = [ 623 651 "equivalent", 624 - "hashbrown", 652 + "hashbrown 0.16.1", 653 + "serde", 654 + "serde_core", 625 655 ] 626 656 627 657 [[package]] ··· 657 687 658 688 [[package]] 659 689 name = "jiff" 660 - version = "0.2.18" 690 + version = "0.2.23" 661 691 source = "registry+https://github.com/rust-lang/crates.io-index" 662 - checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50" 692 + checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" 663 693 dependencies = [ 664 694 "jiff-static", 665 695 "portable-atomic", ··· 668 698 669 699 [[package]] 670 700 name = "jiff-static" 671 - version = "0.2.18" 701 + version = "0.2.23" 672 702 source = "registry+https://github.com/rust-lang/crates.io-index" 673 - checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78" 703 + checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" 674 704 dependencies = [ 675 705 "proc-macro2", 676 706 "quote", ··· 678 708 ] 679 709 680 710 [[package]] 711 + name = "leb128fmt" 712 + version = "0.1.0" 713 + source = "registry+https://github.com/rust-lang/crates.io-index" 714 + checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" 715 + 716 + [[package]] 681 717 name = "libc" 682 - version = "0.2.179" 718 + version = "0.2.182" 683 719 source = "registry+https://github.com/rust-lang/crates.io-index" 684 - checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" 720 + checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" 685 721 686 722 [[package]] 687 723 name = "libm" 688 - version = "0.2.15" 724 + version = "0.2.16" 689 725 source = "registry+https://github.com/rust-lang/crates.io-index" 690 - checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" 726 + checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" 691 727 692 728 [[package]] 693 729 name = "linux-embedded-hal" ··· 715 751 716 752 [[package]] 717 753 name = "linux-raw-sys" 718 - version = "0.11.0" 754 + version = "0.12.1" 719 755 source = "registry+https://github.com/rust-lang/crates.io-index" 720 - checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" 756 + checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" 721 757 722 758 [[package]] 723 759 name = "litrs" ··· 748 784 749 785 [[package]] 750 786 name = "memchr" 751 - version = "2.7.6" 787 + version = "2.8.0" 752 788 source = "registry+https://github.com/rust-lang/crates.io-index" 753 - checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" 789 + checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" 754 790 755 791 [[package]] 756 792 name = "memoffset" ··· 862 898 source = "registry+https://github.com/rust-lang/crates.io-index" 863 899 checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" 864 900 dependencies = [ 865 - "bitflags 2.10.0", 901 + "bitflags 2.11.0", 866 902 "cfg-if", 867 903 "libc", 868 904 ] ··· 919 955 920 956 [[package]] 921 957 name = "owo-colors" 922 - version = "4.2.3" 958 + version = "4.3.0" 923 959 source = "registry+https://github.com/rust-lang/crates.io-index" 924 - checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" 960 + checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" 925 961 926 962 [[package]] 927 963 name = "pest" 928 - version = "2.8.5" 964 + version = "2.8.6" 929 965 source = "registry+https://github.com/rust-lang/crates.io-index" 930 - checksum = "2c9eb05c21a464ea704b53158d358a31e6425db2f63a1a7312268b05fe2b75f7" 966 + checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" 931 967 dependencies = [ 932 968 "memchr", 933 969 "ucd-trie", ··· 935 971 936 972 [[package]] 937 973 name = "pest_derive" 938 - version = "2.8.5" 974 + version = "2.8.6" 939 975 source = "registry+https://github.com/rust-lang/crates.io-index" 940 - checksum = "68f9dbced329c441fa79d80472764b1a2c7e57123553b8519b36663a2fb234ed" 976 + checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" 941 977 dependencies = [ 942 978 "pest", 943 979 "pest_generator", ··· 945 981 946 982 [[package]] 947 983 name = "pest_generator" 948 - version = "2.8.5" 984 + version = "2.8.6" 949 985 source = "registry+https://github.com/rust-lang/crates.io-index" 950 - checksum = "3bb96d5051a78f44f43c8f712d8e810adb0ebf923fc9ed2655a7f66f63ba8ee5" 986 + checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" 951 987 dependencies = [ 952 988 "pest", 953 989 "pest_meta", ··· 958 994 959 995 [[package]] 960 996 name = "pest_meta" 961 - version = "2.8.5" 997 + version = "2.8.6" 962 998 source = "registry+https://github.com/rust-lang/crates.io-index" 963 - checksum = "602113b5b5e8621770cfd490cfd90b9f84ab29bd2b0e49ad83eb6d186cef2365" 999 + checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" 964 1000 dependencies = [ 965 1001 "pest", 966 1002 "sha2", ··· 968 1004 969 1005 [[package]] 970 1006 name = "petgraph" 971 - version = "0.7.1" 1007 + version = "0.8.3" 972 1008 source = "registry+https://github.com/rust-lang/crates.io-index" 973 - checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" 1009 + checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" 974 1010 dependencies = [ 975 1011 "fixedbitset", 1012 + "hashbrown 0.15.5", 976 1013 "indexmap", 977 1014 ] 978 1015 ··· 984 1021 985 1022 [[package]] 986 1023 name = "portable-atomic" 987 - version = "1.13.0" 1024 + version = "1.13.1" 988 1025 source = "registry+https://github.com/rust-lang/crates.io-index" 989 - checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" 1026 + checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" 990 1027 991 1028 [[package]] 992 1029 name = "portable-atomic-util" 993 - version = "0.2.4" 1030 + version = "0.2.5" 994 1031 source = "registry+https://github.com/rust-lang/crates.io-index" 995 - checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" 1032 + checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" 996 1033 dependencies = [ 997 1034 "portable-atomic", 998 1035 ] ··· 1031 1068 1032 1069 [[package]] 1033 1070 name = "proc-macro2" 1034 - version = "1.0.105" 1071 + version = "1.0.106" 1035 1072 source = "registry+https://github.com/rust-lang/crates.io-index" 1036 - checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" 1073 + checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" 1037 1074 dependencies = [ 1038 1075 "unicode-ident", 1039 1076 ] 1040 1077 1041 1078 [[package]] 1042 1079 name = "prost" 1043 - version = "0.14.1" 1080 + version = "0.14.3" 1044 1081 source = "registry+https://github.com/rust-lang/crates.io-index" 1045 - checksum = "7231bd9b3d3d33c86b58adbac74b5ec0ad9f496b19d22801d773636feaa95f3d" 1082 + checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" 1046 1083 dependencies = [ 1047 1084 "bytes", 1048 1085 "prost-derive", ··· 1050 1087 1051 1088 [[package]] 1052 1089 name = "prost-build" 1053 - version = "0.14.1" 1090 + version = "0.14.3" 1054 1091 source = "registry+https://github.com/rust-lang/crates.io-index" 1055 - checksum = "ac6c3320f9abac597dcbc668774ef006702672474aad53c6d596b62e487b40b1" 1092 + checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" 1056 1093 dependencies = [ 1057 1094 "heck", 1058 1095 "itertools", 1059 1096 "log", 1060 1097 "multimap", 1061 - "once_cell", 1062 1098 "petgraph", 1063 1099 "prettyplease", 1064 1100 "prost", ··· 1070 1106 1071 1107 [[package]] 1072 1108 name = "prost-derive" 1073 - version = "0.14.1" 1109 + version = "0.14.3" 1074 1110 source = "registry+https://github.com/rust-lang/crates.io-index" 1075 - checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" 1111 + checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" 1076 1112 dependencies = [ 1077 1113 "anyhow", 1078 1114 "itertools", ··· 1083 1119 1084 1120 [[package]] 1085 1121 name = "prost-types" 1086 - version = "0.14.1" 1122 + version = "0.14.3" 1087 1123 source = "registry+https://github.com/rust-lang/crates.io-index" 1088 - checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" 1124 + checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" 1089 1125 dependencies = [ 1090 1126 "prost", 1091 1127 ] ··· 1128 1164 1129 1165 [[package]] 1130 1166 name = "quote" 1131 - version = "1.0.43" 1167 + version = "1.0.45" 1132 1168 source = "registry+https://github.com/rust-lang/crates.io-index" 1133 - checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" 1169 + checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" 1134 1170 dependencies = [ 1135 1171 "proc-macro2", 1136 1172 ] 1137 1173 1138 1174 [[package]] 1139 1175 name = "r-efi" 1140 - version = "5.3.0" 1176 + version = "6.0.0" 1141 1177 source = "registry+https://github.com/rust-lang/crates.io-index" 1142 - checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 1178 + checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" 1143 1179 1144 1180 [[package]] 1145 1181 name = "regex" 1146 - version = "1.12.2" 1182 + version = "1.12.3" 1147 1183 source = "registry+https://github.com/rust-lang/crates.io-index" 1148 - checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" 1184 + checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" 1149 1185 dependencies = [ 1150 1186 "aho-corasick", 1151 1187 "memchr", ··· 1155 1191 1156 1192 [[package]] 1157 1193 name = "regex-automata" 1158 - version = "0.4.13" 1194 + version = "0.4.14" 1159 1195 source = "registry+https://github.com/rust-lang/crates.io-index" 1160 - checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" 1196 + checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" 1161 1197 dependencies = [ 1162 1198 "aho-corasick", 1163 1199 "memchr", ··· 1166 1202 1167 1203 [[package]] 1168 1204 name = "regex-syntax" 1169 - version = "0.8.8" 1205 + version = "0.8.10" 1170 1206 source = "registry+https://github.com/rust-lang/crates.io-index" 1171 - checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" 1207 + checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" 1172 1208 1173 1209 [[package]] 1174 1210 name = "rustc-demangle" 1175 - version = "0.1.26" 1211 + version = "0.1.27" 1176 1212 source = "registry+https://github.com/rust-lang/crates.io-index" 1177 - checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" 1213 + checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" 1178 1214 1179 1215 [[package]] 1180 1216 name = "rustix" ··· 1182 1218 source = "registry+https://github.com/rust-lang/crates.io-index" 1183 1219 checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" 1184 1220 dependencies = [ 1185 - "bitflags 2.10.0", 1221 + "bitflags 2.11.0", 1186 1222 "errno", 1187 1223 "libc", 1188 1224 "linux-raw-sys 0.4.15", ··· 1191 1227 1192 1228 [[package]] 1193 1229 name = "rustix" 1194 - version = "1.1.3" 1230 + version = "1.1.4" 1195 1231 source = "registry+https://github.com/rust-lang/crates.io-index" 1196 - checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" 1232 + checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" 1197 1233 dependencies = [ 1198 - "bitflags 2.10.0", 1234 + "bitflags 2.11.0", 1199 1235 "errno", 1200 1236 "libc", 1201 - "linux-raw-sys 0.11.0", 1237 + "linux-raw-sys 0.12.1", 1202 1238 "windows-sys 0.61.2", 1203 1239 ] 1204 1240 ··· 1219 1255 name = "sachy-config" 1220 1256 version = "0.1.0" 1221 1257 dependencies = [ 1258 + "base64ct", 1222 1259 "miette", 1223 1260 "toml_edit", 1224 1261 ] ··· 1241 1278 "protobuf", 1242 1279 "protobuf-parse", 1243 1280 "serde", 1244 - "thiserror 2.0.17", 1281 + "thiserror 2.0.18", 1245 1282 ] 1246 1283 1247 1284 [[package]] ··· 1294 1331 checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1295 1332 1296 1333 [[package]] 1334 + name = "semver" 1335 + version = "1.0.27" 1336 + source = "registry+https://github.com/rust-lang/crates.io-index" 1337 + checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" 1338 + 1339 + [[package]] 1297 1340 name = "serde" 1298 1341 version = "1.0.228" 1299 1342 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1342 1385 source = "registry+https://github.com/rust-lang/crates.io-index" 1343 1386 checksum = "2acaf3f973e8616d7ceac415f53fc60e190b2a686fbcf8d27d0256c741c5007b" 1344 1387 dependencies = [ 1345 - "bitflags 2.10.0", 1388 + "bitflags 2.11.0", 1346 1389 "cfg-if", 1347 1390 "core-foundation", 1348 1391 "core-foundation-sys", ··· 1390 1433 source = "registry+https://github.com/rust-lang/crates.io-index" 1391 1434 checksum = "32dadd0a877f0652fa52dbc4d2ed9f4877bea5cd30725507b36e1970a5ef0519" 1392 1435 dependencies = [ 1393 - "bitflags 2.10.0", 1436 + "bitflags 2.11.0", 1394 1437 "libc", 1395 1438 "nix 0.26.4", 1396 1439 ] ··· 1430 1473 1431 1474 [[package]] 1432 1475 name = "syn" 1433 - version = "2.0.114" 1476 + version = "2.0.117" 1434 1477 source = "registry+https://github.com/rust-lang/crates.io-index" 1435 - checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" 1478 + checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" 1436 1479 dependencies = [ 1437 1480 "proc-macro2", 1438 1481 "quote", ··· 1450 1493 1451 1494 [[package]] 1452 1495 name = "tempfile" 1453 - version = "3.24.0" 1496 + version = "3.26.0" 1454 1497 source = "registry+https://github.com/rust-lang/crates.io-index" 1455 - checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" 1498 + checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" 1456 1499 dependencies = [ 1457 1500 "fastrand", 1458 1501 "getrandom", 1459 1502 "once_cell", 1460 - "rustix 1.1.3", 1503 + "rustix 1.1.4", 1461 1504 "windows-sys 0.61.2", 1462 1505 ] 1463 1506 ··· 1467 1510 source = "registry+https://github.com/rust-lang/crates.io-index" 1468 1511 checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" 1469 1512 dependencies = [ 1470 - "rustix 1.1.3", 1513 + "rustix 1.1.4", 1471 1514 "windows-sys 0.60.2", 1472 1515 ] 1473 1516 ··· 1492 1535 1493 1536 [[package]] 1494 1537 name = "thiserror" 1495 - version = "2.0.17" 1538 + version = "2.0.18" 1496 1539 source = "registry+https://github.com/rust-lang/crates.io-index" 1497 - checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" 1540 + checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" 1498 1541 dependencies = [ 1499 - "thiserror-impl 2.0.17", 1542 + "thiserror-impl 2.0.18", 1500 1543 ] 1501 1544 1502 1545 [[package]] ··· 1512 1555 1513 1556 [[package]] 1514 1557 name = "thiserror-impl" 1515 - version = "2.0.17" 1558 + version = "2.0.18" 1516 1559 source = "registry+https://github.com/rust-lang/crates.io-index" 1517 - checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" 1560 + checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" 1518 1561 dependencies = [ 1519 1562 "proc-macro2", 1520 1563 "quote", ··· 1523 1566 1524 1567 [[package]] 1525 1568 name = "toml_datetime" 1526 - version = "0.7.5+spec-1.1.0" 1569 + version = "1.0.0+spec-1.1.0" 1527 1570 source = "registry+https://github.com/rust-lang/crates.io-index" 1528 - checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" 1571 + checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e" 1529 1572 dependencies = [ 1530 1573 "serde_core", 1531 1574 ] 1532 1575 1533 1576 [[package]] 1534 1577 name = "toml_edit" 1535 - version = "0.24.0+spec-1.1.0" 1578 + version = "0.25.4+spec-1.1.0" 1536 1579 source = "registry+https://github.com/rust-lang/crates.io-index" 1537 - checksum = "8c740b185920170a6d9191122cafef7010bd6270a3824594bff6784c04d7f09e" 1580 + checksum = "7193cbd0ce53dc966037f54351dbbcf0d5a642c7f0038c382ef9e677ce8c13f2" 1538 1581 dependencies = [ 1539 1582 "indexmap", 1540 1583 "toml_datetime", ··· 1545 1588 1546 1589 [[package]] 1547 1590 name = "toml_parser" 1548 - version = "1.0.6+spec-1.1.0" 1591 + version = "1.0.9+spec-1.1.0" 1549 1592 source = "registry+https://github.com/rust-lang/crates.io-index" 1550 - checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" 1593 + checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" 1551 1594 dependencies = [ 1552 1595 "winnow", 1553 1596 ] ··· 1576 1619 source = "registry+https://github.com/rust-lang/crates.io-index" 1577 1620 checksum = "4064ed685c487dbc25bd3f0e9548f2e34bab9d18cefc700f9ec2dba74ba1138e" 1578 1621 dependencies = [ 1579 - "thiserror 2.0.17", 1622 + "thiserror 2.0.18", 1580 1623 ] 1581 1624 1582 1625 [[package]] 1583 1626 name = "unicode-ident" 1584 - version = "1.0.22" 1627 + version = "1.0.24" 1585 1628 source = "registry+https://github.com/rust-lang/crates.io-index" 1586 - checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 1629 + checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" 1587 1630 1588 1631 [[package]] 1589 1632 name = "unicode-linebreak" ··· 1604 1647 checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" 1605 1648 1606 1649 [[package]] 1650 + name = "unicode-xid" 1651 + version = "0.2.6" 1652 + source = "registry+https://github.com/rust-lang/crates.io-index" 1653 + checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 1654 + 1655 + [[package]] 1607 1656 name = "version_check" 1608 1657 version = "0.9.5" 1609 1658 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1617 1666 1618 1667 [[package]] 1619 1668 name = "wasip2" 1620 - version = "1.0.1+wasi-0.2.4" 1669 + version = "1.0.2+wasi-0.2.9" 1670 + source = "registry+https://github.com/rust-lang/crates.io-index" 1671 + checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" 1672 + dependencies = [ 1673 + "wit-bindgen", 1674 + ] 1675 + 1676 + [[package]] 1677 + name = "wasip3" 1678 + version = "0.4.0+wasi-0.3.0-rc-2026-01-06" 1621 1679 source = "registry+https://github.com/rust-lang/crates.io-index" 1622 - checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" 1680 + checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" 1623 1681 dependencies = [ 1624 1682 "wit-bindgen", 1625 1683 ] 1626 1684 1627 1685 [[package]] 1686 + name = "wasm-encoder" 1687 + version = "0.244.0" 1688 + source = "registry+https://github.com/rust-lang/crates.io-index" 1689 + checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" 1690 + dependencies = [ 1691 + "leb128fmt", 1692 + "wasmparser", 1693 + ] 1694 + 1695 + [[package]] 1696 + name = "wasm-metadata" 1697 + version = "0.244.0" 1698 + source = "registry+https://github.com/rust-lang/crates.io-index" 1699 + checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" 1700 + dependencies = [ 1701 + "anyhow", 1702 + "indexmap", 1703 + "wasm-encoder", 1704 + "wasmparser", 1705 + ] 1706 + 1707 + [[package]] 1708 + name = "wasmparser" 1709 + version = "0.244.0" 1710 + source = "registry+https://github.com/rust-lang/crates.io-index" 1711 + checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" 1712 + dependencies = [ 1713 + "bitflags 2.11.0", 1714 + "hashbrown 0.15.5", 1715 + "indexmap", 1716 + "semver", 1717 + ] 1718 + 1719 + [[package]] 1628 1720 name = "which" 1629 1721 version = "4.4.2" 1630 1722 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1831 1923 1832 1924 [[package]] 1833 1925 name = "wit-bindgen" 1834 - version = "0.46.0" 1926 + version = "0.51.0" 1927 + source = "registry+https://github.com/rust-lang/crates.io-index" 1928 + checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" 1929 + dependencies = [ 1930 + "wit-bindgen-rust-macro", 1931 + ] 1932 + 1933 + [[package]] 1934 + name = "wit-bindgen-core" 1935 + version = "0.51.0" 1936 + source = "registry+https://github.com/rust-lang/crates.io-index" 1937 + checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" 1938 + dependencies = [ 1939 + "anyhow", 1940 + "heck", 1941 + "wit-parser", 1942 + ] 1943 + 1944 + [[package]] 1945 + name = "wit-bindgen-rust" 1946 + version = "0.51.0" 1835 1947 source = "registry+https://github.com/rust-lang/crates.io-index" 1836 - checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" 1948 + checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" 1949 + dependencies = [ 1950 + "anyhow", 1951 + "heck", 1952 + "indexmap", 1953 + "prettyplease", 1954 + "syn", 1955 + "wasm-metadata", 1956 + "wit-bindgen-core", 1957 + "wit-component", 1958 + ] 1959 + 1960 + [[package]] 1961 + name = "wit-bindgen-rust-macro" 1962 + version = "0.51.0" 1963 + source = "registry+https://github.com/rust-lang/crates.io-index" 1964 + checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" 1965 + dependencies = [ 1966 + "anyhow", 1967 + "prettyplease", 1968 + "proc-macro2", 1969 + "quote", 1970 + "syn", 1971 + "wit-bindgen-core", 1972 + "wit-bindgen-rust", 1973 + ] 1974 + 1975 + [[package]] 1976 + name = "wit-component" 1977 + version = "0.244.0" 1978 + source = "registry+https://github.com/rust-lang/crates.io-index" 1979 + checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" 1980 + dependencies = [ 1981 + "anyhow", 1982 + "bitflags 2.11.0", 1983 + "indexmap", 1984 + "log", 1985 + "serde", 1986 + "serde_derive", 1987 + "serde_json", 1988 + "wasm-encoder", 1989 + "wasm-metadata", 1990 + "wasmparser", 1991 + "wit-parser", 1992 + ] 1993 + 1994 + [[package]] 1995 + name = "wit-parser" 1996 + version = "0.244.0" 1997 + source = "registry+https://github.com/rust-lang/crates.io-index" 1998 + checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" 1999 + dependencies = [ 2000 + "anyhow", 2001 + "id-arena", 2002 + "indexmap", 2003 + "log", 2004 + "semver", 2005 + "serde", 2006 + "serde_derive", 2007 + "serde_json", 2008 + "unicode-xid", 2009 + "wasmparser", 2010 + ] 1837 2011 1838 2012 [[package]] 1839 2013 name = "zmij" 1840 - version = "1.0.12" 2014 + version = "1.0.21" 1841 2015 source = "registry+https://github.com/rust-lang/crates.io-index" 1842 - checksum = "2fc5a66a20078bf1251bde995aa2fdcc4b800c70b5d92dd2c62abc5c60f679f8" 2016 + checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
+2 -1
sachy-config/Cargo.toml
··· 8 8 rust-version.workspace = true 9 9 10 10 [dependencies] 11 - toml_edit = "0.24.0" 11 + toml_edit = "0.25.0" 12 + base64ct = { version = "1.8", features = ["alloc"] } 12 13 miette = { version = "7", features = ["fancy"] }
+61 -7
sachy-config/src/lib.rs
··· 1 1 use core::{error::Error, fmt::Debug, str::FromStr}; 2 2 use std::io::Write; 3 3 4 + use base64ct::Encoding; 4 5 use miette::{Context, IntoDiagnostic, LabeledSpan, Result, bail, miette}; 5 6 use toml_edit::Value; 6 7 ··· 50 51 .into_iter() 51 52 .flat_map(|statics| statics.iter()) 52 53 .try_for_each(|(name, item)| -> miette::Result<()> { 53 - let value = item.as_str().ok_or_else(|| { 54 - miette!( 54 + if let Some(table) = item.as_inline_table() { 55 + let kind = table 56 + .get("kind") 57 + .ok_or_else(|| miette!("Missing kind property: @ {:?}", item.span()))?; 58 + let kind = kind.as_str().ok_or_else(|| { 59 + miette!( 60 + "{} is not a string value. Actual type: {} @ {:?}", 61 + name, 62 + kind.type_name(), 63 + item.span() 64 + ) 65 + })?; 66 + 67 + let value = table 68 + .get("value") 69 + .ok_or_else(|| miette!("Missing value property: @ {:?}", item.span()))?; 70 + let value = value.as_str().ok_or_else(|| { 71 + miette!( 72 + "{} is not a string value. Actual type: {} @ {:?}", 73 + name, 74 + item.type_name(), 75 + item.span() 76 + ) 77 + })?; 78 + 79 + match kind { 80 + "bytes" => { 81 + let decoded = base64ct::Base64::decode_vec(value).into_diagnostic()?; 82 + 83 + let byte_size = decoded.len(); 84 + 85 + let static_output = 86 + format!("pub static {name}: [u8; {byte_size}] = {decoded:?};\n"); 87 + output.push_str(&static_output); 88 + } 89 + "string" => { 90 + let static_output = format!("pub static {}: &str = \"{}\";\n", name, value); 91 + output.push_str(&static_output); 92 + } 93 + _ => { 94 + return Err(miette!( 95 + "{} is not a valid kind. Actual kind: {} @ {:?}", 96 + name, 97 + kind, 98 + item.span() 99 + )); 100 + } 101 + } 102 + 103 + Ok(()) 104 + } else if let Some(value) = item.as_value() { 105 + let static_output = format!("pub static {}: &str = {};\n", name, value); 106 + output.push_str(&static_output); 107 + Ok(()) 108 + } else { 109 + Err(miette!( 55 110 "{} is not a string value. Actual type: {} @ {:?}", 56 111 name, 57 112 item.type_name(), 58 113 item.span() 59 - ) 60 - })?; 61 - let static_output = format!("pub static {}: &str = \"{}\";\n", name, value); 62 - output.push_str(&static_output); 63 - Ok(()) 114 + )) 115 + } 64 116 })?; 65 117 66 118 config_doc ··· 130 182 VALUE = { type = "f32", value = "42.0" } 131 183 [statics] 132 184 EXAMPLE = "thing" 185 + BYTER = { kind = "bytes", value = "zXewhEPrD30=" } 133 186 "#; 134 187 let expected = r#"pub static EXAMPLE: &str = "thing"; 188 + pub static BYTER: [u8; 8] = [205, 119, 176, 132, 67, 235, 15, 125]; 135 189 pub const FIRST: u8 = 2; 136 190 pub const VALUE: f32 = 42.0; 137 191 "#;