pub struct U128(/* private fields */);Expand description
BPF-safe unsigned 128-bit integer using [u64; 2] for consistent alignment. Layout: [lo, hi] in little-endian order.
Implementations§
Source§impl U128
impl U128
pub const ZERO: Self
pub const MAX: Self
pub const fn new(val: u128) -> Self
pub const fn get(self) -> u128
pub fn set(&mut self, val: u128)
pub fn checked_add(self, rhs: u128) -> Option<Self>
pub fn checked_sub(self, rhs: u128) -> Option<Self>
pub fn checked_mul(self, rhs: u128) -> Option<Self>
pub fn checked_div(self, rhs: u128) -> Option<Self>
pub fn saturating_add(self, rhs: u128) -> Self
pub fn saturating_add_u128(self, rhs: U128) -> Self
pub fn saturating_sub(self, rhs: u128) -> Self
pub fn saturating_sub_u128(self, rhs: U128) -> Self
pub fn saturating_mul(self, rhs: u128) -> Self
pub fn wrapping_add(self, rhs: u128) -> Self
pub fn max(self, rhs: Self) -> Self
pub fn min(self, rhs: Self) -> Self
pub fn is_zero(self) -> bool
Trait Implementations§
Source§impl AddAssign<u128> for U128
Available on non-kani only.
impl AddAssign<u128> for U128
Available on non-
kani only.Source§fn add_assign(&mut self, rhs: u128)
fn add_assign(&mut self, rhs: u128)
Performs the
+= operation. Read moreSource§impl Ord for U128
Available on non-kani only.
impl Ord for U128
Available on non-
kani only.Source§impl PartialOrd for U128
Available on non-kani only.
impl PartialOrd for U128
Available on non-
kani only.Source§impl SubAssign<u128> for U128
Available on non-kani only.
impl SubAssign<u128> for U128
Available on non-
kani only.Source§fn sub_assign(&mut self, rhs: u128)
fn sub_assign(&mut self, rhs: u128)
Performs the
-= operation. Read moreimpl Copy for U128
impl Eq for U128
impl StructuralPartialEq for U128
Auto Trait Implementations§
impl Freeze for U128
impl RefUnwindSafe for U128
impl Send for U128
impl Sync for U128
impl Unpin for U128
impl UnsafeUnpin for U128
impl UnwindSafe for U128
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