[−][src]Struct rusty_gadgets::field_element::FieldElement
Methods
impl FieldElement
[src]
pub fn size() -> BigUint
[src]
The prime field size.
pub fn max_value() -> BigUint
[src]
pub fn max_bits() -> usize
[src]
The number of bits needed to encode every field element.
pub fn zero() -> Self
[src]
pub fn one() -> Self
[src]
pub fn neg_one() -> Self
[src]
The additive inverse of 1.
pub fn random(rng: &mut impl Rng) -> Self
[src]
Return a random field element, uniformly distributed in [0, size()).
pub fn is_zero(&self) -> bool
[src]
pub fn is_nonzero(&self) -> bool
[src]
pub fn is_one(&self) -> bool
[src]
pub fn multiplicative_inverse(&self) -> FieldElement
[src]
pub fn integer_division(&self, rhs: FieldElement) -> FieldElement
[src]
pub fn integer_modulus(&self, rhs: FieldElement) -> FieldElement
[src]
pub fn bits(&self) -> usize
[src]
The number of bits needed to encode this particular field element.
pub fn bit(&self, i: usize) -> bool
[src]
Return the i'th least significant bit. So, for example, x.bit(0) returns the least significant bit of x.
Trait Implementations
impl Ord for FieldElement
[src]
fn cmp(&self, other: &FieldElement) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl Eq for FieldElement
[src]
impl Clone for FieldElement
[src]
fn clone(&self) -> FieldElement
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd<FieldElement> for FieldElement
[src]
fn partial_cmp(&self, other: &FieldElement) -> Option<Ordering>
[src]
fn lt(&self, other: &FieldElement) -> bool
[src]
fn le(&self, other: &FieldElement) -> bool
[src]
fn gt(&self, other: &FieldElement) -> bool
[src]
fn ge(&self, other: &FieldElement) -> bool
[src]
impl PartialEq<FieldElement> for FieldElement
[src]
fn eq(&self, other: &FieldElement) -> bool
[src]
fn ne(&self, other: &FieldElement) -> bool
[src]
impl From<BigUint> for FieldElement
[src]
fn from(value: BigUint) -> FieldElement
[src]
impl From<u128> for FieldElement
[src]
fn from(value: u128) -> FieldElement
[src]
impl From<bool> for FieldElement
[src]
fn from(value: bool) -> FieldElement
[src]
impl From<FieldElement> for LinearCombination
[src]
fn from(value: FieldElement) -> Self
[src]
impl Display for FieldElement
[src]
impl Debug for FieldElement
[src]
impl FromStr for FieldElement
[src]
type Err = ParseBigIntError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Add<FieldElement> for FieldElement
[src]
type Output = FieldElement
The resulting type after applying the +
operator.
fn add(self, rhs: FieldElement) -> FieldElement
[src]
impl Sub<FieldElement> for FieldElement
[src]
type Output = FieldElement
The resulting type after applying the -
operator.
fn sub(self, rhs: FieldElement) -> FieldElement
[src]
impl Mul<FieldElement> for FieldElement
[src]
type Output = FieldElement
The resulting type after applying the *
operator.
fn mul(self, rhs: FieldElement) -> FieldElement
[src]
impl Mul<u128> for FieldElement
[src]
type Output = FieldElement
The resulting type after applying the *
operator.
fn mul(self, rhs: u128) -> FieldElement
[src]
impl Mul<FieldElement> for LinearCombination
[src]
type Output = LinearCombination
The resulting type after applying the *
operator.
fn mul(self, rhs: FieldElement) -> LinearCombination
[src]
impl Div<FieldElement> for FieldElement
[src]
type Output = FieldElement
The resulting type after applying the /
operator.
fn div(self, rhs: FieldElement) -> FieldElement
[src]
impl Neg for FieldElement
[src]
type Output = FieldElement
The resulting type after applying the -
operator.
fn neg(self) -> FieldElement
[src]
impl AddAssign<FieldElement> for FieldElement
[src]
fn add_assign(&mut self, rhs: FieldElement)
[src]
impl SubAssign<FieldElement> for FieldElement
[src]
fn sub_assign(&mut self, rhs: FieldElement)
[src]
impl MulAssign<FieldElement> for FieldElement
[src]
fn mul_assign(&mut self, rhs: FieldElement)
[src]
impl MulAssign<u128> for FieldElement
[src]
fn mul_assign(&mut self, rhs: u128)
[src]
impl MulAssign<FieldElement> for LinearCombination
[src]
fn mul_assign(&mut self, rhs: FieldElement)
[src]
impl Shl<usize> for FieldElement
[src]
type Output = FieldElement
The resulting type after applying the <<
operator.
fn shl(self, rhs: usize) -> FieldElement
[src]
impl Hash for FieldElement
[src]
Auto Trait Implementations
impl Send for FieldElement
impl Sync for FieldElement
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,