Skip to main content

TryNumFrom

Trait TryNumFrom 

Source
pub trait TryNumFrom<T>: Sized {
    // Required method
    fn try_num_from(_: T) -> Option<Self>;
}
Expand description

Just like TryFrom, but for numeric types not supported by the Rust’s std.

Required Methods§

Source

fn try_num_from(_: T) -> Option<Self>

Casts between numeric types.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TryNumFrom<f32> for i16

Source§

impl TryNumFrom<f32> for i32

Source§

impl TryNumFrom<f32> for u8

Source§

impl TryNumFrom<f32> for u16

Implementors§