float

Trait FromPrimitive

Source
pub trait FromPrimitive {
    // Required methods
    fn from_f64(t: f64) -> Self;
    fn from_f32(t: f32) -> Self;
    fn from_isize(t: isize) -> Self;
    fn from_u32(t: u32) -> Self;
    fn from_i32(t: i32) -> Self;
}
Expand description

Trait for converting from different numeric types

Required Methods§

Source

fn from_f64(t: f64) -> Self

from a f64

Source

fn from_f32(t: f32) -> Self

from a f32

Source

fn from_isize(t: isize) -> Self

from a isze

Source

fn from_u32(t: u32) -> Self

from a u32

Source

fn from_i32(t: i32) -> Self

from a i32

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 FromPrimitive for f32

Source§

fn from_f64(t: f64) -> Self

Source§

fn from_f32(t: f32) -> Self

Source§

fn from_isize(t: isize) -> Self

Source§

fn from_u32(t: u32) -> Self

Source§

fn from_i32(t: i32) -> Self

Source§

impl FromPrimitive for f64

Source§

fn from_f64(t: f64) -> Self

Source§

fn from_f32(t: f32) -> Self

Source§

fn from_isize(t: isize) -> Self

Source§

fn from_u32(t: u32) -> Self

Source§

fn from_i32(t: i32) -> Self

Implementors§