Struct fixed_width_field::MaxFieldUint
source · [−]Expand description
Little-endian large integer type
Tuple Fields
0: [u64; 16]
Implementations
sourceimpl MaxFieldUint
impl MaxFieldUint
sourcepub const MAX: MaxFieldUint
pub const MAX: MaxFieldUint
Maximum value.
pub const fn from_limbs(limbs: [u64; 16]) -> MaxFieldUint
sourcepub fn as_u64(&self) -> u64
pub fn as_u64(&self) -> u64
Conversion to u64 with overflow checking
Panics
Panics if the number is larger than u64::max_value().
sourcepub fn as_usize(&self) -> usize
pub fn as_usize(&self) -> usize
Conversion to usize with overflow checking
Panics
Panics if the number is larger than usize::max_value().
sourcepub fn leading_zeros(&self) -> u32
pub fn leading_zeros(&self) -> u32
Returns the number of leading zeros in the binary representation of self.
sourcepub fn trailing_zeros(&self) -> u32
pub fn trailing_zeros(&self) -> u32
Returns the number of leading zeros in the binary representation of self.
sourcepub fn to_big_endian(&self, bytes: &mut [u8])
pub fn to_big_endian(&self, bytes: &mut [u8])
Write to the slice in big-endian format.
sourcepub fn to_little_endian(&self, bytes: &mut [u8])
pub fn to_little_endian(&self, bytes: &mut [u8])
Write to the slice in little-endian format.
sourcepub fn pow(self, expon: Self) -> Self
pub fn pow(self, expon: Self) -> Self
Fast exponentiation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring
Panics
Panics if the result overflows the type.
sourcepub fn overflowing_pow(self, expon: Self) -> (Self, bool)
pub fn overflowing_pow(self, expon: Self) -> (Self, bool)
Fast exponentiation by squaring. Returns result and overflow flag.
sourcepub fn overflowing_add(self, other: MaxFieldUint) -> (MaxFieldUint, bool)
pub fn overflowing_add(self, other: MaxFieldUint) -> (MaxFieldUint, bool)
Add with overflow.
sourcepub fn saturating_add(self, other: MaxFieldUint) -> MaxFieldUint
pub fn saturating_add(self, other: MaxFieldUint) -> MaxFieldUint
Addition which saturates at the maximum value (Self::max_value()).
sourcepub fn checked_add(self, other: MaxFieldUint) -> Option<MaxFieldUint>
pub fn checked_add(self, other: MaxFieldUint) -> Option<MaxFieldUint>
Checked addition. Returns None
if overflow occurred.
sourcepub fn overflowing_sub(self, other: MaxFieldUint) -> (MaxFieldUint, bool)
pub fn overflowing_sub(self, other: MaxFieldUint) -> (MaxFieldUint, bool)
Subtraction which underflows and returns a flag if it does.
sourcepub fn saturating_sub(self, other: MaxFieldUint) -> MaxFieldUint
pub fn saturating_sub(self, other: MaxFieldUint) -> MaxFieldUint
Subtraction which saturates at zero.
sourcepub fn checked_sub(self, other: MaxFieldUint) -> Option<MaxFieldUint>
pub fn checked_sub(self, other: MaxFieldUint) -> Option<MaxFieldUint>
Checked subtraction. Returns None
if overflow occurred.
sourcepub fn adaptive_multiplication(self, other: MaxFieldUint) -> MaxFieldUint
pub fn adaptive_multiplication(self, other: MaxFieldUint) -> MaxFieldUint
Multiply without overflow by checking number of words for each input
sourcepub fn overflowing_mul(self, other: MaxFieldUint) -> (MaxFieldUint, bool)
pub fn overflowing_mul(self, other: MaxFieldUint) -> (MaxFieldUint, bool)
Multiply with overflow, returning a flag if it does.
sourcepub fn saturating_mul(self, other: MaxFieldUint) -> MaxFieldUint
pub fn saturating_mul(self, other: MaxFieldUint) -> MaxFieldUint
Multiplication which saturates at the maximum value..
sourcepub fn checked_mul(self, other: MaxFieldUint) -> Option<MaxFieldUint>
pub fn checked_mul(self, other: MaxFieldUint) -> Option<MaxFieldUint>
Checked multiplication. Returns None
if overflow occurred.
sourcepub fn checked_div(self, other: MaxFieldUint) -> Option<MaxFieldUint>
pub fn checked_div(self, other: MaxFieldUint) -> Option<MaxFieldUint>
Checked division. Returns None
if other == 0
.
sourcepub fn checked_rem(self, other: MaxFieldUint) -> Option<MaxFieldUint>
pub fn checked_rem(self, other: MaxFieldUint) -> Option<MaxFieldUint>
Checked modulus. Returns None
if other == 0
.
sourcepub fn overflowing_neg(self) -> (MaxFieldUint, bool)
pub fn overflowing_neg(self) -> (MaxFieldUint, bool)
Negation with overflow.
sourcepub fn checked_neg(self) -> Option<MaxFieldUint>
pub fn checked_neg(self) -> Option<MaxFieldUint>
Checked negation. Returns None
unless self == 0
.
sourcepub fn from_big_endian(slice: &[u8]) -> Self
pub fn from_big_endian(slice: &[u8]) -> Self
Converts from big endian representation bytes in memory.
sourcepub fn from_little_endian(slice: &[u8]) -> Self
pub fn from_little_endian(slice: &[u8]) -> Self
Converts from little endian representation bytes in memory.
sourceimpl MaxFieldUint
impl MaxFieldUint
Trait Implementations
sourceimpl Add<MaxFieldUint> for MaxFieldUint
impl Add<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the +
operator.
sourcefn add(self, other: MaxFieldUint) -> MaxFieldUint
fn add(self, other: MaxFieldUint) -> MaxFieldUint
Performs the +
operation. Read more
sourceimpl AddAssign<MaxFieldUint> for MaxFieldUint
impl AddAssign<MaxFieldUint> for MaxFieldUint
sourcefn add_assign(&mut self, other: MaxFieldUint)
fn add_assign(&mut self, other: MaxFieldUint)
Performs the +=
operation. Read more
sourceimpl AsMut<[u64]> for MaxFieldUint
impl AsMut<[u64]> for MaxFieldUint
Get a mutable reference to the underlying little-endian words.
sourceimpl BitAnd<MaxFieldUint> for MaxFieldUint
impl BitAnd<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the &
operator.
sourcefn bitand(self, other: MaxFieldUint) -> MaxFieldUint
fn bitand(self, other: MaxFieldUint) -> MaxFieldUint
Performs the &
operation. Read more
sourceimpl BitOr<MaxFieldUint> for MaxFieldUint
impl BitOr<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the |
operator.
sourcefn bitor(self, other: MaxFieldUint) -> MaxFieldUint
fn bitor(self, other: MaxFieldUint) -> MaxFieldUint
Performs the |
operation. Read more
sourceimpl BitXor<MaxFieldUint> for MaxFieldUint
impl BitXor<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the ^
operator.
sourcefn bitxor(self, other: MaxFieldUint) -> MaxFieldUint
fn bitxor(self, other: MaxFieldUint) -> MaxFieldUint
Performs the ^
operation. Read more
sourceimpl Clone for MaxFieldUint
impl Clone for MaxFieldUint
sourcefn clone(&self) -> MaxFieldUint
fn clone(&self) -> MaxFieldUint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MaxFieldUint
impl Debug for MaxFieldUint
sourceimpl Default for MaxFieldUint
impl Default for MaxFieldUint
sourceimpl Display for MaxFieldUint
impl Display for MaxFieldUint
sourceimpl Div<MaxFieldUint> for MaxFieldUint
impl Div<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the /
operator.
sourcefn div(self, other: MaxFieldUint) -> MaxFieldUint
fn div(self, other: MaxFieldUint) -> MaxFieldUint
Performs the /
operation. Read more
sourceimpl DivAssign<MaxFieldUint> for MaxFieldUint
impl DivAssign<MaxFieldUint> for MaxFieldUint
sourcefn div_assign(&mut self, other: MaxFieldUint)
fn div_assign(&mut self, other: MaxFieldUint)
Performs the /=
operation. Read more
sourceimpl<'a> From<&'a MaxFieldUint> for MaxFieldUint
impl<'a> From<&'a MaxFieldUint> for MaxFieldUint
sourcefn from(x: &'a MaxFieldUint) -> MaxFieldUint
fn from(x: &'a MaxFieldUint) -> MaxFieldUint
Performs the conversion.
sourceimpl From<MaxFieldUint> for [u8; 128]
impl From<MaxFieldUint> for [u8; 128]
sourcefn from(number: MaxFieldUint) -> Self
fn from(number: MaxFieldUint) -> Self
Performs the conversion.
sourceimpl From<i32> for MaxFieldUint
impl From<i32> for MaxFieldUint
sourcefn from(value: i32) -> MaxFieldUint
fn from(value: i32) -> MaxFieldUint
Performs the conversion.
sourceimpl From<i64> for MaxFieldUint
impl From<i64> for MaxFieldUint
sourcefn from(value: i64) -> MaxFieldUint
fn from(value: i64) -> MaxFieldUint
Performs the conversion.
sourceimpl From<isize> for MaxFieldUint
impl From<isize> for MaxFieldUint
sourcefn from(value: isize) -> MaxFieldUint
fn from(value: isize) -> MaxFieldUint
Performs the conversion.
sourceimpl From<u128> for MaxFieldUint
impl From<u128> for MaxFieldUint
sourcefn from(value: u128) -> MaxFieldUint
fn from(value: u128) -> MaxFieldUint
Performs the conversion.
sourceimpl From<u16> for MaxFieldUint
impl From<u16> for MaxFieldUint
sourcefn from(value: u16) -> MaxFieldUint
fn from(value: u16) -> MaxFieldUint
Performs the conversion.
sourceimpl From<u32> for MaxFieldUint
impl From<u32> for MaxFieldUint
sourcefn from(value: u32) -> MaxFieldUint
fn from(value: u32) -> MaxFieldUint
Performs the conversion.
sourceimpl From<u64> for MaxFieldUint
impl From<u64> for MaxFieldUint
sourcefn from(value: u64) -> MaxFieldUint
fn from(value: u64) -> MaxFieldUint
Performs the conversion.
sourceimpl From<u8> for MaxFieldUint
impl From<u8> for MaxFieldUint
sourcefn from(value: u8) -> MaxFieldUint
fn from(value: u8) -> MaxFieldUint
Performs the conversion.
sourceimpl From<usize> for MaxFieldUint
impl From<usize> for MaxFieldUint
sourcefn from(value: usize) -> MaxFieldUint
fn from(value: usize) -> MaxFieldUint
Performs the conversion.
sourceimpl Hash for MaxFieldUint
impl Hash for MaxFieldUint
sourceimpl LowerHex for MaxFieldUint
impl LowerHex for MaxFieldUint
sourceimpl<'a> Mul<&'a MaxFieldUint> for MaxFieldUint
impl<'a> Mul<&'a MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: &'a MaxFieldUint) -> MaxFieldUint
fn mul(self, other: &'a MaxFieldUint) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<&'a MaxFieldUint> for &'a MaxFieldUint
impl<'a> Mul<&'a MaxFieldUint> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: &'a MaxFieldUint) -> MaxFieldUint
fn mul(self, other: &'a MaxFieldUint) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<&'a u64> for MaxFieldUint
impl<'a> Mul<&'a u64> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: &'a u64) -> MaxFieldUint
fn mul(self, other: &'a u64) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<&'a u64> for &'a MaxFieldUint
impl<'a> Mul<&'a u64> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: &'a u64) -> MaxFieldUint
fn mul(self, other: &'a u64) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<&'a usize> for MaxFieldUint
impl<'a> Mul<&'a usize> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: &'a usize) -> MaxFieldUint
fn mul(self, other: &'a usize) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<&'a usize> for &'a MaxFieldUint
impl<'a> Mul<&'a usize> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: &'a usize) -> MaxFieldUint
fn mul(self, other: &'a usize) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl Mul<MaxFieldUint> for MaxFieldUint
impl Mul<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: MaxFieldUint) -> MaxFieldUint
fn mul(self, other: MaxFieldUint) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<MaxFieldUint> for &'a MaxFieldUint
impl<'a> Mul<MaxFieldUint> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: MaxFieldUint) -> MaxFieldUint
fn mul(self, other: MaxFieldUint) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl Mul<u64> for MaxFieldUint
impl Mul<u64> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: u64) -> MaxFieldUint
fn mul(self, other: u64) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<u64> for &'a MaxFieldUint
impl<'a> Mul<u64> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: u64) -> MaxFieldUint
fn mul(self, other: u64) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl Mul<usize> for MaxFieldUint
impl Mul<usize> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: usize) -> MaxFieldUint
fn mul(self, other: usize) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl<'a> Mul<usize> for &'a MaxFieldUint
impl<'a> Mul<usize> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the *
operator.
sourcefn mul(self, other: usize) -> MaxFieldUint
fn mul(self, other: usize) -> MaxFieldUint
Performs the *
operation. Read more
sourceimpl MulAssign<MaxFieldUint> for MaxFieldUint
impl MulAssign<MaxFieldUint> for MaxFieldUint
sourcefn mul_assign(&mut self, other: MaxFieldUint)
fn mul_assign(&mut self, other: MaxFieldUint)
Performs the *=
operation. Read more
sourceimpl MulAssign<u64> for MaxFieldUint
impl MulAssign<u64> for MaxFieldUint
sourcefn mul_assign(&mut self, other: u64)
fn mul_assign(&mut self, other: u64)
Performs the *=
operation. Read more
sourceimpl MulAssign<usize> for MaxFieldUint
impl MulAssign<usize> for MaxFieldUint
sourcefn mul_assign(&mut self, other: usize)
fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more
sourceimpl Not for MaxFieldUint
impl Not for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the !
operator.
sourcefn not(self) -> MaxFieldUint
fn not(self) -> MaxFieldUint
Performs the unary !
operation. Read more
sourceimpl Ord for MaxFieldUint
impl Ord for MaxFieldUint
sourceimpl PartialEq<MaxFieldUint> for MaxFieldUint
impl PartialEq<MaxFieldUint> for MaxFieldUint
sourceimpl PartialOrd<MaxFieldUint> for MaxFieldUint
impl PartialOrd<MaxFieldUint> for MaxFieldUint
sourcefn partial_cmp(&self, other: &MaxFieldUint) -> Option<Ordering>
fn partial_cmp(&self, other: &MaxFieldUint) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Rem<MaxFieldUint> for MaxFieldUint
impl Rem<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the %
operator.
sourcefn rem(self, other: MaxFieldUint) -> MaxFieldUint
fn rem(self, other: MaxFieldUint) -> MaxFieldUint
Performs the %
operation. Read more
sourceimpl RemAssign<MaxFieldUint> for MaxFieldUint
impl RemAssign<MaxFieldUint> for MaxFieldUint
sourcefn rem_assign(&mut self, other: MaxFieldUint)
fn rem_assign(&mut self, other: MaxFieldUint)
Performs the %=
operation. Read more
sourceimpl Shl<u32> for MaxFieldUint
impl Shl<u32> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the <<
operator.
sourcefn shl(self, shift: u32) -> MaxFieldUint
fn shl(self, shift: u32) -> MaxFieldUint
Performs the <<
operation. Read more
sourceimpl<'a> Shl<u32> for &'a MaxFieldUint
impl<'a> Shl<u32> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the <<
operator.
sourcefn shl(self, shift: u32) -> MaxFieldUint
fn shl(self, shift: u32) -> MaxFieldUint
Performs the <<
operation. Read more
sourceimpl ShlAssign<u32> for MaxFieldUint
impl ShlAssign<u32> for MaxFieldUint
sourcefn shl_assign(&mut self, shift: u32)
fn shl_assign(&mut self, shift: u32)
Performs the <<=
operation. Read more
sourceimpl Shr<u32> for MaxFieldUint
impl Shr<u32> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the >>
operator.
sourcefn shr(self, shift: u32) -> MaxFieldUint
fn shr(self, shift: u32) -> MaxFieldUint
Performs the >>
operation. Read more
sourceimpl<'a> Shr<u32> for &'a MaxFieldUint
impl<'a> Shr<u32> for &'a MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the >>
operator.
sourcefn shr(self, shift: u32) -> MaxFieldUint
fn shr(self, shift: u32) -> MaxFieldUint
Performs the >>
operation. Read more
sourceimpl ShrAssign<u32> for MaxFieldUint
impl ShrAssign<u32> for MaxFieldUint
sourcefn shr_assign(&mut self, shift: u32)
fn shr_assign(&mut self, shift: u32)
Performs the >>=
operation. Read more
sourceimpl Sub<MaxFieldUint> for MaxFieldUint
impl Sub<MaxFieldUint> for MaxFieldUint
type Output = MaxFieldUint
type Output = MaxFieldUint
The resulting type after applying the -
operator.
sourcefn sub(self, other: MaxFieldUint) -> MaxFieldUint
fn sub(self, other: MaxFieldUint) -> MaxFieldUint
Performs the -
operation. Read more
sourceimpl SubAssign<MaxFieldUint> for MaxFieldUint
impl SubAssign<MaxFieldUint> for MaxFieldUint
sourcefn sub_assign(&mut self, other: MaxFieldUint)
fn sub_assign(&mut self, other: MaxFieldUint)
Performs the -=
operation. Read more
impl Copy for MaxFieldUint
impl Eq for MaxFieldUint
Auto Trait Implementations
impl RefUnwindSafe for MaxFieldUint
impl Send for MaxFieldUint
impl Sync for MaxFieldUint
impl Unpin for MaxFieldUint
impl UnwindSafe for MaxFieldUint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more