Adding the concept of NetworkEndian.
NetworkEndian describes the byte order to use for network communication. Generally, this is always BigEndian.
This commit is contained in:
@ -22,6 +22,13 @@ pub type PlatformEndian = BigEndian;
|
||||
#[cfg(not(target_endian="big"))]
|
||||
pub type PlatformEndian = LittleEndian;
|
||||
|
||||
/// Referes to NetworkEndian. This could be either
|
||||
/// of the available endians as long as it is consistent
|
||||
/// across the network. However, RFC1700 decided network
|
||||
/// byte order would be BigEndian. As such, it is now the
|
||||
/// common endian style for networking.
|
||||
pub type NetworkEndian = BigEndian;
|
||||
|
||||
/// Handles serialization where the most
|
||||
/// significant byte is stored at the lowest address.
|
||||
pub enum BigEndian
|
||||
@ -48,7 +55,14 @@ pub enum Endianess
|
||||
/// Referes to PlatformEndian. This can be anyone
|
||||
/// of the other available endians depending on
|
||||
/// the platform you are on.
|
||||
Platform
|
||||
Platform,
|
||||
|
||||
/// Referes to NetworkEndian. This could be either
|
||||
/// of the available endians as long as it is consistent
|
||||
/// across the network. However, RFC1700 decided network
|
||||
/// byte order would be BigEndian. As such, it is now the
|
||||
/// common endian style for networking.
|
||||
Network
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user