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