Skip to main content

MinMax

Trait MinMax 

Source
pub trait MinMax: PartialOrd + IsNonCmpValue {
    // Provided methods
    fn min(self, other: Self) -> Self
       where Self: Sized { ... }
    fn max(self, other: Self) -> Self
       where Self: Sized { ... }
    fn clamp(self, min: Self, max: Self) -> Self
       where Self: Sized { ... }
    fn min_opt(self, other: Option<Self>) -> Option<Self>
       where Self: Sized { ... }
    fn max_opt(self, other: Option<Self>) -> Option<Self>
       where Self: Sized { ... }
    fn clamp_opt(self, min: Option<Self>, max: Option<Self>) -> Option<Self>
       where Self: Sized { ... }
}

Provided Methods§

Source

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

Source

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

Source

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Source

fn min_opt(self, other: Option<Self>) -> Option<Self>
where Self: Sized,

Source

fn max_opt(self, other: Option<Self>) -> Option<Self>
where Self: Sized,

Source

fn clamp_opt(self, min: Option<Self>, max: Option<Self>) -> Option<Self>
where Self: Sized,

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 MinMax for &f32

Source§

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

Source§

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

Source§

impl MinMax for &f64

Source§

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

Source§

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

Source§

impl MinMax for &i8

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &i16

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &i32

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &i64

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &i128

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &isize

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &u8

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &u16

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &u32

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &u64

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &u128

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for &usize

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for f32

Source§

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

Source§

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

Source§

impl MinMax for f64

Source§

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

Source§

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

Source§

impl MinMax for i8

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for i16

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for i32

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for i64

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for i128

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for isize

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for u8

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for u16

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for u32

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for u64

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for u128

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl MinMax for usize

Source§

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

Source§

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

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl<T: MinMax> MinMax for Option<T>

Source§

fn min(self, other: Option<T>) -> Option<T>

Source§

fn max(self, other: Option<T>) -> Option<T>

Source§

fn clamp(self, min: Option<T>, max: Option<T>) -> Option<T>

Implementors§