pub trait AddGroup:
Add<Output = Self>
+ Sub<Output = Self>
+ Zero
+ Clone { }Expand description
Represents an Additive Group.
An additive group is a Group where the binary operation is addition (+).
§Mathematical Definition
A set G is a group under addition if it satisfies:
- Closure:
a + bis inG. (Implicit in Rust). - Associativity:
(a + b) + c = a + (b + c). (Implied byAddtrait). - Identity Element: There is an element
0such thata + 0 = a. (Provided by theZerotrait). - Inverse Element: For each
a, there is an inverse-asuch thata + (-a) = 0. (Provided by theSubtrait, which definesa - a).
The Clone bound is included for practical purposes within the Rust type system.
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.