pub trait BoundedCastFromInt<T>: SealedCast<T> {
// Required methods
fn wrapping_cast_from(value: T) -> Self;
fn saturating_cast_from(value: T) -> Self;
}Expand description
Conversion between integers, wrapping around or saturating at the target type’s boundaries.
Required Methods§
Sourcefn wrapping_cast_from(value: T) -> Self
fn wrapping_cast_from(value: T) -> Self
Converts value to this type, wrapping around at the boundary of the type.
Sourcefn saturating_cast_from(value: T) -> Self
fn saturating_cast_from(value: T) -> Self
Converts value to this type, saturating at the numeric bounds instead of overflowing.
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.