#derive #cast #bytes

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
Download history 125/week @ 2023-10-28 373/week @ 2023-11-04 274/week @ 2023-11-11 274/week @ 2023-11-18 257/week @ 2023-11-25 419/week @ 2023-12-02 371/week @ 2023-12-09 348/week @ 2023-12-16 101/week @ 2023-12-23 160/week @ 2023-12-30 259/week @ 2024-01-06 259/week @ 2024-01-13 462/week @ 2024-01-20 266/week @ 2024-01-27 273/week @ 2024-02-03 418/week @ 2024-02-10

1,480 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