pub struct IntBig(/* private fields */);Expand description
Arbitrary-precision signed integer used by schema and typed values.
Implementations§
Source§impl IntBig
impl IntBig
Sourcepub const fn from_candid(value: WrappedInt) -> Self
pub const fn from_candid(value: WrappedInt) -> Self
Construct from the canonical Candid signed-integer representation.
Sourcepub fn from_bigint(value: BigInt) -> Self
pub fn from_bigint(value: BigInt) -> Self
Construct from a num_bigint signed integer.
Sourcepub fn sign_and_u32_digits(&self) -> (bool, Vec<u32>)
pub fn sign_and_u32_digits(&self) -> (bool, Vec<u32>)
Return sign and base-2^32 magnitude limbs for decimal key encoding.
This allocates for the returned limb vector.
Sourcepub fn to_leb128(&self) -> Vec<u8> ⓘ
pub fn to_leb128(&self) -> Vec<u8> ⓘ
Serialize this arbitrary-precision integer for internal hash and sort-key framing.
Sourcepub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Saturating addition (unbounded; equivalent to normal addition).
Sourcepub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Saturating subtraction (unbounded; equivalent to normal subtraction).
Trait Implementations§
Source§impl AddAssign for IntBig
impl AddAssign for IntBig
Source§fn add_assign(&mut self, __rhs: Self)
fn add_assign(&mut self, __rhs: Self)
Performs the
+= operation. Read moreSource§impl CandidType for IntBig
impl CandidType for IntBig
Source§impl<'de> Deserialize<'de> for IntBig
impl<'de> Deserialize<'de> for IntBig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DivAssign for IntBig
impl DivAssign for IntBig
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/= operation. Read moreimpl Eq for IntBig
Source§impl MulAssign for IntBig
impl MulAssign for IntBig
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moreSource§impl NumericValue for IntBig
impl NumericValue for IntBig
Source§fn try_to_decimal(&self) -> Option<Decimal>
fn try_to_decimal(&self) -> Option<Decimal>
Convert this value into
Decimal for generic numeric handling.Source§fn try_from_decimal(value: Decimal) -> Option<Self>
fn try_from_decimal(value: Decimal) -> Option<Self>
Rebuild the value from
Decimal after generic numeric handling.Source§impl Ord for IntBig
impl Ord for IntBig
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for IntBig
impl PartialOrd for IntBig
impl StructuralPartialEq for IntBig
Auto Trait Implementations§
impl Freeze for IntBig
impl RefUnwindSafe for IntBig
impl Send for IntBig
impl Sync for IntBig
impl Unpin for IntBig
impl UnsafeUnpin for IntBig
impl UnwindSafe for IntBig
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