pub struct LeU16(/* private fields */);Expand description
16-bit unsigned little-endian integer. Alignment 1.
Implementations§
Source§impl LeU16
impl LeU16
Sourcepub const fn to_le_bytes(self) -> [u8; 2]
pub const fn to_le_bytes(self) -> [u8; 2]
Raw little-endian bytes.
Sourcepub const fn from_le_bytes(bytes: [u8; 2]) -> Self
pub const fn from_le_bytes(bytes: [u8; 2]) -> Self
Construct from raw little-endian bytes.
Sourcepub const fn checked_add(self, rhs: Self) -> Option<Self>
pub const fn checked_add(self, rhs: Self) -> Option<Self>
Checked addition. Returns None on overflow.
Sourcepub const fn checked_sub(self, rhs: Self) -> Option<Self>
pub const fn checked_sub(self, rhs: Self) -> Option<Self>
Checked subtraction. Returns None on underflow.
Sourcepub const fn checked_mul(self, rhs: Self) -> Option<Self>
pub const fn checked_mul(self, rhs: Self) -> Option<Self>
Checked multiplication. Returns None on overflow.
Sourcepub const fn checked_div(self, rhs: Self) -> Option<Self>
pub const fn checked_div(self, rhs: Self) -> Option<Self>
Checked division. Returns None on divide-by-zero.
Sourcepub const fn saturating_add(self, rhs: Self) -> Self
pub const fn saturating_add(self, rhs: Self) -> Self
Saturating addition (clamps at MAX instead of wrapping).
Sourcepub const fn saturating_sub(self, rhs: Self) -> Self
pub const fn saturating_sub(self, rhs: Self) -> Self
Saturating subtraction (clamps at 0 instead of wrapping).
Sourcepub const fn wrapping_add(self, rhs: Self) -> Self
pub const fn wrapping_add(self, rhs: Self) -> Self
Wrapping addition (use explicitly when wrapping is intended).
Sourcepub const fn wrapping_sub(self, rhs: Self) -> Self
pub const fn wrapping_sub(self, rhs: Self) -> Self
Wrapping subtraction.
Trait Implementations§
Source§impl AddAssign<u16> for LeU16
impl AddAssign<u16> for LeU16
Source§fn add_assign(&mut self, rhs: u16)
fn add_assign(&mut self, rhs: u16)
Performs the
+= operation. Read moreSource§impl AddAssign for LeU16
impl AddAssign for LeU16
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<u16> for LeU16
impl DivAssign<u16> for LeU16
Source§fn div_assign(&mut self, rhs: u16)
fn div_assign(&mut self, rhs: u16)
Performs the
/= operation. Read moreSource§impl DivAssign for LeU16
impl DivAssign for LeU16
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl MulAssign<u16> for LeU16
impl MulAssign<u16> for LeU16
Source§fn mul_assign(&mut self, rhs: u16)
fn mul_assign(&mut self, rhs: u16)
Performs the
*= operation. Read moreSource§impl MulAssign for LeU16
impl MulAssign for LeU16
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl Ord for LeU16
impl Ord for LeU16
Source§impl PartialOrd<u16> for LeU16
impl PartialOrd<u16> for LeU16
Source§impl PartialOrd for LeU16
impl PartialOrd for LeU16
Source§impl RemAssign<u16> for LeU16
impl RemAssign<u16> for LeU16
Source§fn rem_assign(&mut self, rhs: u16)
fn rem_assign(&mut self, rhs: u16)
Performs the
%= operation. Read moreSource§impl RemAssign for LeU16
impl RemAssign for LeU16
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%= operation. Read moreSource§impl SubAssign<u16> for LeU16
impl SubAssign<u16> for LeU16
Source§fn sub_assign(&mut self, rhs: u16)
fn sub_assign(&mut self, rhs: u16)
Performs the
-= operation. Read moreSource§impl SubAssign for LeU16
impl SubAssign for LeU16
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for LeU16
impl Eq for LeU16
impl Projectable for LeU16
impl StructuralPartialEq for LeU16
Auto Trait Implementations§
impl Freeze for LeU16
impl RefUnwindSafe for LeU16
impl Send for LeU16
impl Sync for LeU16
impl Unpin for LeU16
impl UnsafeUnpin for LeU16
impl UnwindSafe for LeU16
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more