ToMax

Trait ToMax 

Source
pub trait ToMax<T>:
    Sized
    + PartialEq
    + Copy {
    // Required method
    fn to_max() -> T;
}
Available on crate feature to_max only.
Expand description

Trait to implement upper bounds on types.

assert_eq!(<u8 as ToMax<u8>>::to_max(), u8::MAX);
assert_eq!(<u8 as ToMax<i16>>::to_max(), u8::MAX as i16);
assert_eq!(<u8 as ToMax<u32>>::to_max(), u8::MAX as u32);
assert_eq!(<u8 as ToMax<i64>>::to_max(), u8::MAX as i64);
assert_eq!(<u8 as ToMax<usize>>::to_max(), u8::MAX as usize);
assert_eq!(<u8 as ToMax<i128>>::to_max(), u8::MAX as i128);

Required Methods§

Source

fn to_max() -> T

Returns upper bounds of types.

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

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i8

Max value (i8) for type i8.

Source§

impl ToMax<i16> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i16

Max value (i8) for type i16.

Source§

impl ToMax<i16> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i16

Max value (i16) for type i16.

Source§

impl ToMax<i16> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i16

Max value (u8) for type i16.

Source§

impl ToMax<i32> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i32

Max value (i8) for type i32.

Source§

impl ToMax<i32> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i32

Max value (i16) for type i32.

Source§

impl ToMax<i32> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i32

Max value (i32) for type i32.

Source§

impl ToMax<i32> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i32

Max value (u8) for type i32.

Source§

impl ToMax<i32> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i32

Max value (u16) for type i32.

Source§

impl ToMax<i64> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (i8) for type i64.

Source§

impl ToMax<i64> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (i16) for type i64.

Source§

impl ToMax<i64> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (i32) for type i64.

Source§

impl ToMax<i64> for i64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (i64) for type i64.

Source§

impl ToMax<i64> for isize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (isize) for type i64.

Source§

impl ToMax<i64> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (u8) for type i64.

Source§

impl ToMax<i64> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (u16) for type i64.

Source§

impl ToMax<i64> for u32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i64

Max value (u32) for type i64.

Source§

impl ToMax<i128> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (i8) for type i128.

Source§

impl ToMax<i128> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (i16) for type i128.

Source§

impl ToMax<i128> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (i32) for type i128.

Source§

impl ToMax<i128> for i64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (i64) for type i128.

Source§

impl ToMax<i128> for i128

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (i128) for type i128.

Source§

impl ToMax<i128> for isize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (isize) for type i128.

Source§

impl ToMax<i128> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (u8) for type i128.

Source§

impl ToMax<i128> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (u16) for type i128.

Source§

impl ToMax<i128> for u32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (u32) for type i128.

Source§

impl ToMax<i128> for u64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (u64) for type i128.

Source§

impl ToMax<i128> for usize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> i128

Max value (usize) for type i128.

Source§

impl ToMax<isize> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (i8) for type isize.

Source§

impl ToMax<isize> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (i16) for type isize.

Source§

impl ToMax<isize> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (i32) for type isize.

Source§

impl ToMax<isize> for i64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (i64) for type isize.

Source§

impl ToMax<isize> for isize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (isize) for type isize.

Source§

impl ToMax<isize> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (u8) for type isize.

Source§

impl ToMax<isize> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (u16) for type isize.

Source§

impl ToMax<isize> for u32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> isize

Max value (u32) for type isize.

Source§

impl ToMax<u8> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u8

Max value (i8) for type u8.

Source§

impl ToMax<u8> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u8

Max value (u8) for type u8.

Source§

impl ToMax<u16> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u16

Max value (i8) for type u16.

Source§

impl ToMax<u16> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u16

Max value (i16) for type u16.

Source§

impl ToMax<u16> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u16

Max value (u8) for type u16.

Source§

impl ToMax<u16> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u16

Max value (u16) for type u16.

Source§

impl ToMax<u32> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u32

Max value (i8) for type u32.

Source§

impl ToMax<u32> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u32

Max value (i16) for type u32.

Source§

impl ToMax<u32> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u32

Max value (i32) for type u32.

Source§

impl ToMax<u32> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u32

Max value (u8) for type u32.

Source§

impl ToMax<u32> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u32

Max value (u16) for type u32.

Source§

impl ToMax<u32> for u32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u32

Max value (u32) for type u32.

Source§

impl ToMax<u64> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (i8) for type u64.

Source§

impl ToMax<u64> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (i16) for type u64.

Source§

impl ToMax<u64> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (i32) for type u64.

Source§

impl ToMax<u64> for i64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (i64) for type u64.

Source§

impl ToMax<u64> for isize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (isize) for type u64.

Source§

impl ToMax<u64> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (u8) for type u64.

Source§

impl ToMax<u64> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (u16) for type u64.

Source§

impl ToMax<u64> for u32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (u32) for type u64.

Source§

impl ToMax<u64> for u64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (u64) for type u64.

Source§

impl ToMax<u64> for usize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u64

Max value (usize) for type u64.

Source§

impl ToMax<u128> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (i8) for type u128.

Source§

impl ToMax<u128> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (i16) for type u128.

Source§

impl ToMax<u128> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (i32) for type u128.

Source§

impl ToMax<u128> for i64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (i64) for type u128.

Source§

impl ToMax<u128> for i128

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (i128) for type u128.

Source§

impl ToMax<u128> for isize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (isize) for type u128.

Source§

impl ToMax<u128> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (u8) for type u128.

Source§

impl ToMax<u128> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (u16) for type u128.

Source§

impl ToMax<u128> for u32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (u32) for type u128.

Source§

impl ToMax<u128> for u64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (u64) for type u128.

Source§

impl ToMax<u128> for u128

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (u128) for type u128.

Source§

impl ToMax<u128> for usize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> u128

Max value (usize) for type u128.

Source§

impl ToMax<usize> for i8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (i8) for type usize.

Source§

impl ToMax<usize> for i16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (i16) for type usize.

Source§

impl ToMax<usize> for i32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (i32) for type usize.

Source§

impl ToMax<usize> for i64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (i64) for type usize.

Source§

impl ToMax<usize> for isize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (isize) for type usize.

Source§

impl ToMax<usize> for u8

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (u8) for type usize.

Source§

impl ToMax<usize> for u16

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (u16) for type usize.

Source§

impl ToMax<usize> for u32

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (u32) for type usize.

Source§

impl ToMax<usize> for u64

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (u64) for type usize.

Source§

impl ToMax<usize> for usize

Available on crate features to_min or to_max or to_zero only.
Source§

fn to_max() -> usize

Max value (usize) for type usize.

Implementors§