Trait num_traits::cast::NumCast [−][src]
pub trait NumCast: Sized + ToPrimitive { fn from<T: ToPrimitive>(n: T) -> Option<Self>; }
An interface for casting between machine scalars.
Required Methods
fn from<T: ToPrimitive>(n: T) -> Option<Self>
Creates a number from another value that can be converted into
a primitive via the ToPrimitive
trait.
Implementations on Foreign Types
impl NumCast for u8
[src]
impl NumCast for u8
fn from<N: ToPrimitive>(n: N) -> Option<u8>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<u8>
impl NumCast for u16
[src]
impl NumCast for u16
fn from<N: ToPrimitive>(n: N) -> Option<u16>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<u16>
impl NumCast for u32
[src]
impl NumCast for u32
fn from<N: ToPrimitive>(n: N) -> Option<u32>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<u32>
impl NumCast for u64
[src]
impl NumCast for u64
fn from<N: ToPrimitive>(n: N) -> Option<u64>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<u64>
impl NumCast for u128
[src]
impl NumCast for u128
fn from<N: ToPrimitive>(n: N) -> Option<u128>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<u128>
impl NumCast for usize
[src]
impl NumCast for usize
fn from<N: ToPrimitive>(n: N) -> Option<usize>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<usize>
impl NumCast for i8
[src]
impl NumCast for i8
fn from<N: ToPrimitive>(n: N) -> Option<i8>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<i8>
impl NumCast for i16
[src]
impl NumCast for i16
fn from<N: ToPrimitive>(n: N) -> Option<i16>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<i16>
impl NumCast for i32
[src]
impl NumCast for i32
fn from<N: ToPrimitive>(n: N) -> Option<i32>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<i32>
impl NumCast for i64
[src]
impl NumCast for i64
fn from<N: ToPrimitive>(n: N) -> Option<i64>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<i64>
impl NumCast for i128
[src]
impl NumCast for i128
fn from<N: ToPrimitive>(n: N) -> Option<i128>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<i128>
impl NumCast for isize
[src]
impl NumCast for isize
fn from<N: ToPrimitive>(n: N) -> Option<isize>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<isize>
impl NumCast for f32
[src]
impl NumCast for f32
fn from<N: ToPrimitive>(n: N) -> Option<f32>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<f32>
impl NumCast for f64
[src]
impl NumCast for f64
fn from<N: ToPrimitive>(n: N) -> Option<f64>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<f64>
impl<T: NumCast> NumCast for Wrapping<T>
[src]
impl<T: NumCast> NumCast for Wrapping<T>
fn from<U: ToPrimitive>(n: U) -> Option<Self>
[src]
fn from<U: ToPrimitive>(n: U) -> Option<Self>