pub trait AdditiveGroup:
Eq
+ 'static
+ Sized
+ Copy
+ Clone
+ Default
+ Send
+ Sync
+ Hash
+ Debug
+ Display
+ Zeroize
+ Zero
+ Neg<Output = Self>
+ Add<Self, Output = Self>
+ Sub<Self, Output = Self>
+ Mul<Self::Scalar, Output = Self>
+ AddAssign<Self>
+ SubAssign<Self>
+ MulAssign<Self::Scalar>
+ for<'a> Add<&'a Self, Output = Self>
+ for<'a> Sub<&'a Self, Output = Self>
+ for<'a> Mul<&'a Self::Scalar, Output = Self>
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
+ for<'a> MulAssign<&'a Self::Scalar>
+ for<'a> Add<&'a mut Self, Output = Self>
+ for<'a> Sub<&'a mut Self, Output = Self>
+ for<'a> Mul<&'a mut Self::Scalar, Output = Self>
+ for<'a> AddAssign<&'a mut Self>
+ for<'a> SubAssign<&'a mut Self>
+ for<'a> MulAssign<&'a mut Self::Scalar>
+ Sum<Self>
+ for<'a> Sum<&'a Self> {
type Scalar: Field;
const ZERO: Self;
// Provided methods
fn double(&self) -> Self { ... }
fn double_in_place(&mut self) -> &mut Self { ... }
fn neg_in_place(&mut self) -> &mut Self { ... }
}Expand description
Defines an abstract group with additive notation. Support addition and subtraction with itself and multiplication by scalar. Scalar and group can be different types.
E.g., points on an elliptic curve define an additive group and can be multiplied by a scalar.
Required Associated Constants§
Required Associated Types§
Provided Methods§
Sourcefn double_in_place(&mut self) -> &mut Self
fn double_in_place(&mut self) -> &mut Self
Doubles self in place.
Sourcefn neg_in_place(&mut self) -> &mut Self
fn neg_in_place(&mut self) -> &mut Self
Negates self in place.
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.