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: Int) -> IntBig
pub const fn from_candid(value: Int) -> IntBig
Construct from the canonical Candid signed-integer representation.
Sourcepub fn from_bigint(value: BigInt) -> IntBig
pub fn from_bigint(value: BigInt) -> IntBig
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: IntBig) -> IntBig
pub fn saturating_add(self, rhs: IntBig) -> IntBig
Saturating addition (unbounded; equivalent to normal addition).
Sourcepub fn saturating_sub(self, rhs: IntBig) -> IntBig
pub fn saturating_sub(self, rhs: IntBig) -> IntBig
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: IntBig)
fn add_assign(&mut self, __rhs: IntBig)
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<IntBig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IntBig, <__D as Deserializer<'de>>::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: IntBig)
fn div_assign(&mut self, other: IntBig)
Performs the
/= operation. Read moreimpl Eq for IntBig
Source§impl MulAssign for IntBig
impl MulAssign for IntBig
Source§fn mul_assign(&mut self, other: IntBig)
fn mul_assign(&mut self, other: IntBig)
Performs the
*= operation. Read moreSource§impl NormalizeAuto for IntBig
impl NormalizeAuto for IntBig
fn normalize_self(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl NormalizeCustom for IntBig
impl NormalizeCustom for IntBig
fn normalize_custom(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl NumericValue for IntBig
impl NumericValue for IntBig
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
Source§impl Serialize for IntBig
impl Serialize for IntBig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for IntBig
Source§impl SubAssign for IntBig
impl SubAssign for IntBig
Source§fn sub_assign(&mut self, __rhs: IntBig)
fn sub_assign(&mut self, __rhs: IntBig)
Performs the
-= operation. Read moreSource§impl ValidateAuto for IntBig
impl ValidateAuto for IntBig
fn validate_self(&self, _ctx: &mut dyn VisitorContext)
Source§impl ValidateCustom for IntBig
impl ValidateCustom for IntBig
fn validate_custom(&self, _ctx: &mut dyn VisitorContext)
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> CustomError for T
impl<T> CustomError for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> Normalize for Twhere
T: NormalizeAuto + NormalizeCustom,
Source§impl<T> NormalizeAndValidate for Twhere
T: Visitable,
impl<T> NormalizeAndValidate for Twhere
T: Visitable,
Source§fn normalize_and_validate(self) -> Result<Self, VisitorError>
fn normalize_and_validate(self) -> Result<Self, VisitorError>
Normalize and then validate this application-owned value. Read more