pub trait StrictCast<T>: Sized {
// Required method
fn strict_cast(self) -> T;
}Expand description
Value-preserving conversion between any two integer types that panics on
overflow, even in release builds (std’s generic strict_cast).
Required Methods§
Sourcefn strict_cast(self) -> T
fn strict_cast(self) -> T
Converts self to the target type, panicking if the value doesn’t
fit.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".