Skip to main content

MulMonoid

Trait MulMonoid 

Source
pub trait MulMonoid:
    MulMagma
    + One
    + Associative { }
Expand description

Represents a Multiplicative Monoid.

A monoid is an algebraic structure with a single associative binary operation and an identity element. A multiplicative monoid is one where the operation is multiplication (*).

§Mathematical Definition

A set S with a binary operation * is a multiplicative monoid if it satisfies:

  1. Closure: a * b is in S. (Implicit in Rust).
  2. Associativity: (a * b) * c = a * (b * c) for all a, b, c in S. (A property the implementor must uphold).
  3. Identity Element: There exists an element 1 in S such that a * 1 = 1 * a = a for all a in S. (Provided by the One trait).

The Clone and MulAssign bounds are included for practical purposes.

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.

Implementors§

Source§

impl<T> MulMonoid for T
where T: MulMagma + One + Associative,