ioendian 0.1.4

Simple wrapper type to declaratively mark a struct as big-endian or little-endian. Useful for when doing #[repr(C)] transmutes from IO data.
Documentation
  • Coverage
  • 0%
    0 out of 13 items documented0 out of 10 items with examples
  • Size
  • Source code size: 5.11 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.44 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • eira-fransham

IOEndian

A tiny library to declaratively define endianness in a portable way, for IO. Allows an easy .native() method to convert to native endianness.

Examples

struct SomeStruct {
    first: Big<u16>,
    second: Big<i32>,
}

let foo = SomeStruct {
    first: Big([2, 1]),
    second: Big([2, 1, 1, 1]),
};

assert_eq!(foo.first.native() + foo.second.native(), 513 + 33_620_225)