I hope I'm not jumping the gun here. I've only dabbled with Rust so far, though I hope to do more. I do however, have a lot of experience dealing with endianness issues in C (I'm a Linux and qemu developer for powerpc hardware).
In short: is there some reason I'm missing that endianness is not handed in Rust using #repr? From all I can see it looks to me like the obvious and safe way to do it.
The long version:
This looks like a missed opportunity to avoid (another) ridiculously easy to mess up thing in C. The nightmare I've found there is looking at code and not easily knowing if that uint32_t variable or structure field has had the right byteswaps done to it yet or not. u32::to_be and similar methods imply the existence of (unmarked) "wrong endian" integers in Rust, which opens up exactly the same can of worms. I know from painful experience how often this results in bugs (to a good approximation every C program which deals with external data and has not been tested on both endians has endian bugs).
The discipline I use in C to (try to) handle this is to always and only do endian conversions at the point where you're accessing an external data source/sink: a shared memory buffer, a file, a network stream - anything which has defined byte-by-byte addressing. After all an integer that you can't safely add isn't really an integer - it's just a integer encoding some other data (in this case a different integer, or worse a possibly different integer). With C that confusion is kind of par for the course, but with Rust's better typing we should be able to do better.
When going directly from internal integers to a byte oriented stream, u32::to_be_bytes() and friends work well. I'm guessing to_be() etc are intended for use with shared structures - passed to a syscall or library, stored on disk as a unit, placed in a shared memory buffer etc., again anything with a fixed byte addressable representation. But as noted above it means holding a not-really-integer in a u32 at least for a time.
It would be possible to BigEndianU32 / LittleEndianU32 types and whatnot with methods to convert to/from u32 with the appropriate byteswaps. I think there may be some crates doing that, though not amongst the more popular and well documented ones AFAICT.
But really, the clue's in the name, endianness is not a property of an integer, it's a property of the in memory representation of that integer, so why not use Rust's #repr syntax to show that? You mark the endian in the shared structure you're using, and the compiler now handles all byteswapping for you.