Trait PartialOrdAbs

Source
pub trait PartialOrdAbs<Rhs: ?Sized = Self> {
    // Required method
    fn partial_cmp_abs(&self, other: &Rhs) -> Option<Ordering>;

    // Provided methods
    fn lt_abs(&self, other: &Rhs) -> bool { ... }
    fn le_abs(&self, other: &Rhs) -> bool { ... }
    fn gt_abs(&self, other: &Rhs) -> bool { ... }
    fn ge_abs(&self, other: &Rhs) -> bool { ... }
}
Expand description

Determines equality between the absolute values of two numbers, where some pairs of numbers may not be comparable.

Required Methods§

Source

fn partial_cmp_abs(&self, other: &Rhs) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

If the two values are not comparable, None is returned.

Provided Methods§

Source

fn lt_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is less than the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

Source

fn le_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is less than or equal to the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

Source

fn gt_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is greater than the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

Source

fn ge_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is greater than or equal to the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

Implementations on Foreign Types§

Source§

impl PartialOrdAbs for f32

Source§

fn partial_cmp_abs(&self, other: &Self) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

For unsigned values, this is the same as ordinary comparison.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for f64

Source§

fn partial_cmp_abs(&self, other: &Self) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

For unsigned values, this is the same as ordinary comparison.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for i8

Source§

fn partial_cmp_abs(&self, other: &i8) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for i16

Source§

fn partial_cmp_abs(&self, other: &i16) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for i32

Source§

fn partial_cmp_abs(&self, other: &i32) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for i64

Source§

fn partial_cmp_abs(&self, other: &i64) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for i128

Source§

fn partial_cmp_abs(&self, other: &i128) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for isize

Source§

fn partial_cmp_abs(&self, other: &isize) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for u8

Source§

fn partial_cmp_abs(&self, other: &u8) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for u16

Source§

fn partial_cmp_abs(&self, other: &u16) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for u32

Source§

fn partial_cmp_abs(&self, other: &u32) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for u64

Source§

fn partial_cmp_abs(&self, other: &u64) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for u128

Source§

fn partial_cmp_abs(&self, other: &u128) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl PartialOrdAbs for usize

Source§

fn partial_cmp_abs(&self, other: &usize) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§