Trait aint::SaturatingInto
source · pub trait SaturatingInto<T> {
// Required method
fn saturating_into(self) -> T;
}
Expand description
Saturating conversion from one type into another.
When the source value is too large to be represented by the destination type, resulting value is saturated to the bounds of the destination type.
Example:
let value: u8 = 1000.saturating_into();
assert_eq!(value, u8::MAX);