Trait aint::WrappingFrom
source · pub trait WrappingFrom<T> {
// Required method
fn wrapping_from(value: T) -> Self;
}
Expand description
Wrapping conversion from one type into another.
When the source value is too large to be represented
by the destination type, the resulting value is
calculated by wrapping the source value as though
it were calculated with wrapping operations, such
as i32::wrapping_add
. In practice, the source value
is simply truncated, bitwise.
Example:
let value = u8::wrapping_from(0x1234);
assert_eq!(value, 0x34);
Required Methods§
fn wrapping_from(value: T) -> Self
Object Safety§
This trait is not object safe.