pub trait MulSemigroup:
Mul<Output = Self>
+ Associative
+ Clone { }Expand description
Represents a Multiplicative Semigroup.
A semigroup is an algebraic structure with a single associative binary operation. Unlike a monoid, a semigroup does NOT require an identity element.
§Mathematical Definition
A set S with a binary operation * is a multiplicative semigroup if:
- Closure:
a * bis inSfor alla, binS. (Implicit in Rust). - Associativity:
(a * b) * c = a * (b * c)for alla, b, cinS.
§Hierarchy
Magma (closure only)
↓
Semigroup (+ associativity)
↓
Monoid (+ identity)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.