pub type le16 = Le<u16>;
Expand description
A 16-bit unsigned integer stored in little-endian byte order.
§Examples
Basic usage:
use endian_num::le16;
let n = 0x1A;
if cfg!(target_endian = "little") {
assert_eq!(le16::from_ne(n).0, n);
} else {
assert_eq!(le16::from_ne(n).0, n.swap_bytes());
}
Aliased Type§
struct le16(pub u16);
Fields§
§0: u16
Trait Implementations§
Source§impl From<EventSuppressDesc> for le16
impl From<EventSuppressDesc> for le16
Source§fn from(v: EventSuppressDesc) -> le16
fn from(v: EventSuppressDesc) -> le16
Converts to this type from the input type.
Source§impl From<EventSuppressFlags> for le16
impl From<EventSuppressFlags> for le16
Source§fn from(v: EventSuppressFlags) -> le16
fn from(v: EventSuppressFlags) -> le16
Converts to this type from the input type.
Source§impl OveralignedField<Le<u32>> for le16
impl OveralignedField<Le<u32>> for le16
Source§fn from_field(field: le32) -> Self
fn from_field(field: le32) -> Self
Converts to this type from the overaligned field.
Source§fn into_field(self) -> le32
fn into_field(self) -> le32
Converts this type into the overaligned field.