Convert

Trait Convert 

Source
pub trait Convert: PartialEq {
    // Required method
    fn as_si(&self) -> Result<f64, Error>;

    // Provided method
    fn convert(&self, unit: &Self, value: f64) -> Result<f64, Error> { ... }
}

Required Methods§

Source

fn as_si(&self) -> Result<f64, Error>

conversion factor between this and SI value

Provided Methods§

Source

fn convert(&self, unit: &Self, value: f64) -> Result<f64, Error>

convert a value with this unit into another unit

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§