Trait PartialOrd

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

    // Provided methods
    fn op_lt(&self, other: &Rhs) -> bool { ... }
    fn op_le(&self, other: &Rhs) -> bool { ... }
    fn op_gt(&self, other: &Rhs) -> bool { ... }
    fn op_ge(&self, other: &Rhs) -> bool { ... }
}

Required Methods§

Provided Methods§

Source

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

This method tests less than (for self and other) and is used by the < operator.

§Examples
let result = 1.0 < 2.0;
assert_eq!(result, true);

let result = 2.0 < 1.0;
assert_eq!(result, false);
Source

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

This method tests less than or equal to (for self and other) and is used by the <= operator.

§Examples
let result = 1.0 <= 2.0;
assert_eq!(result, true);

let result = 2.0 <= 2.0;
assert_eq!(result, true);
Source

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

This method tests greater than (for self and other) and is used by the > operator.

§Examples
let result = 1.0 > 2.0;
assert_eq!(result, false);

let result = 2.0 > 2.0;
assert_eq!(result, false);
Source

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

This method tests greater than or equal to (for self and other) and is used by the >= operator.

§Examples
let result = 2.0 >= 1.0;
assert_eq!(result, true);

let result = 2.0 >= 2.0;
assert_eq!(result, true);

Implementations on Foreign Types§

Source§

impl PartialOrd for f32

Source§

impl PartialOrd for f64

Source§

impl PartialOrd for i8

Source§

impl PartialOrd for i16

Source§

impl PartialOrd for i32

Source§

impl PartialOrd for i64

Source§

impl PartialOrd for isize

Source§

impl PartialOrd for u8

Source§

impl PartialOrd for u16

Source§

impl PartialOrd for u32

Source§

impl PartialOrd for u64

Source§

impl PartialOrd for String

Source§

impl PartialOrd<&&Bson> for bool

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for f32

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for f64

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for i8

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for i16

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for i32

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for i64

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for isize

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for u8

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for u16

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for u32

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&&Bson> for u64

Source§

fn op_partial_cmp(&self, other: &&&Value) -> Option<Ordering>

Source§

impl PartialOrd<&Bson> for bool

Source§

impl PartialOrd<&Bson> for f32

Source§

impl PartialOrd<&Bson> for f64

Source§

impl PartialOrd<&Bson> for i8

Source§

impl PartialOrd<&Bson> for i16

Source§

impl PartialOrd<&Bson> for i32

Source§

impl PartialOrd<&Bson> for i64

Source§

impl PartialOrd<&Bson> for isize

Source§

impl PartialOrd<&Bson> for u8

Source§

impl PartialOrd<&Bson> for u16

Source§

impl PartialOrd<&Bson> for u32

Source§

impl PartialOrd<&Bson> for u64

Source§

impl PartialOrd<&f32> for &f32

Source§

impl PartialOrd<&f32> for f32

Source§

impl PartialOrd<&f64> for &f64

Source§

impl PartialOrd<&f64> for f64

Source§

impl PartialOrd<&i8> for &i8

Source§

impl PartialOrd<&i8> for i8

Source§

impl PartialOrd<&i16> for &i16

Source§

impl PartialOrd<&i16> for i16

Source§

impl PartialOrd<&i32> for &i32

Source§

impl PartialOrd<&i32> for i32

Source§

impl PartialOrd<&i64> for &i64

Source§

impl PartialOrd<&i64> for i64

Source§

impl PartialOrd<&isize> for &isize

Source§

impl PartialOrd<&isize> for isize

Source§

impl PartialOrd<&str> for &str

Source§

fn op_partial_cmp(&self, other: &&str) -> Option<Ordering>

Source§

impl PartialOrd<&u8> for &u8

Source§

impl PartialOrd<&u8> for u8

Source§

impl PartialOrd<&u16> for &u16

Source§

impl PartialOrd<&u16> for u16

Source§

impl PartialOrd<&u32> for &u32

Source§

impl PartialOrd<&u32> for u32

Source§

impl PartialOrd<&u64> for &u64

Source§

impl PartialOrd<&u64> for u64

Source§

impl PartialOrd<Bson> for bool

Source§

impl PartialOrd<Bson> for f32

Source§

impl PartialOrd<Bson> for f64

Source§

impl PartialOrd<Bson> for i8

Source§

impl PartialOrd<Bson> for i16

Source§

impl PartialOrd<Bson> for i32

Source§

impl PartialOrd<Bson> for i64

Source§

impl PartialOrd<Bson> for isize

Source§

impl PartialOrd<Bson> for u8

Source§

impl PartialOrd<Bson> for u16

Source§

impl PartialOrd<Bson> for u32

Source§

impl PartialOrd<Bson> for u64

Source§

impl PartialOrd<f32> for &f32

Source§

impl PartialOrd<f64> for &f64

Source§

impl PartialOrd<i8> for &i8

Source§

impl PartialOrd<i16> for &i16

Source§

impl PartialOrd<i32> for &i32

Source§

impl PartialOrd<i64> for &i64

Source§

impl PartialOrd<isize> for &isize

Source§

impl PartialOrd<u8> for &u8

Source§

impl PartialOrd<u16> for &u16

Source§

impl PartialOrd<u32> for &u32

Source§

impl PartialOrd<u64> for &u64

Source§

impl PartialOrd<String> for &String

Implementors§