pub trait NumCast<From> {
// Required method
fn num_cast_from(val: From) -> Self;
}
Expand description
A trait that represents potentially lossy numeric cast.
Is a drop-in replacement of as _
in a generic code.
Required Methods§
fn num_cast_from(val: From) -> Self
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.