[][src]Trait ff_uint::Uint

pub trait Uint: Sized + Clone + Copy + Default + PartialEq + Eq + PartialOrd + Ord + From<bool> + From<u8> + From<u16> + From<u32> + From<u64> + From<u128> + From<i8> + From<i16> + From<i32> + From<i64> + From<i128> + TryInto<bool> + TryInto<u8> + TryInto<u16> + TryInto<u32> + TryInto<u64> + TryInto<u128> + TryInto<i8> + TryInto<i16> + TryInto<i32> + TryInto<i64> + TryInto<i128> + Hash + Debug + Display + FromStr + LowerHex + From<&'static str> + BorshSerialize + BorshDeserialize {
    type Inner: AsMut<[u64]> + AsRef<[u64]> + Copy + Clone + Default + Sized;

    const MAX: Self;
    const ZERO: Self;
    const ONE: Self;
    const NUM_WORDS: usize;
    const WORD_BITS: usize;

    fn random<R: Rng + ?Sized>(rng: &mut R) -> Self;
fn into_inner(self) -> Self::Inner;
fn as_inner(&self) -> &Self::Inner;
fn as_inner_mut(&mut self) -> &mut Self::Inner;
fn put_big_endian(&self, bytes: &mut [u8]);
fn put_little_endian(&self, bytes: &mut [u8]);
fn to_big_endian(&self) -> Vec<u8>;
fn to_little_endian(&self) -> Vec<u8>;
fn from_big_endian(slice: &[u8]) -> Self;
fn from_little_endian(slice: &[u8]) -> Self;
fn as_u64(&self) -> u64;
fn low_u64(&self) -> u64;
fn from_u64(v: u64) -> Self;
fn is_zero(&self) -> bool;
fn bits(&self) -> usize;
fn leading_zeros(&self) -> u32;
fn trailing_zeros(&self) -> u32;
fn div_mod(self, other: Self) -> (Self, Self);
fn overflowing_add(self, other: Self) -> (Self, bool);
fn overflowing_sub(self, other: Self) -> (Self, bool);
fn overflowing_mul_u64(self, other: u64) -> (Self, u64);
fn overflowing_mul(self, other: Self) -> (Self, bool);
fn overflowing_not(self) -> (Self, bool);
fn overflowing_bitand(self, other: Self) -> (Self, bool);
fn overflowing_bitor(self, other: Self) -> (Self, bool);
fn overflowing_bitxor(self, other: Self) -> (Self, bool);
fn overflowing_neg(self) -> (Self, bool);
fn overflowing_shr(self, other: u32) -> (Self, bool);
fn overflowing_shl(self, other: u32) -> (Self, bool);
fn wrapping_cmp(&self, other: &Self) -> Ordering; fn max_value() -> Self { ... }
fn min_value() -> Self { ... }
fn is_even(&self) -> bool { ... }
fn is_odd(&self) -> bool { ... }
fn bit(&self, n: usize) -> bool { ... }
fn overflowing_pow<S: BitIterBE>(self, exp: S) -> (Self, bool) { ... }
fn to_other<U: Uint>(self) -> Option<U> { ... }
fn unchecked_pow(self, other: Self) -> Self { ... }
fn unchecked_add(self, other: Self) -> Self { ... }
fn unchecked_sub(self, other: Self) -> Self { ... }
fn unchecked_mul(self, other: Self) -> Self { ... }
fn overflowing_div(self, other: Self) -> (Self, bool) { ... }
fn unchecked_div(self, other: Self) -> Self { ... }
fn overflowing_rem(self, other: Self) -> (Self, bool) { ... }
fn unchecked_rem(self, other: Self) -> Self { ... }
fn unchecked_neg(self) -> Self { ... }
fn unchecked_shr(self, rhs: u32) -> Self { ... }
fn unchecked_shl(self, lhs: u32) -> Self { ... }
fn wrapping_pow(self, other: Self) -> Self { ... }
fn wrapping_add(self, other: Self) -> Self { ... }
fn wrapping_sub(self, other: Self) -> Self { ... }
fn wrapping_mul(self, other: Self) -> Self { ... }
fn wrapping_div(self, other: Self) -> Self { ... }
fn wrapping_rem(self, other: Self) -> Self { ... }
fn wrapping_shl(self, other: u32) -> Self { ... }
fn wrapping_shr(self, other: u32) -> Self { ... }
fn wrapping_neg(self) -> Self { ... }
fn wrapping_not(self) -> Self { ... } }

Associated Types

Loading content...

Associated Constants

const MAX: Self

const ZERO: Self

const ONE: Self

const NUM_WORDS: usize

const WORD_BITS: usize

Loading content...

Required methods

fn random<R: Rng + ?Sized>(rng: &mut R) -> Self

fn into_inner(self) -> Self::Inner

fn as_inner(&self) -> &Self::Inner

fn as_inner_mut(&mut self) -> &mut Self::Inner

fn put_big_endian(&self, bytes: &mut [u8])

fn put_little_endian(&self, bytes: &mut [u8])

fn to_big_endian(&self) -> Vec<u8>

fn to_little_endian(&self) -> Vec<u8>

fn from_big_endian(slice: &[u8]) -> Self

fn from_little_endian(slice: &[u8]) -> Self

fn as_u64(&self) -> u64

fn low_u64(&self) -> u64

fn from_u64(v: u64) -> Self

fn is_zero(&self) -> bool

fn bits(&self) -> usize

fn leading_zeros(&self) -> u32

fn trailing_zeros(&self) -> u32

fn div_mod(self, other: Self) -> (Self, Self)

fn overflowing_add(self, other: Self) -> (Self, bool)

fn overflowing_sub(self, other: Self) -> (Self, bool)

fn overflowing_mul_u64(self, other: u64) -> (Self, u64)

fn overflowing_mul(self, other: Self) -> (Self, bool)

fn overflowing_not(self) -> (Self, bool)

fn overflowing_bitand(self, other: Self) -> (Self, bool)

fn overflowing_bitor(self, other: Self) -> (Self, bool)

fn overflowing_bitxor(self, other: Self) -> (Self, bool)

fn overflowing_neg(self) -> (Self, bool)

fn overflowing_shr(self, other: u32) -> (Self, bool)

fn overflowing_shl(self, other: u32) -> (Self, bool)

fn wrapping_cmp(&self, other: &Self) -> Ordering

Loading content...

Provided methods

fn max_value() -> Self

fn min_value() -> Self

fn is_even(&self) -> bool

fn is_odd(&self) -> bool

fn bit(&self, n: usize) -> bool

fn overflowing_pow<S: BitIterBE>(self, exp: S) -> (Self, bool)

fn to_other<U: Uint>(self) -> Option<U>

fn unchecked_pow(self, other: Self) -> Self

fn unchecked_add(self, other: Self) -> Self

fn unchecked_sub(self, other: Self) -> Self

fn unchecked_mul(self, other: Self) -> Self

fn overflowing_div(self, other: Self) -> (Self, bool)

Checked division. Returns None if other == 0.

fn unchecked_div(self, other: Self) -> Self

fn overflowing_rem(self, other: Self) -> (Self, bool)

fn unchecked_rem(self, other: Self) -> Self

fn unchecked_neg(self) -> Self

fn unchecked_shr(self, rhs: u32) -> Self

fn unchecked_shl(self, lhs: u32) -> Self

fn wrapping_pow(self, other: Self) -> Self

fn wrapping_add(self, other: Self) -> Self

fn wrapping_sub(self, other: Self) -> Self

fn wrapping_mul(self, other: Self) -> Self

fn wrapping_div(self, other: Self) -> Self

fn wrapping_rem(self, other: Self) -> Self

fn wrapping_shl(self, other: u32) -> Self

fn wrapping_shr(self, other: u32) -> Self

fn wrapping_neg(self) -> Self

fn wrapping_not(self) -> Self

Loading content...

Implementors

Loading content...