A trait defining minimum and maximum bounds for numeric types. This trait only supports types that can have constant values.

Signature

pub trait Bounded

Trait constants

MIN

Returns the minimum value for type T.

Signature

const MIN: T;

Examples

use core::num::traits::Bounded;

let min = Bounded::::MIN;
assert!(min == 0);

MAX

Returns the maximum value for type T.

Signature

const MAX: T;

Examples

use core::num::traits::Bounded;

let max = Bounded::::MAX;
assert!(max == 255);