pub trait TruncateFromUnchecked<T> {
// Required method
fn truncate_from_unchecked(value: T) -> Self;
}
Required Methods§
Sourcefn truncate_from_unchecked(value: T) -> Self
fn truncate_from_unchecked(value: T) -> Self
Perform unchecked bitwise truncation
If the value fits into the Self
type, return that value.
Otherwise, return the low-order bits that do fit.
This has the same result as using as
to truncate (e.g. foo as u8
).
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.