Skip to main content

Integer

Trait Integer 

Source
pub trait Integer: Primitive + PrimInt {
    const MIN: Self;
    const MAX: Self;
    const ZERO: Self;
    const ONE: Self;
    const TWO: Self;

    // Provided method
    fn safe_clamp(self, min: Self, max: Self) -> Self { ... }
}

Required Associated Constants§

Source

const MIN: Self

Source

const MAX: Self

Source

const ZERO: Self

Source

const ONE: Self

Source

const TWO: Self

Provided Methods§

Source

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

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

Source§

const MIN: Self = i8::MIN

Source§

const MAX: Self = i8::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for i16

Source§

const MIN: Self = i16::MIN

Source§

const MAX: Self = i16::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for i32

Source§

const MIN: Self = i32::MIN

Source§

const MAX: Self = i32::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for i64

Source§

const MIN: Self = i64::MIN

Source§

const MAX: Self = i64::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for i128

Source§

const MIN: Self = i128::MIN

Source§

const MAX: Self = i128::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for u8

Source§

const MIN: Self = u8::MIN

Source§

const MAX: Self = u8::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for u16

Source§

const MIN: Self = u16::MIN

Source§

const MAX: Self = u16::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for u32

Source§

const MIN: Self = u32::MIN

Source§

const MAX: Self = u32::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for u64

Source§

const MIN: Self = u64::MIN

Source§

const MAX: Self = u64::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Source§

impl Integer for u128

Source§

const MIN: Self = u128::MIN

Source§

const MAX: Self = u128::MAX

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

const TWO: Self = 2

Source§

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

Implementors§