pub trait ToF32 {
// Required methods
fn to_f32_res(self) -> ParseResultF32;
fn to_f32(self) -> f32;
}
Required Methods§
fn to_f32_res(self) -> ParseResultF32
fn to_f32(self) -> f32
Implementations on Foreign Types§
Source§impl ToF32 for &'static str
impl ToF32 for &'static str
fn to_f32_res(self) -> ParseResultF32
fn to_f32(self) -> f32
Source§impl ToF32 for bool
impl ToF32 for bool
Source§fn to_f32_res(self) -> ParseResultF32
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));