#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 215/week @ 2024-01-25 224/week @ 2024-02-01 338/week @ 2024-02-08 488/week @ 2024-02-15 604/week @ 2024-02-22 259/week @ 2024-02-29 293/week @ 2024-03-07 308/week @ 2024-03-14 428/week @ 2024-03-21 411/week @ 2024-03-28 282/week @ 2024-04-04 385/week @ 2024-04-11 170/week @ 2024-04-18 301/week @ 2024-04-25 276/week @ 2024-05-02 234/week @ 2024-05-09

1,031 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
~34K SLoC