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<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>
Implementors
impl NumCast for u8
impl NumCast for u16
impl NumCast for u32
impl NumCast for u64
impl NumCast for u128
impl NumCast for usize
impl NumCast for i8
impl NumCast for i16
impl NumCast for i32
impl NumCast for i64
impl NumCast for i128
impl NumCast for isize
impl NumCast for f32
impl NumCast for f64