| Crates.io | endify |
| lib.rs | endify |
| version | 0.1.2 |
| created_at | 2025-03-15 21:25:31.164878+00 |
| updated_at | 2025-03-17 13:04:41.680718+00 |
| description | effortlessly convert structs between endian-formats. |
| homepage | |
| repository | https://github.com/hannahfluch/endify |
| max_upload_size | |
| id | 1593906 |
| size | 5,815 |
Effortlessly convert structs between endianess-formats.
use endify::Endify;
#[repr(C)]
#[derive(Debug, Endify)]
struct MyStruct {
a: u32,
b: u16,
c: u8,
}
fn main() {
// stored on disk as `little-endian` format.
let my_struct = read_from_disk();
// convert all fields to `native-endian` format.
let my_struct_native = my_struct.from_le();
}