Skip to main content

ToFloat

Trait ToFloat 

Source
pub trait ToFloat {
    // Required methods
    fn to_f32(&self) -> Result<f32, ()>;
    fn to_f64(&self) -> Result<f64, ()>;
}
Expand description

Convert a number type into a float.

Required Methods§

Source

fn to_f32(&self) -> Result<f32, ()>

Return the number as an f32, or Err(()) if the conversion is not possible.

Source

fn to_f64(&self) -> Result<f64, ()>

Return the number as an f64, or Err(()) if the conversion is not possible.

Implementors§

Source§

impl ToFloat for style::values::specified::number::Number

Source§

impl ToFloat for ScaleFactor

Source§

impl ToFloat for style::values::computed::Number