pub struct LeU64(/* private fields */);Expand description
64-bit unsigned little-endian integer. Alignment 1.
The workhorse type for token amounts, lamport balances, timestamps,
and most on-chain numeric fields. Use this instead of u64 in any
#[repr(C)] struct that will be projected from account data.
Implementations§
Source§impl LeU64
impl LeU64
Sourcepub const fn to_le_bytes(self) -> [u8; 8]
pub const fn to_le_bytes(self) -> [u8; 8]
Raw little-endian bytes.
Sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> Self
pub const fn from_le_bytes(bytes: [u8; 8]) -> 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<u64> for LeU64
impl AddAssign<u64> for LeU64
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+= operation. Read moreSource§impl AddAssign for LeU64
impl AddAssign for LeU64
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<u64> for LeU64
impl DivAssign<u64> for LeU64
Source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
Performs the
/= operation. Read moreSource§impl DivAssign for LeU64
impl DivAssign for LeU64
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl MulAssign<u64> for LeU64
impl MulAssign<u64> for LeU64
Source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
Performs the
*= operation. Read moreSource§impl MulAssign for LeU64
impl MulAssign for LeU64
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl Ord for LeU64
impl Ord for LeU64
Source§impl PartialOrd<u64> for LeU64
impl PartialOrd<u64> for LeU64
Source§impl PartialOrd for LeU64
impl PartialOrd for LeU64
Source§impl RemAssign<u64> for LeU64
impl RemAssign<u64> for LeU64
Source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
Performs the
%= operation. Read moreSource§impl RemAssign for LeU64
impl RemAssign for LeU64
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%= operation. Read moreSource§impl SubAssign<u64> for LeU64
impl SubAssign<u64> for LeU64
Source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-= operation. Read moreSource§impl SubAssign for LeU64
impl SubAssign for LeU64
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for LeU64
impl Eq for LeU64
impl Projectable for LeU64
impl StructuralPartialEq for LeU64
Auto Trait Implementations§
impl Freeze for LeU64
impl RefUnwindSafe for LeU64
impl Send for LeU64
impl Sync for LeU64
impl Unpin for LeU64
impl UnsafeUnpin for LeU64
impl UnwindSafe for LeU64
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