Trait ToMax Copy item path 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);Returns upper bounds of types.
This trait is not dyn compatible .
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type i8.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type i16.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type i16.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type i16.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type i32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type i32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type i32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type i32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type i32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i64) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (isize) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u32) for type i64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i64) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i128) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (isize) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u32) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u64) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (usize) for type i128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i64) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (isize) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u32) for type isize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type u8.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type u8.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type u16.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type u16.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type u16.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type u16.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type u32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type u32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type u32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type u32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type u32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u32) for type u32.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i64) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (isize) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u32) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u64) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (usize) for type u64.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i64) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i128) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (isize) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u32) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u64) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u128) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (usize) for type u128.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i8) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i16) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i32) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (i64) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (isize) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u8) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u16) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u32) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (u64) for type usize.
Source § Available on crate features to_min or to_max or to_zero only.
Max value (usize) for type usize.