lexical_util::num

Trait AsCast

Source
pub trait AsCast: AsPrimitive {
    // Required method
    fn as_cast<N: AsPrimitive>(n: N) -> Self;
}
Expand description

An interface for casting between machine scalars.

Required Methods§

Source

fn as_cast<N: AsPrimitive>(n: N) -> Self

Creates a number from another value that can be converted into a primitive via the AsPrimitive trait.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AsCast for f32

Source§

impl AsCast for f64

Source§

impl AsCast for i8

Source§

impl AsCast for i16

Source§

impl AsCast for i32

Source§

impl AsCast for i64

Source§

impl AsCast for i128

Source§

impl AsCast for isize

Source§

impl AsCast for u8

Source§

impl AsCast for u16

Source§

impl AsCast for u32

Source§

impl AsCast for u64

Source§

impl AsCast for u128

Source§

impl AsCast for usize

Implementors§