pub struct Uint128(/* private fields */);Implementations§
Source§impl Uint128
impl Uint128
pub const MAX: Self
pub const MIN: Self
Sourcepub const fn new(value: u128) -> Self
pub const fn new(value: u128) -> Self
Creates a Uint128(value).
This method is less flexible than from but can be called in a const context.
Sourcepub const fn to_be_bytes(self) -> [u8; 16]
pub const fn to_be_bytes(self) -> [u8; 16]
Returns a copy of the number as big endian bytes.
Sourcepub const fn to_le_bytes(self) -> [u8; 16]
pub const fn to_le_bytes(self) -> [u8; 16]
Returns a copy of the number as little endian bytes.
Sourcepub const fn strict_add(self, rhs: Self) -> Self
pub const fn strict_add(self, rhs: Self) -> Self
Strict integer addition. Computes self + rhs, panicking if overflow occurred.
This is the same as Uint128::add but const.
Sourcepub const fn strict_sub(self, other: Self) -> Self
pub const fn strict_sub(self, other: Self) -> Self
Strict integer subtraction. Computes self - rhs, panicking if overflow occurred.
This is the same as Uint128::sub but const.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Uint128
impl<'de> Deserialize<'de> for Uint128
Source§fn deserialize<D>(deserializer: D) -> Result<Uint128, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Uint128, D::Error>where
D: Deserializer<'de>,
Deserialized from an integer string using base 10
Source§impl Ord for Uint128
impl Ord for Uint128
Source§impl PartialOrd for Uint128
impl PartialOrd for Uint128
impl Copy for Uint128
impl Eq for Uint128
impl StructuralPartialEq for Uint128
Auto Trait Implementations§
impl Freeze for Uint128
impl RefUnwindSafe for Uint128
impl Send for Uint128
impl Sync for Uint128
impl Unpin for Uint128
impl UnwindSafe for Uint128
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