Trait num_convert::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);