Skip to main content

UnitConversion

Trait UnitConversion 

Source
pub trait UnitConversion: Copy {
    // Required methods
    fn pt(&self) -> f64;
    fn mm(&self) -> f64;
    fn cm(&self) -> f64;
    fn inch(&self) -> f64;
}
Expand description

Unit conversion trait.

Required Methods§

Source

fn pt(&self) -> f64

Convert to points.

Source

fn mm(&self) -> f64

Convert to millimeters.

Source

fn cm(&self) -> f64

Convert to centimeters.

Source

fn inch(&self) -> f64

Convert to inches.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl UnitConversion for f64

Source§

fn pt(&self) -> f64

Source§

fn mm(&self) -> f64

Source§

fn cm(&self) -> f64

Source§

fn inch(&self) -> f64

Implementors§