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§

source

fn wrapping_from(value: T) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WrappingFrom<i8> for i8

source§

fn wrapping_from(value: i8) -> i8

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i8> for i16

source§

fn wrapping_from(value: i8) -> i16

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i8> for i32

source§

fn wrapping_from(value: i8) -> i32

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i8> for i64

source§

fn wrapping_from(value: i8) -> i64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i8> for i128

source§

fn wrapping_from(value: i8) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i8> for isize

source§

fn wrapping_from(value: i8) -> isize

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i8> for u8

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: i16) -> i16

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i16> for i32

source§

fn wrapping_from(value: i16) -> i32

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i16> for i64

source§

fn wrapping_from(value: i16) -> i64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i16> for i128

source§

fn wrapping_from(value: i16) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i16> for isize

source§

fn wrapping_from(value: i16) -> isize

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i16> for u8

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: i32) -> i32

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i32> for i64

source§

fn wrapping_from(value: i32) -> i64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i32> for i128

source§

fn wrapping_from(value: i32) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i32> for isize

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: i64) -> i64

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i64> for i128

source§

fn wrapping_from(value: i64) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i64> for isize

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: i128) -> i128

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<i128> for isize

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: isize) -> isize

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<isize> for u8

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: u8) -> i16

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for i32

source§

fn wrapping_from(value: u8) -> i32

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for i64

source§

fn wrapping_from(value: u8) -> i64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for i128

source§

fn wrapping_from(value: u8) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for isize

source§

fn wrapping_from(value: u8) -> isize

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for u8

source§

fn wrapping_from(value: u8) -> u8

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for u16

source§

fn wrapping_from(value: u8) -> u16

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for u32

source§

fn wrapping_from(value: u8) -> u32

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for u64

source§

fn wrapping_from(value: u8) -> u64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for u128

source§

fn wrapping_from(value: u8) -> u128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u8> for usize

source§

fn wrapping_from(value: u8) -> usize

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for i8

source§

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

source§

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

source§

fn wrapping_from(value: u16) -> i32

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for i64

source§

fn wrapping_from(value: u16) -> i64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for i128

source§

fn wrapping_from(value: u16) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for isize

source§

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

source§

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

source§

fn wrapping_from(value: u16) -> u16

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for u32

source§

fn wrapping_from(value: u16) -> u32

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for u64

source§

fn wrapping_from(value: u16) -> u64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for u128

source§

fn wrapping_from(value: u16) -> u128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u16> for usize

source§

fn wrapping_from(value: u16) -> usize

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u32> for i8

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: u32) -> i64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u32> for i128

source§

fn wrapping_from(value: u32) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u32> for isize

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: u32) -> u32

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u32> for u64

source§

fn wrapping_from(value: u32) -> u64

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u32> for u128

source§

fn wrapping_from(value: u32) -> u128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u32> for usize

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: u64) -> i128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u64> for isize

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: u64) -> u64

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u64> for u128

source§

fn wrapping_from(value: u64) -> u128

Converts a value to another type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u64> for usize

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn wrapping_from(value: u128) -> u128

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl WrappingFrom<u128> for usize

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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.

source§

impl WrappingFrom<usize> for usize

source§

fn wrapping_from(value: usize) -> usize

Converts a value to its own type. This conversion is always valid and always leaves the value unchanged.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§