Skip to main content

AddMagma

Trait AddMagma 

Source
pub trait AddMagma:
    Add<Output = Self>
    + AddAssign
    + Clone
    + PartialEq { }
Expand description

An Additive Magma.

Definition: A set equipped with a binary operation +.

Requirements:

  1. Closure: If a and b are in the set, a + b is in the set.

It does NOT guarantee Associativity: (a + b) + c != a + (b + c). It does NOT guarantee Identity (Zero).

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> AddMagma for T
where T: Add<Output = Self> + AddAssign + Clone + PartialEq,