Trait Max

Source
pub trait Max {
    const MAX: Self;
}
Expand description

Defines the maximum value of a type.

Required Associated Constants§

Source

const MAX: Self

The maximum value of 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 Max for bool

Source§

const MAX: bool = true

The maximum value of a bool: true.

Source§

impl Max for char

Source§

const MAX: char = '\u{10ffff}'

The maximum value of a char: '\u{10ffff}'.

This is a character in Supplementary Private Use Area-B.

Source§

impl Max for f32

The highest value representable by this type, positive infinity.

Source§

const MAX: f32 = +Inf_f32

Source§

impl Max for f64

The highest value representable by this type, positive infinity.

Source§

const MAX: f64 = +Inf_f64

Source§

impl Max for i8

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: i8 = 127i8

Source§

impl Max for i16

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: i16 = 32_767i16

Source§

impl Max for i32

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: i32 = 2_147_483_647i32

Source§

impl Max for i64

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: i64 = 9_223_372_036_854_775_807i64

Source§

impl Max for i128

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: i128 = 170_141_183_460_469_231_731_687_303_715_884_105_727i128

Source§

impl Max for isize

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: isize = 2_147_483_647isize

Source§

impl Max for u8

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: u8 = 255u8

Source§

impl Max for u16

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: u16 = 65_535u16

Source§

impl Max for u32

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: u32 = 4_294_967_295u32

Source§

impl Max for u64

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: u64 = 18_446_744_073_709_551_615u64

Source§

impl Max for u128

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: u128 = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

Source§

impl Max for usize

The highest value representable by this type.

If Self is unsigned, MAX is $2^W-1$. If Self is signed, MAX is $2^{W-1}-1$.

§Examples

See here.

Source§

const MAX: usize = 4_294_967_295usize

Implementors§