pub trait _:
Sized
+ 'static
+ ToBits
+ ToBytes
+ FromBytes
+ Copy
+ Clone
+ Debug
+ Display
+ Default
+ Send
+ Sync
+ Eq
+ One<Output = Self, Output = Self>
+ Ord
+ Neg<Output = Self>
+ Uniform
+ Zero
+ Hash
+ From<u128>
+ From<u64>
+ From<u32>
+ From<u16>
+ From<u8>
+ Add<Output = Self, Output = Self>
+ Sub<Output = Self, Output = Self>
+ Mul
+ Div<Output = Self, Output = Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ DivAssign
+ for<'a> Add<&'a Self>
+ for<'a> Sub<&'a Self>
+ for<'a> Mul<&'a Self>
+ for<'a> Div<&'a Self>
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
+ for<'a> MulAssign<&'a Self>
+ for<'a> DivAssign<&'a Self>
+ Sum
+ for<'a> Sum<&'a Self>
+ Product
+ for<'a> Product<&'a Self>
+ CanonicalSerialize
+ CanonicalSerializeWithFlags
+ CanonicalDeserialize
+ CanonicalDeserializeWithFlags
+ Serialize
+ for<'a> Deserialize<'a> {
type BasePrimeField: PrimeField;
Show 14 methods
// Required methods
fn from_base_prime_field(other: Self::BasePrimeField) -> Self;
fn characteristic<'a>() -> &'a [u64];
fn double(&self) -> Self;
fn double_in_place(&mut self);
fn square(&self) -> Self;
fn square_in_place(&mut self) -> &mut Self;
fn inverse(&self) -> Option<Self>;
fn inverse_in_place(&mut self) -> Option<&mut Self>;
fn frobenius_map(&mut self, power: usize);
fn from_random_bytes_with_flags<F>(bytes: &[u8]) -> Option<(Self, F)>
where F: Flags;
// Provided methods
fn half() -> Self { ... }
fn sum_of_products<'a>(
a: impl Iterator<Item = &'a Self> + Clone,
b: impl Iterator<Item = &'a Self> + Clone,
) -> Self { ... }
fn pow<S>(&self, exp: S) -> Self
where S: AsRef<[u64]> { ... }
fn from_random_bytes(bytes: &[u8]) -> Option<Self> { ... }
}
Expand description
The interface for a generic field.
Required Associated Types§
Required Methods§
Sourcefn from_base_prime_field(other: Self::BasePrimeField) -> Self
fn from_base_prime_field(other: Self::BasePrimeField) -> Self
Constructs an element of Self
from an element of the base
prime field.
Sourcefn characteristic<'a>() -> &'a [u64]
fn characteristic<'a>() -> &'a [u64]
Returns the characteristic of the field.
Sourcefn double_in_place(&mut self)
fn double_in_place(&mut self)
Doubles self
in place.
Sourcefn square_in_place(&mut self) -> &mut Self
fn square_in_place(&mut self) -> &mut Self
Squares self
in place.
Sourcefn inverse(&self) -> Option<Self>
fn inverse(&self) -> Option<Self>
Computes the multiplicative inverse of self
if self
is nonzero.
Sourcefn inverse_in_place(&mut self) -> Option<&mut Self>
fn inverse_in_place(&mut self) -> Option<&mut Self>
Sets self
to self
’s inverse if it exists. Otherwise it is a no-op.
Sourcefn frobenius_map(&mut self, power: usize)
fn frobenius_map(&mut self, power: usize)
Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism.
Sourcefn from_random_bytes_with_flags<F>(bytes: &[u8]) -> Option<(Self, F)>where
F: Flags,
fn from_random_bytes_with_flags<F>(bytes: &[u8]) -> Option<(Self, F)>where
F: Flags,
Returns a field element with an extra sign bit used for group parsing if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output.
Provided Methods§
fn sum_of_products<'a>( a: impl Iterator<Item = &'a Self> + Clone, b: impl Iterator<Item = &'a Self> + Clone, ) -> Self
Sourcefn pow<S>(&self, exp: S) -> Self
fn pow<S>(&self, exp: S) -> Self
Exponentiates this element by a number represented with u64
limbs,
least significant limb first.
Sourcefn from_random_bytes(bytes: &[u8]) -> Option<Self>
fn from_random_bytes(bytes: &[u8]) -> Option<Self>
Returns a field element if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.