51 lines
694 B
Rust
51 lines
694 B
Rust
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum Metric {
|
|
Metre,
|
|
Gram,
|
|
Celsius,
|
|
SquareMetre,
|
|
CubicMetre,
|
|
Litre,
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum NonMetric {
|
|
// Length
|
|
Inch,
|
|
Foot,
|
|
Yard,
|
|
Mile,
|
|
// Weight
|
|
Ounce,
|
|
Pound,
|
|
Stone,
|
|
// Temperature
|
|
Fahrenheit,
|
|
// Area
|
|
SquareInch,
|
|
SquareFoot,
|
|
Acre,
|
|
SquareMile,
|
|
// Volume
|
|
CubicInch,
|
|
CubicFoot,
|
|
// Fluid volume
|
|
ImperialFluidOunce,
|
|
ImperialPint,
|
|
ImperialQuart,
|
|
ImperialGallon,
|
|
USGallon,
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub struct MetricQuantity {
|
|
pub amount: f64,
|
|
pub unit: Metric,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
pub struct NonMetricQuantity {
|
|
pub amount: f64,
|
|
pub unit: NonMetric,
|
|
}
|