Trait malachite_base::num::conversion::traits::ConvertibleFrom
source · pub trait ConvertibleFrom<T> {
// Required method
fn convertible_from(value: T) -> bool;
}
Expand description
Tests whether a value of one type is convertible into a value of another.
If ConvertibleFrom<T>
for Self
is implemented, it usually makes sense to implement
TryFrom
for T
as well.
Required Methods§
fn convertible_from(value: T) -> bool
Object Safety§
Implementations on Foreign Types§
source§impl ConvertibleFrom<f32> for i8
impl ConvertibleFrom<f32> for i8
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for i16
impl ConvertibleFrom<f32> for i16
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for i32
impl ConvertibleFrom<f32> for i32
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for i64
impl ConvertibleFrom<f32> for i64
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for i128
impl ConvertibleFrom<f32> for i128
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for isize
impl ConvertibleFrom<f32> for isize
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for u8
impl ConvertibleFrom<f32> for u8
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for u16
impl ConvertibleFrom<f32> for u16
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for u32
impl ConvertibleFrom<f32> for u32
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for u64
impl ConvertibleFrom<f32> for u64
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for u128
impl ConvertibleFrom<f32> for u128
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f32> for usize
impl ConvertibleFrom<f32> for usize
source§fn convertible_from(value: f32) -> bool
fn convertible_from(value: f32) -> bool
source§impl ConvertibleFrom<f64> for i8
impl ConvertibleFrom<f64> for i8
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for i16
impl ConvertibleFrom<f64> for i16
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for i32
impl ConvertibleFrom<f64> for i32
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for i64
impl ConvertibleFrom<f64> for i64
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for i128
impl ConvertibleFrom<f64> for i128
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for isize
impl ConvertibleFrom<f64> for isize
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for u8
impl ConvertibleFrom<f64> for u8
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for u16
impl ConvertibleFrom<f64> for u16
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for u32
impl ConvertibleFrom<f64> for u32
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for u64
impl ConvertibleFrom<f64> for u64
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for u128
impl ConvertibleFrom<f64> for u128
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<f64> for usize
impl ConvertibleFrom<f64> for usize
source§fn convertible_from(value: f64) -> bool
fn convertible_from(value: f64) -> bool
source§impl ConvertibleFrom<i8> for f32
impl ConvertibleFrom<i8> for f32
source§impl ConvertibleFrom<i8> for f64
impl ConvertibleFrom<i8> for f64
source§impl ConvertibleFrom<i8> for i8
impl ConvertibleFrom<i8> for i8
source§impl ConvertibleFrom<i8> for i16
impl ConvertibleFrom<i8> for i16
source§impl ConvertibleFrom<i8> for i32
impl ConvertibleFrom<i8> for i32
source§impl ConvertibleFrom<i8> for i64
impl ConvertibleFrom<i8> for i64
source§impl ConvertibleFrom<i8> for i128
impl ConvertibleFrom<i8> for i128
source§impl ConvertibleFrom<i8> for isize
impl ConvertibleFrom<i8> for isize
source§impl ConvertibleFrom<i8> for u8
impl ConvertibleFrom<i8> for u8
source§fn convertible_from(value: i8) -> bool
fn convertible_from(value: i8) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i8> for u16
impl ConvertibleFrom<i8> for u16
source§fn convertible_from(value: i8) -> bool
fn convertible_from(value: i8) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i8> for u32
impl ConvertibleFrom<i8> for u32
source§fn convertible_from(value: i8) -> bool
fn convertible_from(value: i8) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i8> for u64
impl ConvertibleFrom<i8> for u64
source§fn convertible_from(value: i8) -> bool
fn convertible_from(value: i8) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i8> for u128
impl ConvertibleFrom<i8> for u128
source§fn convertible_from(value: i8) -> bool
fn convertible_from(value: i8) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i8> for usize
impl ConvertibleFrom<i8> for usize
source§fn convertible_from(value: i8) -> bool
fn convertible_from(value: i8) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i16> for f32
impl ConvertibleFrom<i16> for f32
source§impl ConvertibleFrom<i16> for f64
impl ConvertibleFrom<i16> for f64
source§impl ConvertibleFrom<i16> for i8
impl ConvertibleFrom<i16> for i8
source§fn convertible_from(value: i16) -> bool
fn convertible_from(value: i16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i16> for i16
impl ConvertibleFrom<i16> for i16
source§impl ConvertibleFrom<i16> for i32
impl ConvertibleFrom<i16> for i32
source§impl ConvertibleFrom<i16> for i64
impl ConvertibleFrom<i16> for i64
source§impl ConvertibleFrom<i16> for i128
impl ConvertibleFrom<i16> for i128
source§impl ConvertibleFrom<i16> for isize
impl ConvertibleFrom<i16> for isize
source§impl ConvertibleFrom<i16> for u8
impl ConvertibleFrom<i16> for u8
source§fn convertible_from(value: i16) -> bool
fn convertible_from(value: i16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i16> for u16
impl ConvertibleFrom<i16> for u16
source§fn convertible_from(value: i16) -> bool
fn convertible_from(value: i16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i16> for u32
impl ConvertibleFrom<i16> for u32
source§fn convertible_from(value: i16) -> bool
fn convertible_from(value: i16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i16> for u64
impl ConvertibleFrom<i16> for u64
source§fn convertible_from(value: i16) -> bool
fn convertible_from(value: i16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i16> for u128
impl ConvertibleFrom<i16> for u128
source§fn convertible_from(value: i16) -> bool
fn convertible_from(value: i16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i16> for usize
impl ConvertibleFrom<i16> for usize
source§fn convertible_from(value: i16) -> bool
fn convertible_from(value: i16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for f32
impl ConvertibleFrom<i32> for f32
source§impl ConvertibleFrom<i32> for f64
impl ConvertibleFrom<i32> for f64
source§impl ConvertibleFrom<i32> for i8
impl ConvertibleFrom<i32> for i8
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for i16
impl ConvertibleFrom<i32> for i16
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for i32
impl ConvertibleFrom<i32> for i32
source§impl ConvertibleFrom<i32> for i64
impl ConvertibleFrom<i32> for i64
source§impl ConvertibleFrom<i32> for i128
impl ConvertibleFrom<i32> for i128
source§impl ConvertibleFrom<i32> for isize
impl ConvertibleFrom<i32> for isize
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for u8
impl ConvertibleFrom<i32> for u8
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for u16
impl ConvertibleFrom<i32> for u16
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for u32
impl ConvertibleFrom<i32> for u32
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for u64
impl ConvertibleFrom<i32> for u64
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for u128
impl ConvertibleFrom<i32> for u128
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i32> for usize
impl ConvertibleFrom<i32> for usize
source§fn convertible_from(value: i32) -> bool
fn convertible_from(value: i32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for f32
impl ConvertibleFrom<i64> for f32
source§impl ConvertibleFrom<i64> for f64
impl ConvertibleFrom<i64> for f64
source§impl ConvertibleFrom<i64> for i8
impl ConvertibleFrom<i64> for i8
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for i16
impl ConvertibleFrom<i64> for i16
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for i32
impl ConvertibleFrom<i64> for i32
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for i64
impl ConvertibleFrom<i64> for i64
source§impl ConvertibleFrom<i64> for i128
impl ConvertibleFrom<i64> for i128
source§impl ConvertibleFrom<i64> for isize
impl ConvertibleFrom<i64> for isize
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for u8
impl ConvertibleFrom<i64> for u8
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for u16
impl ConvertibleFrom<i64> for u16
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for u32
impl ConvertibleFrom<i64> for u32
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for u64
impl ConvertibleFrom<i64> for u64
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for u128
impl ConvertibleFrom<i64> for u128
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i64> for usize
impl ConvertibleFrom<i64> for usize
source§fn convertible_from(value: i64) -> bool
fn convertible_from(value: i64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for f32
impl ConvertibleFrom<i128> for f32
source§impl ConvertibleFrom<i128> for f64
impl ConvertibleFrom<i128> for f64
source§impl ConvertibleFrom<i128> for i8
impl ConvertibleFrom<i128> for i8
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for i16
impl ConvertibleFrom<i128> for i16
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for i32
impl ConvertibleFrom<i128> for i32
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for i64
impl ConvertibleFrom<i128> for i64
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for i128
impl ConvertibleFrom<i128> for i128
source§impl ConvertibleFrom<i128> for isize
impl ConvertibleFrom<i128> for isize
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for u8
impl ConvertibleFrom<i128> for u8
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for u16
impl ConvertibleFrom<i128> for u16
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for u32
impl ConvertibleFrom<i128> for u32
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for u64
impl ConvertibleFrom<i128> for u64
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for u128
impl ConvertibleFrom<i128> for u128
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<i128> for usize
impl ConvertibleFrom<i128> for usize
source§fn convertible_from(value: i128) -> bool
fn convertible_from(value: i128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for f32
impl ConvertibleFrom<isize> for f32
source§impl ConvertibleFrom<isize> for f64
impl ConvertibleFrom<isize> for f64
source§impl ConvertibleFrom<isize> for i8
impl ConvertibleFrom<isize> for i8
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for i16
impl ConvertibleFrom<isize> for i16
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for i32
impl ConvertibleFrom<isize> for i32
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for i64
impl ConvertibleFrom<isize> for i64
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for i128
impl ConvertibleFrom<isize> for i128
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for isize
impl ConvertibleFrom<isize> for isize
source§impl ConvertibleFrom<isize> for u8
impl ConvertibleFrom<isize> for u8
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for u16
impl ConvertibleFrom<isize> for u16
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for u32
impl ConvertibleFrom<isize> for u32
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for u64
impl ConvertibleFrom<isize> for u64
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for u128
impl ConvertibleFrom<isize> for u128
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<isize> for usize
impl ConvertibleFrom<isize> for usize
source§fn convertible_from(value: isize) -> bool
fn convertible_from(value: isize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u8> for f32
impl ConvertibleFrom<u8> for f32
source§fn convertible_from(value: u8) -> bool
fn convertible_from(value: u8) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u8> for f64
impl ConvertibleFrom<u8> for f64
source§fn convertible_from(value: u8) -> bool
fn convertible_from(value: u8) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u8> for i8
impl ConvertibleFrom<u8> for i8
source§fn convertible_from(value: u8) -> bool
fn convertible_from(value: u8) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u8> for i16
impl ConvertibleFrom<u8> for i16
source§impl ConvertibleFrom<u8> for i32
impl ConvertibleFrom<u8> for i32
source§impl ConvertibleFrom<u8> for i64
impl ConvertibleFrom<u8> for i64
source§impl ConvertibleFrom<u8> for i128
impl ConvertibleFrom<u8> for i128
source§impl ConvertibleFrom<u8> for isize
impl ConvertibleFrom<u8> for isize
source§impl ConvertibleFrom<u8> for u8
impl ConvertibleFrom<u8> for u8
source§impl ConvertibleFrom<u8> for u16
impl ConvertibleFrom<u8> for u16
source§impl ConvertibleFrom<u8> for u32
impl ConvertibleFrom<u8> for u32
source§impl ConvertibleFrom<u8> for u64
impl ConvertibleFrom<u8> for u64
source§impl ConvertibleFrom<u8> for u128
impl ConvertibleFrom<u8> for u128
source§impl ConvertibleFrom<u8> for usize
impl ConvertibleFrom<u8> for usize
source§impl ConvertibleFrom<u16> for f32
impl ConvertibleFrom<u16> for f32
source§fn convertible_from(value: u16) -> bool
fn convertible_from(value: u16) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u16> for f64
impl ConvertibleFrom<u16> for f64
source§fn convertible_from(value: u16) -> bool
fn convertible_from(value: u16) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u16> for i8
impl ConvertibleFrom<u16> for i8
source§fn convertible_from(value: u16) -> bool
fn convertible_from(value: u16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u16> for i16
impl ConvertibleFrom<u16> for i16
source§fn convertible_from(value: u16) -> bool
fn convertible_from(value: u16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u16> for i32
impl ConvertibleFrom<u16> for i32
source§impl ConvertibleFrom<u16> for i64
impl ConvertibleFrom<u16> for i64
source§impl ConvertibleFrom<u16> for i128
impl ConvertibleFrom<u16> for i128
source§impl ConvertibleFrom<u16> for isize
impl ConvertibleFrom<u16> for isize
source§fn convertible_from(value: u16) -> bool
fn convertible_from(value: u16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u16> for u8
impl ConvertibleFrom<u16> for u8
source§fn convertible_from(value: u16) -> bool
fn convertible_from(value: u16) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u16> for u16
impl ConvertibleFrom<u16> for u16
source§impl ConvertibleFrom<u16> for u32
impl ConvertibleFrom<u16> for u32
source§impl ConvertibleFrom<u16> for u64
impl ConvertibleFrom<u16> for u64
source§impl ConvertibleFrom<u16> for u128
impl ConvertibleFrom<u16> for u128
source§impl ConvertibleFrom<u16> for usize
impl ConvertibleFrom<u16> for usize
source§impl ConvertibleFrom<u32> for f32
impl ConvertibleFrom<u32> for f32
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for f64
impl ConvertibleFrom<u32> for f64
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for i8
impl ConvertibleFrom<u32> for i8
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for i16
impl ConvertibleFrom<u32> for i16
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for i32
impl ConvertibleFrom<u32> for i32
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for i64
impl ConvertibleFrom<u32> for i64
source§impl ConvertibleFrom<u32> for i128
impl ConvertibleFrom<u32> for i128
source§impl ConvertibleFrom<u32> for isize
impl ConvertibleFrom<u32> for isize
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for u8
impl ConvertibleFrom<u32> for u8
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for u16
impl ConvertibleFrom<u32> for u16
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u32> for u32
impl ConvertibleFrom<u32> for u32
source§impl ConvertibleFrom<u32> for u64
impl ConvertibleFrom<u32> for u64
source§impl ConvertibleFrom<u32> for u128
impl ConvertibleFrom<u32> for u128
source§impl ConvertibleFrom<u32> for usize
impl ConvertibleFrom<u32> for usize
source§fn convertible_from(value: u32) -> bool
fn convertible_from(value: u32) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for f32
impl ConvertibleFrom<u64> for f32
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for f64
impl ConvertibleFrom<u64> for f64
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for i8
impl ConvertibleFrom<u64> for i8
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for i16
impl ConvertibleFrom<u64> for i16
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for i32
impl ConvertibleFrom<u64> for i32
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for i64
impl ConvertibleFrom<u64> for i64
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for i128
impl ConvertibleFrom<u64> for i128
source§impl ConvertibleFrom<u64> for isize
impl ConvertibleFrom<u64> for isize
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for u8
impl ConvertibleFrom<u64> for u8
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for u16
impl ConvertibleFrom<u64> for u16
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for u32
impl ConvertibleFrom<u64> for u32
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u64> for u64
impl ConvertibleFrom<u64> for u64
source§impl ConvertibleFrom<u64> for u128
impl ConvertibleFrom<u64> for u128
source§impl ConvertibleFrom<u64> for usize
impl ConvertibleFrom<u64> for usize
source§fn convertible_from(value: u64) -> bool
fn convertible_from(value: u64) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for f32
impl ConvertibleFrom<u128> for f32
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for f64
impl ConvertibleFrom<u128> for f64
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for i8
impl ConvertibleFrom<u128> for i8
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for i16
impl ConvertibleFrom<u128> for i16
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for i32
impl ConvertibleFrom<u128> for i32
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for i64
impl ConvertibleFrom<u128> for i64
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for i128
impl ConvertibleFrom<u128> for i128
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for isize
impl ConvertibleFrom<u128> for isize
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for u8
impl ConvertibleFrom<u128> for u8
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for u16
impl ConvertibleFrom<u128> for u16
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for u32
impl ConvertibleFrom<u128> for u32
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for u64
impl ConvertibleFrom<u128> for u64
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<u128> for u128
impl ConvertibleFrom<u128> for u128
source§impl ConvertibleFrom<u128> for usize
impl ConvertibleFrom<u128> for usize
source§fn convertible_from(value: u128) -> bool
fn convertible_from(value: u128) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for f32
impl ConvertibleFrom<usize> for f32
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for f64
impl ConvertibleFrom<usize> for f64
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Checks whether a value of an unsigned type is convertible to a floating point type.
An exact conversion is possible if the unsigned value is not too large to
represent (which can only happen when converting a u128
to an f32
)
and the precision of the unsigned value is not too high.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for i8
impl ConvertibleFrom<usize> for i8
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for i16
impl ConvertibleFrom<usize> for i16
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for i32
impl ConvertibleFrom<usize> for i32
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for i64
impl ConvertibleFrom<usize> for i64
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for i128
impl ConvertibleFrom<usize> for i128
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for isize
impl ConvertibleFrom<usize> for isize
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for u8
impl ConvertibleFrom<usize> for u8
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for u16
impl ConvertibleFrom<usize> for u16
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for u32
impl ConvertibleFrom<usize> for u32
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for u64
impl ConvertibleFrom<usize> for u64
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
source§impl ConvertibleFrom<usize> for u128
impl ConvertibleFrom<usize> for u128
source§fn convertible_from(value: usize) -> bool
fn convertible_from(value: usize) -> bool
Determines whether a value is convertible to a different type.
Let $W$ be the width of the target type.
If the target type is unsigned then, $$ f_W(n) = (0 \leq n < 2^W). $$
If the target type is signed then, $$ f_W(n) = (-2^{W-1} \leq n < 2^{W-1}-1). $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.