pub trait FieldOps:
Clone
+ Neg<Output = Self>
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Sum
+ Product
+ for<'a> Add<&'a Self, Output = Self>
+ for<'a> Sub<&'a Self, Output = Self>
+ for<'a> Mul<&'a Self, Output = Self>
+ for<'a> Sum<&'a Self>
+ for<'a> Product<&'a Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
+ for<'a> MulAssign<&'a Self>
+ Square
+ InvertOrZero {
type Scalar: Field;
// Required methods
fn zero() -> Self;
fn one() -> Self;
}Expand description
Operations for types that represent vectors of field elements.
This trait abstracts over:
Fieldtypes (single field elements, which are trivially vectors of length 1)PackedFieldtypes (SIMD-accelerated vectors of field elements)- Symbolic field types (for constraint system representations)
Mathematically, instances of this trait represent vectors of field elements where arithmetic operations like addition, subtraction, multiplication, squaring, and inversion are defined element-wise. For a packed field with width N, multiplying two values performs N independent field multiplications in parallel.
§Required Methods
Required Associated Types§
Required Methods§
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.