#byte #binary-data #structs #procedural #structured #safety #derive

macro bytes-cast-derive

Safely re-interpreting &[u8] bytes as custom structs without copying, for efficiently reading structured binary data. Procedural macro for compile-time soundness checking.

4 releases

0.2.0 Jan 10, 2023
0.1.2 Jan 10, 2023
0.1.1 Apr 8, 2021
0.1.0 Jan 15, 2021

#84 in #safety

Download history 303/week @ 2023-12-18 50/week @ 2023-12-25 158/week @ 2024-01-01 208/week @ 2024-01-08 243/week @ 2024-01-15 405/week @ 2024-01-22 227/week @ 2024-01-29 249/week @ 2024-02-05 370/week @ 2024-02-12 617/week @ 2024-02-19 462/week @ 2024-02-26 259/week @ 2024-03-04 344/week @ 2024-03-11 331/week @ 2024-03-18 405/week @ 2024-03-25 410/week @ 2024-04-01

1,520 downloads per month
Used in bytes-cast

Zlib OR Apache-2.0 OR MIT

7KB
71 lines

bytes-cast-derive

The #[derive(BytesCast)] procedural macro for the bytes-cast crate. This statically checks the safety invariants required of custom structs.

This crate contains code derived from https://github.com/Lokathor/bytemuck.

Dependencies

~1.5MB
~33K SLoC