pub struct VarUint248(/* private fields */);Expand description
Variable-length 248-bit integer.
Stored as 5 bits of len (0..=31), followed by len bytes.
Implementations§
Source§impl VarUint248
impl VarUint248
Sourcepub const fn from_words(hi: u128, lo: u128) -> Self
pub const fn from_words(hi: u128, lo: u128) -> Self
Constructs self from a pair of high and low underlying integers.
Sourcepub const fn into_words(self) -> (u128, u128)
pub const fn into_words(self) -> (u128, u128)
Returns a tuple of high and low underlying integers.
Sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>
pub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>
Converts a string slice in a given base to an integer.
Sourcepub const fn is_valid(&self) -> bool
pub const fn is_valid(&self) -> bool
Returns true if an underlying primitive integer fits into the repr.
Sourcepub const fn bit_len(&self) -> Option<u16>
pub const fn bit_len(&self) -> Option<u16>
Returns number of data bits that this struct occupies.
Returns None if an underlying primitive integer is too large.
Sourcepub const fn leading_zeros(&self) -> u32
pub const fn leading_zeros(&self) -> u32
Returns the number of leading zeros in the binary representation of self.
Sourcepub const fn saturating_add(self, rhs: &Self) -> Self
pub const fn saturating_add(self, rhs: &Self) -> Self
Saturating integer addition. Computes self + rhs,
saturating at the numeric bounds instead of overflowing.
Sourcepub const fn saturating_sub(self, rhs: &Self) -> Self
pub const fn saturating_sub(self, rhs: &Self) -> Self
Saturating integer addition. Computes self - rhs,
saturating at the numeric bounds instead of overflowing.
Sourcepub fn saturating_mul(self, rhs: &Self) -> Self
pub fn saturating_mul(self, rhs: &Self) -> Self
Saturating integer multiplication. Computes self * rhs,
returning None if overflow occurred.
Sourcepub const fn checked_add(&self, rhs: &Self) -> Option<Self>
pub const fn checked_add(&self, rhs: &Self) -> Option<Self>
Checked integer addition. Computes self + rhs,
returning None if overflow occurred.
Sourcepub const fn checked_sub(&self, rhs: &Self) -> Option<Self>
pub const fn checked_sub(&self, rhs: &Self) -> Option<Self>
Checked integer subtraction. Computes self - rhs,
returning None if overflow occurred.
Sourcepub fn checked_mul(&self, rhs: &Self) -> Option<Self>
pub fn checked_mul(&self, rhs: &Self) -> Option<Self>
Checked integer multiplication. Computes self * rhs,
returning None if overflow occurred.
Trait Implementations§
Source§impl Add<&VarUint248> for VarUint248
impl Add<&VarUint248> for VarUint248
Source§impl Add<u128> for VarUint248
impl Add<u128> for VarUint248
Source§impl Add for VarUint248
impl Add for VarUint248
Source§impl AddAssign<&VarUint248> for VarUint248
impl AddAssign<&VarUint248> for VarUint248
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+= operation. Read moreSource§impl AddAssign<u128> for VarUint248
impl AddAssign<u128> for VarUint248
Source§fn add_assign(&mut self, rhs: u128)
fn add_assign(&mut self, rhs: u128)
+= operation. Read moreSource§impl AddAssign for VarUint248
impl AddAssign for VarUint248
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl Clone for VarUint248
impl Clone for VarUint248
Source§fn clone(&self) -> VarUint248
fn clone(&self) -> VarUint248
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VarUint248
impl Debug for VarUint248
Source§impl Default for VarUint248
impl Default for VarUint248
Source§fn default() -> VarUint248
fn default() -> VarUint248
Source§impl<'de> Deserialize<'de> for VarUint248
impl<'de> Deserialize<'de> for VarUint248
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>,
Source§impl Display for VarUint248
impl Display for VarUint248
Source§impl Div<&VarUint248> for VarUint248
impl Div<&VarUint248> for VarUint248
Source§impl Div<u128> for VarUint248
impl Div<u128> for VarUint248
Source§impl Div for VarUint248
impl Div for VarUint248
Source§impl DivAssign<&VarUint248> for VarUint248
impl DivAssign<&VarUint248> for VarUint248
Source§fn div_assign(&mut self, rhs: &Self)
fn div_assign(&mut self, rhs: &Self)
/= operation. Read moreSource§impl DivAssign<u128> for VarUint248
impl DivAssign<u128> for VarUint248
Source§fn div_assign(&mut self, rhs: u128)
fn div_assign(&mut self, rhs: u128)
/= operation. Read moreSource§impl DivAssign for VarUint248
impl DivAssign for VarUint248
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl ExactSize for VarUint248
impl ExactSize for VarUint248
Source§fn exact_size(&self) -> Size
fn exact_size(&self) -> Size
Source§impl From<VarUint248> for BigInt
impl From<VarUint248> for BigInt
Source§fn from(value: VarUint248) -> Self
fn from(value: VarUint248) -> Self
Source§impl From<VarUint248> for BigUint
impl From<VarUint248> for BigUint
Source§fn from(value: VarUint248) -> Self
fn from(value: VarUint248) -> Self
Source§impl From<u128> for VarUint248
impl From<u128> for VarUint248
Source§impl From<u16> for VarUint248
impl From<u16> for VarUint248
Source§impl From<u32> for VarUint248
impl From<u32> for VarUint248
Source§impl From<u64> for VarUint248
impl From<u64> for VarUint248
Source§impl From<u8> for VarUint248
impl From<u8> for VarUint248
Source§impl From<usize> for VarUint248
impl From<usize> for VarUint248
Source§impl FromStr for VarUint248
impl FromStr for VarUint248
Source§impl Hash for VarUint248
impl Hash for VarUint248
Source§impl<'a> Load<'a> for VarUint248
impl<'a> Load<'a> for VarUint248
Source§impl Mul<&VarUint248> for VarUint248
impl Mul<&VarUint248> for VarUint248
Source§impl Mul<u128> for VarUint248
impl Mul<u128> for VarUint248
Source§impl Mul for VarUint248
impl Mul for VarUint248
Source§impl MulAssign<&VarUint248> for VarUint248
impl MulAssign<&VarUint248> for VarUint248
Source§fn mul_assign(&mut self, rhs: &Self)
fn mul_assign(&mut self, rhs: &Self)
*= operation. Read moreSource§impl MulAssign<u128> for VarUint248
impl MulAssign<u128> for VarUint248
Source§fn mul_assign(&mut self, rhs: u128)
fn mul_assign(&mut self, rhs: u128)
*= operation. Read moreSource§impl MulAssign for VarUint248
impl MulAssign for VarUint248
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl Ord for VarUint248
impl Ord for VarUint248
Source§impl PartialEq<u128> for VarUint248
impl PartialEq<u128> for VarUint248
Source§impl PartialEq for VarUint248
impl PartialEq for VarUint248
Source§impl PartialOrd<u128> for VarUint248
impl PartialOrd<u128> for VarUint248
Source§impl PartialOrd for VarUint248
impl PartialOrd for VarUint248
Source§impl Rem<&VarUint248> for VarUint248
impl Rem<&VarUint248> for VarUint248
Source§impl Rem<u128> for VarUint248
impl Rem<u128> for VarUint248
Source§impl Rem for VarUint248
impl Rem for VarUint248
Source§impl RemAssign<&VarUint248> for VarUint248
impl RemAssign<&VarUint248> for VarUint248
Source§fn rem_assign(&mut self, rhs: &Self)
fn rem_assign(&mut self, rhs: &Self)
%= operation. Read moreSource§impl RemAssign<u128> for VarUint248
impl RemAssign<u128> for VarUint248
Source§fn rem_assign(&mut self, rhs: u128)
fn rem_assign(&mut self, rhs: u128)
%= operation. Read moreSource§impl RemAssign for VarUint248
impl RemAssign for VarUint248
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%= operation. Read moreSource§impl Serialize for VarUint248
impl Serialize for VarUint248
Source§impl Shl<i32> for VarUint248
impl Shl<i32> for VarUint248
Source§impl Shl<u32> for VarUint248
impl Shl<u32> for VarUint248
Source§impl Shl<usize> for VarUint248
impl Shl<usize> for VarUint248
Source§impl ShlAssign<usize> for VarUint248
impl ShlAssign<usize> for VarUint248
Source§fn shl_assign(&mut self, n: usize)
fn shl_assign(&mut self, n: usize)
<<= operation. Read moreSource§impl Shr<i32> for VarUint248
impl Shr<i32> for VarUint248
Source§impl Shr<u32> for VarUint248
impl Shr<u32> for VarUint248
Source§impl Shr<usize> for VarUint248
impl Shr<usize> for VarUint248
Source§impl ShrAssign<usize> for VarUint248
impl ShrAssign<usize> for VarUint248
Source§fn shr_assign(&mut self, n: usize)
fn shr_assign(&mut self, n: usize)
>>= operation. Read moreSource§impl Store for VarUint248
impl Store for VarUint248
Source§fn store_into(
&self,
builder: &mut CellBuilder,
_: &dyn CellContext,
) -> Result<(), Error>
fn store_into( &self, builder: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>
Source§impl Sub<&VarUint248> for VarUint248
impl Sub<&VarUint248> for VarUint248
Source§impl Sub<u128> for VarUint248
impl Sub<u128> for VarUint248
Source§impl Sub for VarUint248
impl Sub for VarUint248
Source§impl SubAssign<&VarUint248> for VarUint248
impl SubAssign<&VarUint248> for VarUint248
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-= operation. Read moreSource§impl SubAssign<u128> for VarUint248
impl SubAssign<u128> for VarUint248
Source§fn sub_assign(&mut self, rhs: u128)
fn sub_assign(&mut self, rhs: u128)
-= operation. Read moreSource§impl SubAssign for VarUint248
impl SubAssign for VarUint248
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreSource§impl WithAbiType for VarUint248
impl WithAbiType for VarUint248
impl Copy for VarUint248
impl Eq for VarUint248
impl StructuralPartialEq for VarUint248
Auto Trait Implementations§
impl Freeze for VarUint248
impl RefUnwindSafe for VarUint248
impl Send for VarUint248
impl Sync for VarUint248
impl Unpin for VarUint248
impl UnwindSafe for VarUint248
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
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<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
self to key and returns true if they are equal.