pub trait FloatToInt<Int>: Sized {
// Required methods
#[doc(hidden)] unsafe fn to_int_unchecked(self) -> Int;
#[doc(hidden)] fn to_int_saturating(self) -> Int;
#[doc(hidden)] fn to_int_checked(self) -> Option<Int>;
}ⓘ This trait cannot be implemented outside
core::convert::num.🔬This is a nightly-only experimental API. (
convert_float_to_int #67057)Expand description
Supporting trait for inherent methods of f32 and f64 such as to_int_unchecked.
Typically doesn’t need to be used directly.
Required Methods§
#[doc(hidden)]unsafe fn to_int_unchecked(self) -> Int
🔬This is a nightly-only experimental API. (
convert_float_to_int #67057)#[doc(hidden)]fn to_int_saturating(self) -> Int
🔬This is a nightly-only experimental API. (
float_conversions #159913)#[doc(hidden)]fn to_int_checked(self) -> Option<Int>
🔬This is a nightly-only experimental API. (
float_conversions #159913)Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".