Simplify

Trait Simplify 

Source
pub trait Simplify {
    type Out: Unit;

    // Required method
    fn simplify(self) -> Quantity<Self::Out>;
}
Expand description

Trait for simplifying composite unit types.

This allows reducing complex unit expressions to simpler forms, such as Per<U, U> to Unitless or Per<N, Per<N, D>> to D.

Required Associated Types§

Source

type Out: Unit

The simplified unit type.

Required Methods§

Source

fn simplify(self) -> Quantity<Self::Out>

Convert this quantity to its simplified unit.

Implementors§

Source§

impl<N, D> Simplify for Quantity<Per<N, Per<N, D>>>
where N: Unit, D: Unit,

Source§

type Out = D

Source§

impl<U> Simplify for Quantity<Per<U, U>>
where U: Unit,