From a discussion on #rust-beginners there seems to be a need for ByteOrder implementation that dispatches to LE/BE based on runtime information.
Essentially something like this:
enum Endianess { Little, Big }
impl ByteOrder for Endianess {
// boilerplate methods with `match` that dispatch to LE or BE
}
let endianess = get_endianess_at_runtime();
endianess.read_i32(&some_bytes);
The byteorder docs don't seem to say that the crate is focused solely on static/type-level checking, so I'm guessing this would be in scope for the library.
Of course this isn't strictly necessary, as you can probably just write reading/writing code generically and simply move the LE/BE decision to a higher level, but it may simplify some use cases regardless.
From a discussion on
#rust-beginnersthere seems to be a need forByteOrderimplementation that dispatches to LE/BE based on runtime information.Essentially something like this:
The
byteorderdocs don't seem to say that the crate is focused solely on static/type-level checking, so I'm guessing this would be in scope for the library.Of course this isn't strictly necessary, as you can probably just write reading/writing code generically and simply move the
LE/BEdecision to a higher level, but it may simplify some use cases regardless.