PartialOrder

Trait PartialOrder 

Source
pub trait PartialOrder {
    // Required method
    fn part_cmp(&self, other: &Self) -> PartialOrdCompResult;

    // Provided methods
    fn is_greater_or_equal(&self, other: &Self) -> bool { ... }
    fn is_smaller_or_equal(&self, other: &Self) -> bool { ... }
}
Expand description

Trait for types implementing a partial order

This trait allows you to specify a custom partial order that does not conflict with the standard PartialOrd trait.

Required Methods§

Source

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Provided Methods§

Source

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

Check whether self is greater or equal to other in the partial order

Source

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

Check whether self is smaller or equal to other in the partial order

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PartialOrder for i8

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for i16

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for i32

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for i64

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for i128

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for u8

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for u16

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for u32

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for u64

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for u128

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl PartialOrder for usize

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl<T: PartialOrder> PartialOrder for Vec<T>

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Source§

impl<V: PartialOrder, K: Hash + Eq> PartialOrder for HashMap<K, V>

Source§

fn part_cmp(&self, other: &Self) -> PartialOrdCompResult

Implementors§