irox_units::units

Trait UnitStruct

Source
pub trait UnitStruct<T>: Unit<T> {
    type Output;

    // Required methods
    fn new(value: f64, units: T) -> <Self as UnitStruct<T>>::Output;
    fn value(&self) -> f64;
    fn units(&self) -> T;
}
Expand description

Represents a Value/Unit pairing

Required Associated Types§

Required Methods§

Source

fn new(value: f64, units: T) -> <Self as UnitStruct<T>>::Output

Creates a new type

Source

fn value(&self) -> f64

Returns the value of this struct

Source

fn units(&self) -> T

Returns the unit type of this struct

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§