pub trait NumCast: ToPrimitive {
fn from<T>(n: T) -> Option<Self>
where
T: ToPrimitive;
}
Expand description
An interface for casting between machine scalars.
Required methods
fn from<T>(n: T) -> Option<Self> where
T: ToPrimitive,
fn from<T>(n: T) -> Option<Self> where
T: ToPrimitive,
Creates a number from another value that can be converted into
a primitive via the ToPrimitive
trait.