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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
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.