GreatestElement

Trait GreatestElement 

Source
pub trait GreatestElement: PartialOrd + Sized {
    // Required method
    fn greatest() -> Self;

    // Provided method
    fn is_greatest(&self) -> bool { ... }
}
Expand description

A partial order with a greatest element (which is necessarily unique).

Required Methods§

Source

fn greatest() -> Self

Returns the unique greatest element.

For all values other of type Self, Self::greatest() >= other must be true.

Provided Methods§

Source

fn is_greatest(&self) -> bool

Returns true if and only if self is the greatest element.

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 GreatestElement for i8

Source§

fn greatest() -> Self

Source§

impl GreatestElement for i16

Source§

fn greatest() -> Self

Source§

impl GreatestElement for i32

Source§

fn greatest() -> Self

Source§

impl GreatestElement for i64

Source§

fn greatest() -> Self

Source§

impl GreatestElement for i128

Source§

fn greatest() -> Self

Source§

impl GreatestElement for isize

Source§

fn greatest() -> Self

Source§

impl GreatestElement for u8

Source§

fn greatest() -> Self

Source§

impl GreatestElement for u16

Source§

fn greatest() -> Self

Source§

impl GreatestElement for u32

Source§

fn greatest() -> Self

Source§

impl GreatestElement for u64

Source§

fn greatest() -> Self

Source§

impl GreatestElement for u128

Source§

fn greatest() -> Self

Source§

impl GreatestElement for usize

Source§

fn greatest() -> Self

Source§

impl<const N: usize, T> GreatestElement for [T; N]
where T: GreatestElement,

Source§

fn greatest() -> Self

Implementors§