cosmic::cosmic_theme::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: f32) -> f32

source§

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

source§

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

source§

impl MinMax for f64

source§

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

source§

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

source§

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

source§

impl MinMax for u8

source§

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

source§

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

source§

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

source§

impl MinMax for u16

source§

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

source§

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

source§

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

source§

impl MinMax for u32

source§

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

source§

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

source§

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

source§

impl MinMax for u64

source§

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

source§

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

source§

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

source§

impl MinMax for u128

source§

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

source§

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

source§

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

Implementors§