Skip to main content

OrdArithmetic

Trait OrdArithmetic 

Source
pub trait OrdArithmetic<T>: Arithmetic<T> {
    // Required method
    fn partial_cmp(&self, x: &T, y: &T) -> Option<Ordering>;
}
Expand description

Extends an Arithmetic with a comparison operation on values.

Required Methods§

Source

fn partial_cmp(&self, x: &T, y: &T) -> Option<Ordering>

Compares two values. Returns None if the numbers are not comparable, or the comparison result otherwise.

Trait Implementations§

Source§

impl<T> Debug for dyn OrdArithmetic<T> + '_

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, A> OrdArithmetic<T> for FullArithmetic<T, A>
where A: Arithmetic<T>,

Source§

impl<T, Kind> OrdArithmetic<T> for CheckedArithmetic<Kind>
where Self: Arithmetic<T>, T: PartialOrd,

Source§

impl<T> OrdArithmetic<T> for StdArithmetic
where Self: Arithmetic<T>, T: PartialOrd,

Source§

impl<T> OrdArithmetic<T> for WrappingArithmetic
where Self: Arithmetic<T>, T: PartialOrd,