pub trait AddOrdered: PartialOrd { }Expand description
A marker trait signifying that for x > y, x+z > x+z and z+x > z+x for all z
Note that for monoids with some negative or positive element x this
automatically means that the magma is infinite, as otherwise, there would be a
maximum element M and minimum m, contradicting M + x > M + 0 = M (if x > 0)
or m + x < m + 0 = m (if x < 0). (Of course, the bitwise representations of these
structures size limited by size, but in practice, we treat them as infinite anyway.)
Futhermore, for monoids and groups, this provides a way to embed the Naturals and Integers into the structure respectively, and if the structure also is an ordered semiring with one, then there is even a canonical embedding following both addition and multiplication rules
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.