Trait FloatToInt

Source
pub trait FloatToInt {
    // Required methods
    fn to_i8(&self) -> i8;
    fn to_i16(&self) -> i16;
    fn to_i32(&self) -> i32;
    fn to_i64(&self) -> i64;
    fn to_u8(&self) -> u8;
    fn to_u16(&self) -> u16;
    fn to_u32(&self) -> u32;
    fn to_u64(&self) -> u64;
}
Expand description

Trait to convert floating-point types to integer types.

Required Methods§

Source

fn to_i8(&self) -> i8

Source

fn to_i16(&self) -> i16

Source

fn to_i32(&self) -> i32

Source

fn to_i64(&self) -> i64

Source

fn to_u8(&self) -> u8

Source

fn to_u16(&self) -> u16

Source

fn to_u32(&self) -> u32

Source

fn to_u64(&self) -> u64

Implementations on Foreign Types§

Source§

impl FloatToInt for f32

Implement FloatToInt for f32 and f64.

Source§

fn to_i8(&self) -> i8

Source§

fn to_i16(&self) -> i16

Source§

fn to_i32(&self) -> i32

Source§

fn to_i64(&self) -> i64

Source§

fn to_u8(&self) -> u8

Source§

fn to_u16(&self) -> u16

Source§

fn to_u32(&self) -> u32

Source§

fn to_u64(&self) -> u64

Source§

impl FloatToInt for f64

Source§

fn to_i8(&self) -> i8

Source§

fn to_i16(&self) -> i16

Source§

fn to_i32(&self) -> i32

Source§

fn to_i64(&self) -> i64

Source§

fn to_u8(&self) -> u8

Source§

fn to_u16(&self) -> u16

Source§

fn to_u32(&self) -> u32

Source§

fn to_u64(&self) -> u64

Implementors§