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

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]

[src]

impl NumCast for u16
[src]

[src]

impl NumCast for u32
[src]

[src]

impl NumCast for u64
[src]

[src]

impl NumCast for usize
[src]

[src]

impl NumCast for i8
[src]

[src]

impl NumCast for i16
[src]

[src]

impl NumCast for i32
[src]

[src]

impl NumCast for i64
[src]

[src]

impl NumCast for isize
[src]

[src]

impl NumCast for f32
[src]

[src]

impl NumCast for f64
[src]

[src]

impl<T: NumCast> NumCast for Wrapping<T>
[src]

[src]

Implementors