#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

#90 in #safety

Download history 366/week @ 2024-04-01 367/week @ 2024-04-08 247/week @ 2024-04-15 254/week @ 2024-04-22 267/week @ 2024-04-29 258/week @ 2024-05-06 250/week @ 2024-05-13 254/week @ 2024-05-20 139/week @ 2024-05-27 142/week @ 2024-06-03 344/week @ 2024-06-10 157/week @ 2024-06-17 189/week @ 2024-06-24 146/week @ 2024-07-01 284/week @ 2024-07-08 201/week @ 2024-07-15

842 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
~36K SLoC