emath

Trait NumExt

Source
pub trait NumExt {
    // Required methods
    fn at_least(self, lower_limit: Self) -> Self;
    fn at_most(self, upper_limit: Self) -> Self;
}
Expand description

Extends f32, Vec2 etc with at_least and at_most as aliases for max and min.

Required Methods§

Source

fn at_least(self, lower_limit: Self) -> Self

More readable version of self.max(lower_limit)

Source

fn at_most(self, upper_limit: Self) -> Self

More readable version of self.min(upper_limit)

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 NumExt for f32

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for f64

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for i8

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for i16

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for i32

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for i64

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for i128

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for isize

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for u8

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for u16

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for u32

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for u64

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for u128

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Source§

impl NumExt for usize

Source§

fn at_least(self, lower_limit: Self) -> Self

Source§

fn at_most(self, upper_limit: Self) -> Self

Implementors§