Crate yael
"Yet another endianness library"
This library is intended for uses where the data is not deserialized but already in ROM/RAM.
The library is no_std, has no features and no dependencies.
The conversion is made explicit by calling new, get and set.
Default is provided because 0 is identical for both byte orders.
Debug is provided because it can be useful and is expected to not be fast.
Operations which do not depend on the byte order can be performed on integers: eq, and, or, xor, not.
But please note that a operation with a constant may be more efficient with getting the value
instead of wrapping the constant with new, though depending on the constant and cpu.
There are several similar libraries, but they all differ in a some points.
Some alternatives:
Examples
let chunk = Chunk ;
let chunk_size = chunk.size.get;
The #[repr(C)] is not required by the examples, but probably in many use cases.
Floating Point
The floating point types do not support bit operations because a float does not either.
Comparison is not supported because it would differ from how a float behaves.
(+0 == -0 float: equal, bits: different; nan == nan float: different, bits: equal)