pub trait CastLossy<T: Sized = Self> {
// Required method
fn cast_lossy(&self) -> T;
}Expand description
Unary operator for casting values of one type to another, with lossy truncation.
Required Methods§
Sourcefn cast_lossy(&self) -> T
fn cast_lossy(&self) -> T
Casts the value of self into a value of type T, with lossy truncation.
This method makes a best-effort attempt to preserve all bits of information, but it is not guaranteed to do so.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".