pub trait PartialOrder: Eq {
    // Required method
    fn less_equal(&self, other: &Self) -> bool;

    // Provided method
    fn less_than(&self, other: &Self) -> bool { ... }
}
Expand description

A type that is partially ordered.

This trait is distinct from Rust’s PartialOrd trait, because the implementation of that trait precludes a distinct Ord implementation. We need an independent trait if we want to have a partially ordered type that can also be sorted.

Required Methods§

source

fn less_equal(&self, other: &Self) -> bool

Returns true iff one element is less than or equal to the other.

Provided Methods§

source

fn less_than(&self, other: &Self) -> bool

Returns true iff one element is strictly less than the other.

Implementations on Foreign Types§

source§

impl PartialOrder for i128

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for i64

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for i8

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for isize

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for i16

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for Duration

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for u8

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for u16

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for u128

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for u64

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for usize

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for i32

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl<TOuter: PartialOrder, TInner: PartialOrder> PartialOrder for (TOuter, TInner)

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for u32

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

source§

impl PartialOrder for ()

source§

fn less_than(&self, other: &Self) -> bool

source§

fn less_equal(&self, other: &Self) -> bool

Implementors§