#[repr(transparent)]pub struct Num<Fp: PrimeField>(pub Fp);
Tuple Fields
0: Fp
Implementations
sourceimpl<Fp: PrimeField> Num<Fp>
impl<Fp: PrimeField> Num<Fp>
pub const ZERO: Self
pub const ONE: Self
pub const MODULUS: NumRepr<Fp::Inner>
pub const MODULUS_BITS: u32
pub fn is_even(&self) -> bool
pub fn is_odd(&self) -> bool
pub fn double(self) -> Self
pub fn square(self) -> Self
pub fn new(n: Fp) -> Self
pub fn checked_inv(self) -> Option<Self>
pub fn is_zero(self) -> bool
pub fn from_uint(v: NumRepr<Fp::Inner>) -> Option<Self>
pub fn from_uint_reduced(v: NumRepr<Fp::Inner>) -> Self
pub fn from_mont_uint(v: NumRepr<Fp::Inner>) -> Option<Self>
pub fn from_uint_unchecked(v: NumRepr<Fp::Inner>) -> Self
pub fn from_mont_uint_unchecked(v: NumRepr<Fp::Inner>) -> Self
pub fn sqrt(&self) -> Option<Self>
pub fn even_sqrt(&self) -> Option<Self>
pub fn to_uint(&self) -> NumRepr<Fp::Inner>
pub fn to_mont_uint(&self) -> NumRepr<Fp::Inner>
pub fn as_mont_uint(&self) -> &NumRepr<Fp::Inner>
pub fn as_mont_uint_mut(&mut self) -> &mut NumRepr<Fp::Inner>
pub fn to_other<Fq: PrimeField>(&self) -> Option<Num<Fq>>
pub fn to_other_reduced<Fq: PrimeField>(&self) -> Num<Fq>
Trait Implementations
sourceimpl<'macro_lifetime, U: PrimeField> Add<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> Add<&'macro_lifetime Num<U>> for Num<U>
sourceimpl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Add<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
impl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Add<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
sourceimpl<U: PrimeField> Add<Num<U>> for Num<U>
impl<U: PrimeField> Add<Num<U>> for Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> Add<Num<U>> for &'macro_lifetime Num<U>
impl<'macro_lifetime, U: PrimeField> Add<Num<U>> for &'macro_lifetime Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> AddAssign<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> AddAssign<&'macro_lifetime Num<U>> for Num<U>
sourcefn add_assign(&mut self, other: &'macro_lifetime Num<U>)
fn add_assign(&mut self, other: &'macro_lifetime Num<U>)
Performs the +=
operation. Read more
sourceimpl<U: PrimeField> AddAssign<Num<U>> for Num<U>
impl<U: PrimeField> AddAssign<Num<U>> for Num<U>
sourcefn add_assign(&mut self, other: Num<U>)
fn add_assign(&mut self, other: Num<U>)
Performs the +=
operation. Read more
sourceimpl<Fp: PrimeField> BitIterBE for Num<Fp>
impl<Fp: PrimeField> BitIterBE for Num<Fp>
type Iter = BitIteratorBE<Fp::Inner>
fn bit_iter_be(&self) -> Self::Iter
sourceimpl<Fp: PrimeField> BitIterLE for Num<Fp>
impl<Fp: PrimeField> BitIterLE for Num<Fp>
type Iter = BitIteratorLE<Fp::Inner>
fn bit_iter_le(&self) -> Self::Iter
sourceimpl<Fp: PrimeField> BorshDeserialize for Num<Fp>
impl<Fp: PrimeField> BorshDeserialize for Num<Fp>
sourceimpl<Fp: PrimeField> BorshSerialize for Num<Fp>
impl<Fp: PrimeField> BorshSerialize for Num<Fp>
sourceimpl<Fp: Clone + PrimeField> Clone for Num<Fp>
impl<Fp: Clone + PrimeField> Clone for Num<Fp>
sourceimpl<Fp: PrimeField> Debug for Num<Fp>
impl<Fp: PrimeField> Debug for Num<Fp>
sourceimpl<'de, Fp: PrimeField> Deserialize<'de> for Num<Fp>
impl<'de, Fp: PrimeField> Deserialize<'de> for Num<Fp>
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<Fp: PrimeField> Display for Num<Fp>
impl<Fp: PrimeField> Display for Num<Fp>
sourceimpl<'macro_lifetime, U: PrimeField> Div<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> Div<&'macro_lifetime Num<U>> for Num<U>
sourceimpl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Div<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
impl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Div<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
sourceimpl<U: PrimeField> Div<Num<U>> for Num<U>
impl<U: PrimeField> Div<Num<U>> for Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> Div<Num<U>> for &'macro_lifetime Num<U>
impl<'macro_lifetime, U: PrimeField> Div<Num<U>> for &'macro_lifetime Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> DivAssign<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> DivAssign<&'macro_lifetime Num<U>> for Num<U>
sourcefn div_assign(&mut self, other: &'macro_lifetime Num<U>)
fn div_assign(&mut self, other: &'macro_lifetime Num<U>)
Performs the /=
operation. Read more
sourceimpl<U: PrimeField> DivAssign<Num<U>> for Num<U>
impl<U: PrimeField> DivAssign<Num<U>> for Num<U>
sourcefn div_assign(&mut self, other: Num<U>)
fn div_assign(&mut self, other: Num<U>)
Performs the /=
operation. Read more
sourceimpl<Fp: PrimeField> From<&'static str> for Num<Fp>
impl<Fp: PrimeField> From<&'static str> for Num<Fp>
sourceimpl<Fp: PrimeField> From<bool> for Num<Fp>
impl<Fp: PrimeField> From<bool> for Num<Fp>
sourceimpl<Fp: PrimeField> From<i128> for Num<Fp>
impl<Fp: PrimeField> From<i128> for Num<Fp>
sourceimpl<Fp: PrimeField> From<i16> for Num<Fp>
impl<Fp: PrimeField> From<i16> for Num<Fp>
sourceimpl<Fp: PrimeField> From<i32> for Num<Fp>
impl<Fp: PrimeField> From<i32> for Num<Fp>
sourceimpl<Fp: PrimeField> From<i64> for Num<Fp>
impl<Fp: PrimeField> From<i64> for Num<Fp>
sourceimpl<Fp: PrimeField> From<i8> for Num<Fp>
impl<Fp: PrimeField> From<i8> for Num<Fp>
sourceimpl<Fp: PrimeField> From<u128> for Num<Fp>
impl<Fp: PrimeField> From<u128> for Num<Fp>
sourceimpl<Fp: PrimeField> From<u16> for Num<Fp>
impl<Fp: PrimeField> From<u16> for Num<Fp>
sourceimpl<Fp: PrimeField> From<u32> for Num<Fp>
impl<Fp: PrimeField> From<u32> for Num<Fp>
sourceimpl<Fp: PrimeField> From<u64> for Num<Fp>
impl<Fp: PrimeField> From<u64> for Num<Fp>
sourceimpl<Fp: PrimeField> From<u8> for Num<Fp>
impl<Fp: PrimeField> From<u8> for Num<Fp>
sourceimpl<Fp: PrimeField> FromStr for Num<Fp>
impl<Fp: PrimeField> FromStr for Num<Fp>
sourceimpl<'macro_lifetime, U: PrimeField> Mul<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> Mul<&'macro_lifetime Num<U>> for Num<U>
sourceimpl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Mul<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
impl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Mul<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
sourceimpl<U: PrimeField> Mul<Num<U>> for Num<U>
impl<U: PrimeField> Mul<Num<U>> for Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> Mul<Num<U>> for &'macro_lifetime Num<U>
impl<'macro_lifetime, U: PrimeField> Mul<Num<U>> for &'macro_lifetime Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> MulAssign<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> MulAssign<&'macro_lifetime Num<U>> for Num<U>
sourcefn mul_assign(&mut self, other: &'macro_lifetime Num<U>)
fn mul_assign(&mut self, other: &'macro_lifetime Num<U>)
Performs the *=
operation. Read more
sourceimpl<U: PrimeField> MulAssign<Num<U>> for Num<U>
impl<U: PrimeField> MulAssign<Num<U>> for Num<U>
sourcefn mul_assign(&mut self, other: Num<U>)
fn mul_assign(&mut self, other: Num<U>)
Performs the *=
operation. Read more
sourceimpl<U: PrimeField> Neg for Num<U>
impl<U: PrimeField> Neg for Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> Neg for &'macro_lifetime Num<U>
impl<'macro_lifetime, U: PrimeField> Neg for &'macro_lifetime Num<U>
sourceimpl<Fp: PrimeField> PartialEq<Num<Fp>> for Num<Fp>
impl<Fp: PrimeField> PartialEq<Num<Fp>> for Num<Fp>
sourceimpl<Fp: PrimeField> RefCast for Num<Fp>
impl<Fp: PrimeField> RefCast for Num<Fp>
sourceimpl<Fp: PrimeField> SeedBoxGen<Num<Fp>> for SeedboxChaCha20
impl<Fp: PrimeField> SeedBoxGen<Num<Fp>> for SeedboxChaCha20
sourceimpl<Fp: PrimeField> Serialize for Num<Fp>
impl<Fp: PrimeField> Serialize for Num<Fp>
sourceimpl<'macro_lifetime, U: PrimeField> Sub<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> Sub<&'macro_lifetime Num<U>> for Num<U>
sourceimpl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Sub<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
impl<'macro_lifetime_a, 'macro_lifetime_b, U: PrimeField> Sub<&'macro_lifetime_a Num<U>> for &'macro_lifetime_b Num<U>
sourceimpl<U: PrimeField> Sub<Num<U>> for Num<U>
impl<U: PrimeField> Sub<Num<U>> for Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> Sub<Num<U>> for &'macro_lifetime Num<U>
impl<'macro_lifetime, U: PrimeField> Sub<Num<U>> for &'macro_lifetime Num<U>
sourceimpl<'macro_lifetime, U: PrimeField> SubAssign<&'macro_lifetime Num<U>> for Num<U>
impl<'macro_lifetime, U: PrimeField> SubAssign<&'macro_lifetime Num<U>> for Num<U>
sourcefn sub_assign(&mut self, other: &'macro_lifetime Num<U>)
fn sub_assign(&mut self, other: &'macro_lifetime Num<U>)
Performs the -=
operation. Read more
sourceimpl<U: PrimeField> SubAssign<Num<U>> for Num<U>
impl<U: PrimeField> SubAssign<Num<U>> for Num<U>
sourcefn sub_assign(&mut self, other: Num<U>)
fn sub_assign(&mut self, other: Num<U>)
Performs the -=
operation. Read more
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for bool
impl<Fp: PrimeField> TryFrom<Num<Fp>> for bool
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for u8
impl<Fp: PrimeField> TryFrom<Num<Fp>> for u8
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for i128
impl<Fp: PrimeField> TryFrom<Num<Fp>> for i128
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for u16
impl<Fp: PrimeField> TryFrom<Num<Fp>> for u16
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for u32
impl<Fp: PrimeField> TryFrom<Num<Fp>> for u32
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for u64
impl<Fp: PrimeField> TryFrom<Num<Fp>> for u64
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for u128
impl<Fp: PrimeField> TryFrom<Num<Fp>> for u128
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for i8
impl<Fp: PrimeField> TryFrom<Num<Fp>> for i8
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for i16
impl<Fp: PrimeField> TryFrom<Num<Fp>> for i16
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for i32
impl<Fp: PrimeField> TryFrom<Num<Fp>> for i32
sourceimpl<Fp: PrimeField> TryFrom<Num<Fp>> for i64
impl<Fp: PrimeField> TryFrom<Num<Fp>> for i64
impl<Fp: Copy + PrimeField> Copy for Num<Fp>
impl<Fp: PrimeField> Eq for Num<Fp>
Auto Trait Implementations
impl<Fp> RefUnwindSafe for Num<Fp> where
Fp: RefUnwindSafe,
impl<Fp> Send for Num<Fp> where
Fp: Send,
impl<Fp> Sync for Num<Fp> where
Fp: Sync,
impl<Fp> Unpin for Num<Fp> where
Fp: Unpin,
impl<Fp> UnwindSafe for Num<Fp> where
Fp: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Out, S> FromSeed<S> for Out where
S: SeedBoxGen<Out>,
impl<Out, S> FromSeed<S> for Out where
S: SeedBoxGen<Out>,
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more