#cast #derive #byte #bytes #casting #macro #binary

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.

2 releases

0.1.1 Apr 8, 2021
0.1.0 Jan 15, 2021
Download history 317/week @ 2021-10-05 530/week @ 2021-10-12 534/week @ 2021-10-19 316/week @ 2021-10-26 264/week @ 2021-11-02 258/week @ 2021-11-09 237/week @ 2021-11-16 340/week @ 2021-11-23 352/week @ 2021-11-30 556/week @ 2021-12-07 400/week @ 2021-12-14 236/week @ 2021-12-21 139/week @ 2021-12-28 354/week @ 2022-01-04 304/week @ 2022-01-11 344/week @ 2022-01-18

1,156 downloads per month
Used in bytes-cast

Zlib OR Apache-2.0 OR MIT

7KB
70 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

~280–700KB
~17K SLoC