pub trait CastInto<T: Copy>: Copy {
// Required methods
fn cast(self) -> T;
fn cast_lossy(self) -> T;
}
Expand description
Trait to express (possibly lossy) casting of integers
Required Methods§
Sourcefn cast_lossy(self) -> T
fn cast_lossy(self) -> T
Call for casts that are expected to truncate.
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.