pub struct LeU128(/* private fields */);Expand description
128-bit unsigned little-endian integer. Alignment 1.
Useful for large amounts (e.g., total supply tracking) where u64 would overflow. Stored as 16 bytes in account data.
Implementations§
Source§impl LeU128
impl LeU128
pub const ZERO: Self
pub const MAX: Self
pub const fn new(v: u128) -> Self
pub const fn get(self) -> u128
pub const fn to_le_bytes(self) -> [u8; 16]
pub const fn checked_add(self, rhs: Self) -> Option<Self>
pub const fn checked_sub(self, rhs: Self) -> Option<Self>
pub const fn checked_mul(self, rhs: Self) -> Option<Self>
pub const fn saturating_add(self, rhs: Self) -> Self
pub const fn saturating_sub(self, rhs: Self) -> Self
pub const fn is_zero(self) -> bool
Trait Implementations§
Source§impl AddAssign<u128> for LeU128
impl AddAssign<u128> for LeU128
Source§fn add_assign(&mut self, rhs: u128)
fn add_assign(&mut self, rhs: u128)
Performs the
+= operation. Read moreSource§impl AddAssign for LeU128
impl AddAssign for LeU128
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<u128> for LeU128
impl DivAssign<u128> for LeU128
Source§fn div_assign(&mut self, rhs: u128)
fn div_assign(&mut self, rhs: u128)
Performs the
/= operation. Read moreSource§impl DivAssign for LeU128
impl DivAssign for LeU128
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl MulAssign<u128> for LeU128
impl MulAssign<u128> for LeU128
Source§fn mul_assign(&mut self, rhs: u128)
fn mul_assign(&mut self, rhs: u128)
Performs the
*= operation. Read moreSource§impl MulAssign for LeU128
impl MulAssign for LeU128
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl Ord for LeU128
impl Ord for LeU128
Source§impl PartialOrd<u128> for LeU128
impl PartialOrd<u128> for LeU128
Source§impl PartialOrd for LeU128
impl PartialOrd for LeU128
Source§impl RemAssign<u128> for LeU128
impl RemAssign<u128> for LeU128
Source§fn rem_assign(&mut self, rhs: u128)
fn rem_assign(&mut self, rhs: u128)
Performs the
%= operation. Read moreSource§impl RemAssign for LeU128
impl RemAssign for LeU128
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%= operation. Read moreSource§impl SubAssign<u128> for LeU128
impl SubAssign<u128> for LeU128
Source§fn sub_assign(&mut self, rhs: u128)
fn sub_assign(&mut self, rhs: u128)
Performs the
-= operation. Read moreSource§impl SubAssign for LeU128
impl SubAssign for LeU128
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for LeU128
impl Eq for LeU128
impl Projectable for LeU128
impl StructuralPartialEq for LeU128
Auto Trait Implementations§
impl Freeze for LeU128
impl RefUnwindSafe for LeU128
impl Send for LeU128
impl Sync for LeU128
impl Unpin for LeU128
impl UnsafeUnpin for LeU128
impl UnwindSafe for LeU128
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