Trait ToF32

Source
pub trait ToF32 {
    // Required methods
    fn to_f32_res(self) -> ParseResultF32;
    fn to_f32(self) -> f32;
}

Required Methods§

Implementations on Foreign Types§

Source§

impl ToF32 for &'static str

Source§

impl ToF32 for bool

Source§

fn to_f32_res(self) -> ParseResultF32

Parse bool to f32 (see more: bool_to_f32_res)

§Examples
use rustils::parse::float::ToF32;

assert_eq!(true.to_f32_res(), Ok(1.0_f32));
assert_eq!(false.to_f32_res(), Ok(0.0_f32));
Source§

fn to_f32(self) -> f32

Parse bool to f32 (see more: bool_to_f32)

§Examples
use rustils::parse::float::ToF32;

assert_eq!(true.to_f32(), 1.0_f32);
assert_eq!(false.to_f32(), 0.0_f32);
Source§

impl ToF32 for String

Implementors§