pub trait CastFrom<T: Copy>: Copy {
// Required methods
fn cast_from(value: T) -> Self;
fn cast_from_lossy(value: T) -> Self;
}
Required Methods§
Sourcefn cast_from_lossy(value: T) -> Self
fn cast_from_lossy(value: T) -> Self
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.