[−][src]Struct r1cs::Element
An element of a prime field.
Methods
impl<F: Field> Element<F>
[src]
pub fn zero() -> Self
[src]
pub fn one() -> Self
[src]
pub fn largest_element() -> Self
[src]
pub fn to_biguint(&self) -> &BigUint
[src]
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) -> Self
[src]
pub fn multiplicative_inverse_or_zero(&self) -> Self
[src]
Like multiplicative_inverse
, except that zero is mapped to itself rather than causing a
panic.
pub fn exponentiation(&self, power: &Self) -> Self
[src]
pub fn integer_division(&self, rhs: &Self) -> Self
[src]
pub fn integer_modulus(&self, rhs: &Self) -> Self
[src]
pub fn gcd(&self, rhs: &Self) -> Self
[src]
pub fn is_prime(&self) -> bool
[src]
pub fn max_bits() -> usize
[src]
The number of bits needed to encode every element of F
.
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. Return false for outside of range.
Trait Implementations
impl<F: Field> From<Element<F>> for Expression<F>
[src]
impl<'_, F: Field> From<&'_ Element<F>> for Expression<F>
[src]
impl<F: Field> From<BigUint> for Element<F>
[src]
impl<F: Field> From<usize> for Element<F>
[src]
impl<F: Field> From<u128> for Element<F>
[src]
impl<F: Field> From<u64> for Element<F>
[src]
impl<F: Field> From<u32> for Element<F>
[src]
impl<F: Field> From<u16> for Element<F>
[src]
impl<F: Field> From<u8> for Element<F>
[src]
impl<F: Field> From<bool> for Element<F>
[src]
impl<F: Field> Clone for Element<F>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F: Field> PartialOrd<Element<F>> for Element<F>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<F: Field> Eq for Element<F>
[src]
impl<F: Field> Ord for Element<F>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<F: Field> PartialEq<Element<F>> for Element<F>
[src]
impl<F: Debug + Field> Debug for Element<F>
[src]
impl<F: Field> Display for Element<F>
[src]
impl<F: Field> Sub<Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Sub<&'_ Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Sub<Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, '_, F: Field> Sub<&'_ Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Element<F>) -> Element<F>
[src]
impl<F: Field> Div<Element<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the /
operator.
fn div(self, rhs: Element<F>) -> Expression<F>
[src]
impl<'_, F: Field> Div<&'_ Element<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the /
operator.
fn div(self, rhs: &Element<F>) -> Expression<F>
[src]
impl<'_, F: Field> Div<Element<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the /
operator.
fn div(self, rhs: Element<F>) -> Expression<F>
[src]
impl<'_, '_, F: Field> Div<&'_ Element<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the /
operator.
fn div(self, rhs: &Element<F>) -> Expression<F>
[src]
impl<F: Field> Div<Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the /
operator.
fn div(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Div<&'_ Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the /
operator.
fn div(self, rhs: &Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Div<Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the /
operator.
fn div(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, '_, F: Field> Div<&'_ Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the /
operator.
fn div(self, rhs: &Element<F>) -> Element<F>
[src]
impl<F: Field> Div<u128> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the /
operator.
fn div(self, rhs: u128) -> Element<F>
[src]
impl<'_, F: Field> Div<u128> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the /
operator.
fn div(self, rhs: u128) -> Element<F>
[src]
impl<F: Field> Add<Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the +
operator.
fn add(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Add<&'_ Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the +
operator.
fn add(self, rhs: &Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Add<Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the +
operator.
fn add(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, '_, F: Field> Add<&'_ Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the +
operator.
fn add(self, rhs: &Element<F>) -> Element<F>
[src]
impl<F: Field> Mul<Element<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: Element<F>) -> Expression<F>
[src]
impl<'_, F: Field> Mul<&'_ Element<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Element<F>) -> Expression<F>
[src]
impl<'_, F: Field> Mul<Element<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: Element<F>) -> Expression<F>
[src]
impl<'_, '_, F: Field> Mul<&'_ Element<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Element<F>) -> Expression<F>
[src]
impl<F: Field> Mul<Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Mul<&'_ Element<F>> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Element<F>) -> Element<F>
[src]
impl<'_, F: Field> Mul<Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: Element<F>) -> Element<F>
[src]
impl<'_, '_, F: Field> Mul<&'_ Element<F>> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Element<F>) -> Element<F>
[src]
impl<F: Field> Mul<u128> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: u128) -> Element<F>
[src]
impl<'_, F: Field> Mul<u128> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: u128) -> Element<F>
[src]
impl<F: Field> Neg for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the -
operator.
fn neg(self) -> Element<F>
[src]
impl<'_, F: Field> Neg for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the -
operator.
fn neg(self) -> Element<F>
[src]
impl<F: Field> AddAssign<Element<F>> for Element<F>
[src]
fn add_assign(&mut self, rhs: Element<F>)
[src]
impl<'_, F: Field> AddAssign<&'_ Element<F>> for Element<F>
[src]
fn add_assign(&mut self, rhs: &Element<F>)
[src]
impl<F: Field> SubAssign<Element<F>> for Element<F>
[src]
fn sub_assign(&mut self, rhs: Element<F>)
[src]
impl<'_, F: Field> SubAssign<&'_ Element<F>> for Element<F>
[src]
fn sub_assign(&mut self, rhs: &Element<F>)
[src]
impl<F: Field> MulAssign<Element<F>> for Expression<F>
[src]
fn mul_assign(&mut self, rhs: Element<F>)
[src]
impl<'_, F: Field> MulAssign<&'_ Element<F>> for Expression<F>
[src]
fn mul_assign(&mut self, rhs: &Element<F>)
[src]
impl<F: Field> MulAssign<Element<F>> for Element<F>
[src]
fn mul_assign(&mut self, rhs: Element<F>)
[src]
impl<'_, F: Field> MulAssign<&'_ Element<F>> for Element<F>
[src]
fn mul_assign(&mut self, rhs: &Element<F>)
[src]
impl<F: Field> MulAssign<u128> for Element<F>
[src]
fn mul_assign(&mut self, rhs: u128)
[src]
impl<F: Field> DivAssign<Element<F>> for Expression<F>
[src]
fn div_assign(&mut self, rhs: Element<F>)
[src]
impl<'_, F: Field> DivAssign<&'_ Element<F>> for Expression<F>
[src]
fn div_assign(&mut self, rhs: &Element<F>)
[src]
impl<F: Field> DivAssign<Element<F>> for Element<F>
[src]
fn div_assign(&mut self, rhs: Element<F>)
[src]
impl<'_, F: Field> DivAssign<&'_ Element<F>> for Element<F>
[src]
fn div_assign(&mut self, rhs: &Element<F>)
[src]
impl<F: Field> DivAssign<u128> for Element<F>
[src]
fn div_assign(&mut self, rhs: u128)
[src]
impl<F: Field> Shl<usize> for Element<F>
[src]
type Output = Element<F>
The resulting type after applying the <<
operator.
fn shl(self, rhs: usize) -> Element<F>
[src]
impl<'_, F: Field> Shl<usize> for &'_ Element<F>
[src]
type Output = Element<F>
The resulting type after applying the <<
operator.
fn shl(self, rhs: usize) -> Element<F>
[src]
impl<F: Field> Hash for Element<F>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<F: Field> FromStr for Element<F>
[src]
Auto Trait Implementations
impl<F> !Send for Element<F>
impl<F> !Sync for Element<F>
impl<F> Unpin for Element<F>
impl<F> UnwindSafe for Element<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> RefUnwindSafe for Element<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,