Trait malachite_base::num::conversion::traits::WrappingFrom
source · pub trait WrappingFrom<T>: Sized {
// Required method
fn wrapping_from(value: T) -> Self;
}
Expand description
Converts a value from one type to another. where if the conversion is not exact the result will wrap around.
If WrappingFrom
is implemented, it usually makes sense to implement OverflowingFrom
as
well.
Required Methods§
fn wrapping_from(value: T) -> Self
Object Safety§
Implementations on Foreign Types§
source§impl WrappingFrom<i8> for i8
impl WrappingFrom<i8> for i8
source§impl WrappingFrom<i8> for i16
impl WrappingFrom<i8> for i16
source§impl WrappingFrom<i8> for i32
impl WrappingFrom<i8> for i32
source§impl WrappingFrom<i8> for i64
impl WrappingFrom<i8> for i64
source§impl WrappingFrom<i8> for i128
impl WrappingFrom<i8> for i128
source§impl WrappingFrom<i8> for isize
impl WrappingFrom<i8> for isize
source§impl WrappingFrom<i8> for u8
impl WrappingFrom<i8> for u8
source§fn wrapping_from(value: i8) -> u8
fn wrapping_from(value: i8) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i8> for u16
impl WrappingFrom<i8> for u16
source§fn wrapping_from(value: i8) -> u16
fn wrapping_from(value: i8) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i8> for u32
impl WrappingFrom<i8> for u32
source§fn wrapping_from(value: i8) -> u32
fn wrapping_from(value: i8) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i8> for u64
impl WrappingFrom<i8> for u64
source§fn wrapping_from(value: i8) -> u64
fn wrapping_from(value: i8) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i8> for u128
impl WrappingFrom<i8> for u128
source§fn wrapping_from(value: i8) -> u128
fn wrapping_from(value: i8) -> u128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i8> for usize
impl WrappingFrom<i8> for usize
source§fn wrapping_from(value: i8) -> usize
fn wrapping_from(value: i8) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i16> for i8
impl WrappingFrom<i16> for i8
source§fn wrapping_from(value: i16) -> i8
fn wrapping_from(value: i16) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i16> for i16
impl WrappingFrom<i16> for i16
source§impl WrappingFrom<i16> for i32
impl WrappingFrom<i16> for i32
source§impl WrappingFrom<i16> for i64
impl WrappingFrom<i16> for i64
source§impl WrappingFrom<i16> for i128
impl WrappingFrom<i16> for i128
source§impl WrappingFrom<i16> for isize
impl WrappingFrom<i16> for isize
source§impl WrappingFrom<i16> for u8
impl WrappingFrom<i16> for u8
source§fn wrapping_from(value: i16) -> u8
fn wrapping_from(value: i16) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i16> for u16
impl WrappingFrom<i16> for u16
source§fn wrapping_from(value: i16) -> u16
fn wrapping_from(value: i16) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i16> for u32
impl WrappingFrom<i16> for u32
source§fn wrapping_from(value: i16) -> u32
fn wrapping_from(value: i16) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i16> for u64
impl WrappingFrom<i16> for u64
source§fn wrapping_from(value: i16) -> u64
fn wrapping_from(value: i16) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i16> for u128
impl WrappingFrom<i16> for u128
source§fn wrapping_from(value: i16) -> u128
fn wrapping_from(value: i16) -> u128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i16> for usize
impl WrappingFrom<i16> for usize
source§fn wrapping_from(value: i16) -> usize
fn wrapping_from(value: i16) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for i8
impl WrappingFrom<i32> for i8
source§fn wrapping_from(value: i32) -> i8
fn wrapping_from(value: i32) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for i16
impl WrappingFrom<i32> for i16
source§fn wrapping_from(value: i32) -> i16
fn wrapping_from(value: i32) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for i32
impl WrappingFrom<i32> for i32
source§impl WrappingFrom<i32> for i64
impl WrappingFrom<i32> for i64
source§impl WrappingFrom<i32> for i128
impl WrappingFrom<i32> for i128
source§impl WrappingFrom<i32> for isize
impl WrappingFrom<i32> for isize
source§fn wrapping_from(value: i32) -> isize
fn wrapping_from(value: i32) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for u8
impl WrappingFrom<i32> for u8
source§fn wrapping_from(value: i32) -> u8
fn wrapping_from(value: i32) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for u16
impl WrappingFrom<i32> for u16
source§fn wrapping_from(value: i32) -> u16
fn wrapping_from(value: i32) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for u32
impl WrappingFrom<i32> for u32
source§fn wrapping_from(value: i32) -> u32
fn wrapping_from(value: i32) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for u64
impl WrappingFrom<i32> for u64
source§fn wrapping_from(value: i32) -> u64
fn wrapping_from(value: i32) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for u128
impl WrappingFrom<i32> for u128
source§fn wrapping_from(value: i32) -> u128
fn wrapping_from(value: i32) -> u128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i32> for usize
impl WrappingFrom<i32> for usize
source§fn wrapping_from(value: i32) -> usize
fn wrapping_from(value: i32) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for i8
impl WrappingFrom<i64> for i8
source§fn wrapping_from(value: i64) -> i8
fn wrapping_from(value: i64) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for i16
impl WrappingFrom<i64> for i16
source§fn wrapping_from(value: i64) -> i16
fn wrapping_from(value: i64) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for i32
impl WrappingFrom<i64> for i32
source§fn wrapping_from(value: i64) -> i32
fn wrapping_from(value: i64) -> i32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for i64
impl WrappingFrom<i64> for i64
source§impl WrappingFrom<i64> for i128
impl WrappingFrom<i64> for i128
source§impl WrappingFrom<i64> for isize
impl WrappingFrom<i64> for isize
source§fn wrapping_from(value: i64) -> isize
fn wrapping_from(value: i64) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for u8
impl WrappingFrom<i64> for u8
source§fn wrapping_from(value: i64) -> u8
fn wrapping_from(value: i64) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for u16
impl WrappingFrom<i64> for u16
source§fn wrapping_from(value: i64) -> u16
fn wrapping_from(value: i64) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for u32
impl WrappingFrom<i64> for u32
source§fn wrapping_from(value: i64) -> u32
fn wrapping_from(value: i64) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for u64
impl WrappingFrom<i64> for u64
source§fn wrapping_from(value: i64) -> u64
fn wrapping_from(value: i64) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for u128
impl WrappingFrom<i64> for u128
source§fn wrapping_from(value: i64) -> u128
fn wrapping_from(value: i64) -> u128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i64> for usize
impl WrappingFrom<i64> for usize
source§fn wrapping_from(value: i64) -> usize
fn wrapping_from(value: i64) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for i8
impl WrappingFrom<i128> for i8
source§fn wrapping_from(value: i128) -> i8
fn wrapping_from(value: i128) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for i16
impl WrappingFrom<i128> for i16
source§fn wrapping_from(value: i128) -> i16
fn wrapping_from(value: i128) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for i32
impl WrappingFrom<i128> for i32
source§fn wrapping_from(value: i128) -> i32
fn wrapping_from(value: i128) -> i32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for i64
impl WrappingFrom<i128> for i64
source§fn wrapping_from(value: i128) -> i64
fn wrapping_from(value: i128) -> i64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for i128
impl WrappingFrom<i128> for i128
source§impl WrappingFrom<i128> for isize
impl WrappingFrom<i128> for isize
source§fn wrapping_from(value: i128) -> isize
fn wrapping_from(value: i128) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for u8
impl WrappingFrom<i128> for u8
source§fn wrapping_from(value: i128) -> u8
fn wrapping_from(value: i128) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for u16
impl WrappingFrom<i128> for u16
source§fn wrapping_from(value: i128) -> u16
fn wrapping_from(value: i128) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for u32
impl WrappingFrom<i128> for u32
source§fn wrapping_from(value: i128) -> u32
fn wrapping_from(value: i128) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for u64
impl WrappingFrom<i128> for u64
source§fn wrapping_from(value: i128) -> u64
fn wrapping_from(value: i128) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for u128
impl WrappingFrom<i128> for u128
source§fn wrapping_from(value: i128) -> u128
fn wrapping_from(value: i128) -> u128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<i128> for usize
impl WrappingFrom<i128> for usize
source§fn wrapping_from(value: i128) -> usize
fn wrapping_from(value: i128) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for i8
impl WrappingFrom<isize> for i8
source§fn wrapping_from(value: isize) -> i8
fn wrapping_from(value: isize) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for i16
impl WrappingFrom<isize> for i16
source§fn wrapping_from(value: isize) -> i16
fn wrapping_from(value: isize) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for i32
impl WrappingFrom<isize> for i32
source§fn wrapping_from(value: isize) -> i32
fn wrapping_from(value: isize) -> i32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for i64
impl WrappingFrom<isize> for i64
source§fn wrapping_from(value: isize) -> i64
fn wrapping_from(value: isize) -> i64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for i128
impl WrappingFrom<isize> for i128
source§fn wrapping_from(value: isize) -> i128
fn wrapping_from(value: isize) -> i128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for isize
impl WrappingFrom<isize> for isize
source§impl WrappingFrom<isize> for u8
impl WrappingFrom<isize> for u8
source§fn wrapping_from(value: isize) -> u8
fn wrapping_from(value: isize) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for u16
impl WrappingFrom<isize> for u16
source§fn wrapping_from(value: isize) -> u16
fn wrapping_from(value: isize) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for u32
impl WrappingFrom<isize> for u32
source§fn wrapping_from(value: isize) -> u32
fn wrapping_from(value: isize) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for u64
impl WrappingFrom<isize> for u64
source§fn wrapping_from(value: isize) -> u64
fn wrapping_from(value: isize) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for u128
impl WrappingFrom<isize> for u128
source§fn wrapping_from(value: isize) -> u128
fn wrapping_from(value: isize) -> u128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<isize> for usize
impl WrappingFrom<isize> for usize
source§fn wrapping_from(value: isize) -> usize
fn wrapping_from(value: isize) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u8> for i8
impl WrappingFrom<u8> for i8
source§fn wrapping_from(value: u8) -> i8
fn wrapping_from(value: u8) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u8> for i16
impl WrappingFrom<u8> for i16
source§impl WrappingFrom<u8> for i32
impl WrappingFrom<u8> for i32
source§impl WrappingFrom<u8> for i64
impl WrappingFrom<u8> for i64
source§impl WrappingFrom<u8> for i128
impl WrappingFrom<u8> for i128
source§impl WrappingFrom<u8> for isize
impl WrappingFrom<u8> for isize
source§impl WrappingFrom<u8> for u8
impl WrappingFrom<u8> for u8
source§impl WrappingFrom<u8> for u16
impl WrappingFrom<u8> for u16
source§impl WrappingFrom<u8> for u32
impl WrappingFrom<u8> for u32
source§impl WrappingFrom<u8> for u64
impl WrappingFrom<u8> for u64
source§impl WrappingFrom<u8> for u128
impl WrappingFrom<u8> for u128
source§impl WrappingFrom<u8> for usize
impl WrappingFrom<u8> for usize
source§impl WrappingFrom<u16> for i8
impl WrappingFrom<u16> for i8
source§fn wrapping_from(value: u16) -> i8
fn wrapping_from(value: u16) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u16> for i16
impl WrappingFrom<u16> for i16
source§fn wrapping_from(value: u16) -> i16
fn wrapping_from(value: u16) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u16> for i32
impl WrappingFrom<u16> for i32
source§impl WrappingFrom<u16> for i64
impl WrappingFrom<u16> for i64
source§impl WrappingFrom<u16> for i128
impl WrappingFrom<u16> for i128
source§impl WrappingFrom<u16> for isize
impl WrappingFrom<u16> for isize
source§fn wrapping_from(value: u16) -> isize
fn wrapping_from(value: u16) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u16> for u8
impl WrappingFrom<u16> for u8
source§fn wrapping_from(value: u16) -> u8
fn wrapping_from(value: u16) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u16> for u16
impl WrappingFrom<u16> for u16
source§impl WrappingFrom<u16> for u32
impl WrappingFrom<u16> for u32
source§impl WrappingFrom<u16> for u64
impl WrappingFrom<u16> for u64
source§impl WrappingFrom<u16> for u128
impl WrappingFrom<u16> for u128
source§impl WrappingFrom<u16> for usize
impl WrappingFrom<u16> for usize
source§impl WrappingFrom<u32> for i8
impl WrappingFrom<u32> for i8
source§fn wrapping_from(value: u32) -> i8
fn wrapping_from(value: u32) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u32> for i16
impl WrappingFrom<u32> for i16
source§fn wrapping_from(value: u32) -> i16
fn wrapping_from(value: u32) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u32> for i32
impl WrappingFrom<u32> for i32
source§fn wrapping_from(value: u32) -> i32
fn wrapping_from(value: u32) -> i32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u32> for i64
impl WrappingFrom<u32> for i64
source§impl WrappingFrom<u32> for i128
impl WrappingFrom<u32> for i128
source§impl WrappingFrom<u32> for isize
impl WrappingFrom<u32> for isize
source§fn wrapping_from(value: u32) -> isize
fn wrapping_from(value: u32) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u32> for u8
impl WrappingFrom<u32> for u8
source§fn wrapping_from(value: u32) -> u8
fn wrapping_from(value: u32) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u32> for u16
impl WrappingFrom<u32> for u16
source§fn wrapping_from(value: u32) -> u16
fn wrapping_from(value: u32) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u32> for u32
impl WrappingFrom<u32> for u32
source§impl WrappingFrom<u32> for u64
impl WrappingFrom<u32> for u64
source§impl WrappingFrom<u32> for u128
impl WrappingFrom<u32> for u128
source§impl WrappingFrom<u32> for usize
impl WrappingFrom<u32> for usize
source§fn wrapping_from(value: u32) -> usize
fn wrapping_from(value: u32) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for i8
impl WrappingFrom<u64> for i8
source§fn wrapping_from(value: u64) -> i8
fn wrapping_from(value: u64) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for i16
impl WrappingFrom<u64> for i16
source§fn wrapping_from(value: u64) -> i16
fn wrapping_from(value: u64) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for i32
impl WrappingFrom<u64> for i32
source§fn wrapping_from(value: u64) -> i32
fn wrapping_from(value: u64) -> i32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for i64
impl WrappingFrom<u64> for i64
source§fn wrapping_from(value: u64) -> i64
fn wrapping_from(value: u64) -> i64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for i128
impl WrappingFrom<u64> for i128
source§impl WrappingFrom<u64> for isize
impl WrappingFrom<u64> for isize
source§fn wrapping_from(value: u64) -> isize
fn wrapping_from(value: u64) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for u8
impl WrappingFrom<u64> for u8
source§fn wrapping_from(value: u64) -> u8
fn wrapping_from(value: u64) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for u16
impl WrappingFrom<u64> for u16
source§fn wrapping_from(value: u64) -> u16
fn wrapping_from(value: u64) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for u32
impl WrappingFrom<u64> for u32
source§fn wrapping_from(value: u64) -> u32
fn wrapping_from(value: u64) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u64> for u64
impl WrappingFrom<u64> for u64
source§impl WrappingFrom<u64> for u128
impl WrappingFrom<u64> for u128
source§impl WrappingFrom<u64> for usize
impl WrappingFrom<u64> for usize
source§fn wrapping_from(value: u64) -> usize
fn wrapping_from(value: u64) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for i8
impl WrappingFrom<u128> for i8
source§fn wrapping_from(value: u128) -> i8
fn wrapping_from(value: u128) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for i16
impl WrappingFrom<u128> for i16
source§fn wrapping_from(value: u128) -> i16
fn wrapping_from(value: u128) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for i32
impl WrappingFrom<u128> for i32
source§fn wrapping_from(value: u128) -> i32
fn wrapping_from(value: u128) -> i32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for i64
impl WrappingFrom<u128> for i64
source§fn wrapping_from(value: u128) -> i64
fn wrapping_from(value: u128) -> i64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for i128
impl WrappingFrom<u128> for i128
source§fn wrapping_from(value: u128) -> i128
fn wrapping_from(value: u128) -> i128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for isize
impl WrappingFrom<u128> for isize
source§fn wrapping_from(value: u128) -> isize
fn wrapping_from(value: u128) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for u8
impl WrappingFrom<u128> for u8
source§fn wrapping_from(value: u128) -> u8
fn wrapping_from(value: u128) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for u16
impl WrappingFrom<u128> for u16
source§fn wrapping_from(value: u128) -> u16
fn wrapping_from(value: u128) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for u32
impl WrappingFrom<u128> for u32
source§fn wrapping_from(value: u128) -> u32
fn wrapping_from(value: u128) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for u64
impl WrappingFrom<u128> for u64
source§fn wrapping_from(value: u128) -> u64
fn wrapping_from(value: u128) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<u128> for u128
impl WrappingFrom<u128> for u128
source§impl WrappingFrom<u128> for usize
impl WrappingFrom<u128> for usize
source§fn wrapping_from(value: u128) -> usize
fn wrapping_from(value: u128) -> usize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for i8
impl WrappingFrom<usize> for i8
source§fn wrapping_from(value: usize) -> i8
fn wrapping_from(value: usize) -> i8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for i16
impl WrappingFrom<usize> for i16
source§fn wrapping_from(value: usize) -> i16
fn wrapping_from(value: usize) -> i16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for i32
impl WrappingFrom<usize> for i32
source§fn wrapping_from(value: usize) -> i32
fn wrapping_from(value: usize) -> i32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for i64
impl WrappingFrom<usize> for i64
source§fn wrapping_from(value: usize) -> i64
fn wrapping_from(value: usize) -> i64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for i128
impl WrappingFrom<usize> for i128
source§fn wrapping_from(value: usize) -> i128
fn wrapping_from(value: usize) -> i128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for isize
impl WrappingFrom<usize> for isize
source§fn wrapping_from(value: usize) -> isize
fn wrapping_from(value: usize) -> isize
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for u8
impl WrappingFrom<usize> for u8
source§fn wrapping_from(value: usize) -> u8
fn wrapping_from(value: usize) -> u8
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for u16
impl WrappingFrom<usize> for u16
source§fn wrapping_from(value: usize) -> u16
fn wrapping_from(value: usize) -> u16
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for u32
impl WrappingFrom<usize> for u32
source§fn wrapping_from(value: usize) -> u32
fn wrapping_from(value: usize) -> u32
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for u64
impl WrappingFrom<usize> for u64
source§fn wrapping_from(value: usize) -> u64
fn wrapping_from(value: usize) -> u64
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl WrappingFrom<usize> for u128
impl WrappingFrom<usize> for u128
source§fn wrapping_from(value: usize) -> u128
fn wrapping_from(value: usize) -> u128
Converts a value to another type. If the value cannot be represented in the new type, it is wrapped.
Let $W$ be the width of the target type.
If the target type is unsigned, then $f_W(n) = m$, where $m < 2^W$ and $n + 2^W k = m$ for some $k \in \Z$.
If the target type is signed, then $f_W(n) = m$, where $-2^{W-1} \leq m < 2^{W-1}$ and $n + 2^W k = m$ for some $k \in \Z$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.