palette::num

Trait MinMax

source
pub trait MinMax: Sized {
    // Required methods
    fn min(self, other: Self) -> Self;
    fn max(self, other: Self) -> Self;
    fn min_max(self, other: Self) -> (Self, Self);
}
Expand description

Methods for getting the largest or smallest of two values.

Required Methods§

source

fn min(self, other: Self) -> Self

Return the smallest of self and other.

source

fn max(self, other: Self) -> Self

Return the largest of self and other.

source

fn min_max(self, other: Self) -> (Self, Self)

Return a pair of self and other, where the smallest is the first value and the largest is the second.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MinMax for f32

source§

fn max(self, other: Self) -> Self

source§

fn min(self, other: Self) -> Self

source§

fn min_max(self, other: Self) -> (Self, Self)

source§

impl MinMax for f64

source§

fn max(self, other: Self) -> Self

source§

fn min(self, other: Self) -> Self

source§

fn min_max(self, other: Self) -> (Self, Self)

source§

impl MinMax for u8

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

fn min_max(self, other: Self) -> (Self, Self)

source§

impl MinMax for u16

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

fn min_max(self, other: Self) -> (Self, Self)

source§

impl MinMax for u32

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

fn min_max(self, other: Self) -> (Self, Self)

source§

impl MinMax for u64

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

fn min_max(self, other: Self) -> (Self, Self)

source§

impl MinMax for u128

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

fn min_max(self, other: Self) -> (Self, Self)

Implementors§