Skip to main content

PartialOrder

Trait PartialOrder 

Source
pub trait PartialOrder<Rhs: ?Sized = Self>: PartialEq<Rhs> {
    // Required method
    fn less_equal(&self, other: &Rhs) -> bool;

    // Provided method
    fn less_than(&self, other: &Rhs) -> 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.

The partial order should be consistent with Eq, in the sense that if a == b then a.less_equal(b) and b.less_equal(a).

Required Methods§

Source

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

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

Provided Methods§

Source

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

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl PartialOrder for ()

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 i8

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 i32

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 i128

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 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 u32

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 u128

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<TOuter, TOuter2, TInner, TInner2> PartialOrder<(TOuter2, TInner2)> for (TOuter, TInner)
where TOuter: PartialOrder<TOuter2>, TInner: PartialOrder<TInner2>, (TOuter, TInner): PartialEq<(TOuter2, TInner2)>,

Implementors§

Source§

impl<T: PartialOrder> PartialOrder for Antichain<T>

Source§

impl<T: PartialOrder> PartialOrder for AntichainRef<'_, T>

Source§

impl<T: Timestamp> PartialOrder for Capability<T>

Source§

impl<TOuter, TOuter2, TInner, TInner2> PartialOrder<Product<TOuter2, TInner2>> for Product<TOuter, TInner>
where TOuter: PartialOrder<TOuter2>, TInner: PartialOrder<TInner2>, Self: PartialEq<Product<TOuter2, TInner2>>,