endify

Crates.ioendify
lib.rsendify
version0.1.2
created_at2025-03-15 21:25:31.164878+00
updated_at2025-03-17 13:04:41.680718+00
descriptioneffortlessly convert structs between endian-formats.
homepage
repositoryhttps://github.com/hannahfluch/endify
max_upload_size
id1593906
size5,815
Hannah Fluch (hannahfluch)

documentation

README

endify

Effortlessly convert structs between endianess-formats.

Usage

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();
}
Commit count: 9

cargo fmt