compact binary serialization format with built-in compression

docs: clarify and correct some issues

also pin versions to at least minor, oops

kokirigla.de 1ff20e66 227dcf0c

verified
Changed files
+44 -30
.tangled
workflows
docs
+1 -1
.tangled/workflows/ci.yml
··· 17 17 - name: "Install rust toolchain" 18 18 command: "rustup install 1.89" 19 19 20 - # when changing these steps make sure `Justfile` remains in-sync 20 + # when changing these steps make sure `justfile` remains in-sync 21 21 - name: "Check (without default features)" 22 22 command: "cargo check --no-default-features" 23 23 - name: "Check"
+32 -21
Cargo.lock
··· 18 18 checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 19 19 20 20 [[package]] 21 - name = "android-tzdata" 22 - version = "0.1.1" 23 - source = "registry+https://github.com/rust-lang/crates.io-index" 24 - checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 25 - 26 - [[package]] 27 21 name = "android_system_properties" 28 22 version = "0.1.5" 29 23 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 97 91 98 92 [[package]] 99 93 name = "chrono" 100 - version = "0.4.41" 94 + version = "0.4.42" 101 95 source = "registry+https://github.com/rust-lang/crates.io-index" 102 - checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" 96 + checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" 103 97 dependencies = [ 104 - "android-tzdata", 105 98 "iana-time-zone", 106 99 "js-sys", 107 100 "num-traits", 108 101 "wasm-bindgen", 109 - "windows-link", 102 + "windows-link 0.2.0", 110 103 ] 111 104 112 105 [[package]] ··· 252 245 dependencies = [ 253 246 "equivalent", 254 247 "hashbrown", 248 + "serde", 255 249 ] 256 250 257 251 [[package]] 258 252 name = "insta" 259 - version = "1.43.1" 253 + version = "1.43.2" 260 254 source = "registry+https://github.com/rust-lang/crates.io-index" 261 - checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" 255 + checksum = "46fdb647ebde000f43b5b53f773c30cf9b0cb4300453208713fa38b2c70935a0" 262 256 dependencies = [ 263 257 "console", 264 258 "once_cell", ··· 372 366 373 367 [[package]] 374 368 name = "nbtree_core" 375 - version = "0.1.0" 369 + version = "0.2.0" 376 370 source = "registry+https://github.com/rust-lang/crates.io-index" 377 - checksum = "8b997801ac5ce31a845d736bfe838113079c3e56cff1ed498813e793c6c6959c" 371 + checksum = "d3734790c3fc67f9f086c8f1c694f8ce6c5f4fdc49f5a04a1e7f9b9a90e06ab6" 378 372 dependencies = [ 379 373 "byteorder", 380 374 "cesu8", 381 375 "indexmap", 382 376 "miette", 383 377 "num-traits", 378 + "serde", 384 379 "thiserror 2.0.15", 385 380 "unicode_names2", 386 381 ] ··· 524 519 525 520 [[package]] 526 521 name = "serde" 527 - version = "1.0.219" 522 + version = "1.0.228" 523 + source = "registry+https://github.com/rust-lang/crates.io-index" 524 + checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 525 + dependencies = [ 526 + "serde_core", 527 + "serde_derive", 528 + ] 529 + 530 + [[package]] 531 + name = "serde_core" 532 + version = "1.0.228" 528 533 source = "registry+https://github.com/rust-lang/crates.io-index" 529 - checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" 534 + checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 530 535 dependencies = [ 531 536 "serde_derive", 532 537 ] 533 538 534 539 [[package]] 535 540 name = "serde_derive" 536 - version = "1.0.219" 541 + version = "1.0.228" 537 542 source = "registry+https://github.com/rust-lang/crates.io-index" 538 - checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" 543 + checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 539 544 dependencies = [ 540 545 "proc-macro2", 541 546 "quote", ··· 808 813 dependencies = [ 809 814 "windows-implement", 810 815 "windows-interface", 811 - "windows-link", 816 + "windows-link 0.1.3", 812 817 "windows-result", 813 818 "windows-strings", 814 819 ] ··· 842 847 checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" 843 848 844 849 [[package]] 850 + name = "windows-link" 851 + version = "0.2.0" 852 + source = "registry+https://github.com/rust-lang/crates.io-index" 853 + checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" 854 + 855 + [[package]] 845 856 name = "windows-result" 846 857 version = "0.3.4" 847 858 source = "registry+https://github.com/rust-lang/crates.io-index" 848 859 checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" 849 860 dependencies = [ 850 - "windows-link", 861 + "windows-link 0.1.3", 851 862 ] 852 863 853 864 [[package]] ··· 856 867 source = "registry+https://github.com/rust-lang/crates.io-index" 857 868 checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" 858 869 dependencies = [ 859 - "windows-link", 870 + "windows-link 0.1.3", 860 871 ] 861 872 862 873 [[package]]
+5 -5
Cargo.toml
··· 12 12 resolver = "3" 13 13 14 14 [workspace.package] 15 - repository = "https://tangled.sh/@kokirigla.de/hateno" 15 + repository = "https://tangled.org/@did:plc:uthy5qqccx3hdwxo7sriplmh/hateno" 16 16 17 17 [dependencies] 18 18 chrono.workspace = true ··· 22 22 uuid.workspace = true 23 23 24 24 [workspace.dependencies] 25 - chrono = ">=0.4.20" 25 + chrono = "^0.4.20" 26 26 flate2 = "1.1" 27 27 insta = "1.43" 28 28 lz4 = "1.28" 29 - nbtree_core = "0.1" 30 - serde = "1" 31 - thiserror = "2" 29 + nbtree_core = "0.2" 30 + serde = "1.0" 31 + thiserror = "2.0" 32 32 uuid = "1.18" 33 33 34 34 [dev-dependencies]
Justfile justfile
+1 -1
README.md
··· 25 25 [hateno_convert]: https://crates.io/crates/hateno_convert 26 26 [hateno_serde]: https://crates.io/crates/hateno_serde 27 27 [serde]: https://serde.rs 28 - [spec]: https://tangled.sh/@kokirigla.de/hateno/blob/trunk/docs/SPECIFICATION.md 28 + [spec]: https://tangled.org/@did:plc:uthy5qqccx3hdwxo7sriplmh/hateno/blob/trunk/docs/SPECIFICATION.md
+5 -2
docs/SPECIFICATION.md
··· 60 60 - Unsigned integers: Standard binary representation 61 61 - Signed integers: Two's complement representation 62 62 - Floating-point: IEEE 754 standard (binary32 for f32, binary64 for f64) 63 - - Endianness: Determined by file header flags (see Section 4.2.4) 63 + - Endianness: Determined by file header flags (see Section 5.2.3) 64 64 65 65 <!-- TOC --><a name="22-string-encoding"></a> 66 66 ··· 183 183 ``` 184 184 [type_id: u8] [inner_type_id: u8] [discriminant: u8] [payload?] 185 185 ``` 186 + 187 + Note that the inner type ID is preserved so that type information is 188 + available even in case of a `None` value. 186 189 187 190 - `inner_type_id`: Type ID of the contained value 188 191 - `discriminant`: ··· 379 382 380 383 ``` 381 384 [0x48, 0x54, 0x4e, 0x4f] // Magic: "HTNO" 382 - [0x01] // Version: 2.1 385 + [0x01] // Version: 1.0 383 386 [0x00] // Flags: little-endian 384 387 [0x00] // Compression: none 385 388 [23, 0, 0, 0] // Payload length: 23 bytes