Expand description
Procedural macros for deriving byte conversion traits.
This crate provides procedural macros for automatically implementing byte conversion traits and I/O support on types.
§Main Macros
-
#[derive(Byteable)]- Generates byte conversion traits and I/O support- Fixed-size structs →
IntoByteArray,FromByteArray(transmute-based) - Dynamic structs with
#[byteable(io_only)]→Readable,Writable(field I/O) - C-like enums →
IntoByteArray,TryFromByteArray(transmute-based) - Enums with variant fields →
Readable,Writable(stream I/O)
- Fixed-size structs →
-
#[derive(UnsafeByteableTransmute)]- Lower-level transmute-based implementation (rarely needed; normally use#[derive(Byteable)]instead)
Derive Macros§
- Byteable
- Derives byte conversion and I/O traits for structs and enums.
- Unsafe
Byteable Transmute - Derives byte conversion traits for a struct using
transmute.