TryPartialOrd

Trait TryPartialOrd 

Source
pub trait TryPartialOrd<Rhs: ?Sized = Self>: TryPartialEq<Rhs> {
    // Required method
    fn try_partial_cmp(
        &self,
        other: &Rhs,
    ) -> Result<Option<Ordering>, Self::Error>;

    // Provided methods
    fn try_lt(&self, other: &Rhs) -> Result<bool, Self::Error> { ... }
    fn try_le(&self, other: &Rhs) -> Result<bool, Self::Error> { ... }
    fn try_gt(&self, other: &Rhs) -> Result<bool, Self::Error> { ... }
    fn try_ge(&self, other: &Rhs) -> Result<bool, Self::Error> { ... }
}
Expand description

The try trait for PartialOrd.

Required Methods§

Source

fn try_partial_cmp(&self, other: &Rhs) -> Result<Option<Ordering>, Self::Error>

The fallible equivalent of PartialOrd::partial_cmp.

Provided Methods§

Source

fn try_lt(&self, other: &Rhs) -> Result<bool, Self::Error>

The fallible equivalent of PartialOrd::lt.

Source

fn try_le(&self, other: &Rhs) -> Result<bool, Self::Error>

The fallible equivalent of PartialOrd::le.

Source

fn try_gt(&self, other: &Rhs) -> Result<bool, Self::Error>

The fallible equivalent of PartialOrd::gt.

Source

fn try_ge(&self, other: &Rhs) -> Result<bool, Self::Error>

The fallible equivalent of PartialOrd::gt.

Implementors§

Source§

impl<T: PartialOrd<Rhs>, Rhs: ?Sized> TryPartialOrd<Rhs> for T