2023-05-13 14:50:18 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
|
|
pub enum Metric {
|
|
|
|
Metre,
|
|
|
|
Gram,
|
2023-05-29 18:37:56 +00:00
|
|
|
Celsius,
|
2023-05-28 23:55:43 +00:00
|
|
|
SquareMetre,
|
2023-05-29 19:29:10 +00:00
|
|
|
CubicMetre,
|
2023-05-30 17:01:35 +00:00
|
|
|
Litre,
|
2023-05-13 14:50:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
|
|
pub enum NonMetric {
|
|
|
|
// Length
|
|
|
|
Inch,
|
2023-05-13 23:18:27 +00:00
|
|
|
Foot,
|
2023-05-13 14:50:18 +00:00
|
|
|
Yard,
|
2023-05-13 23:18:27 +00:00
|
|
|
Mile,
|
2023-05-13 14:50:18 +00:00
|
|
|
// Weight
|
|
|
|
Ounce,
|
|
|
|
Pound,
|
|
|
|
Stone,
|
2023-05-28 17:32:31 +00:00
|
|
|
// Temperature
|
|
|
|
Fahrenheit,
|
2023-05-28 23:55:43 +00:00
|
|
|
// Area
|
|
|
|
SquareInch,
|
2023-05-29 00:01:56 +00:00
|
|
|
SquareFoot,
|
2023-05-29 00:18:30 +00:00
|
|
|
Acre,
|
2023-05-29 00:27:55 +00:00
|
|
|
SquareMile,
|
2023-05-29 19:29:10 +00:00
|
|
|
// Volume
|
|
|
|
CubicInch,
|
2023-05-29 19:40:03 +00:00
|
|
|
CubicFoot,
|
2023-05-30 17:01:35 +00:00
|
|
|
// Fluid volume
|
|
|
|
ImperialGallon,
|
2023-05-30 17:08:42 +00:00
|
|
|
ImperialQuart,
|
2023-05-30 17:16:17 +00:00
|
|
|
ImperialPint,
|
2023-05-30 17:34:38 +00:00
|
|
|
ImperialFluidOunce,
|
2023-05-13 14:50:18 +00:00
|
|
|
}
|
|
|
|
|
2023-05-28 15:57:49 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
2023-05-13 14:50:18 +00:00
|
|
|
pub struct MetricQuantity {
|
|
|
|
pub amount: f64,
|
|
|
|
pub unit: Metric,
|
|
|
|
}
|
|
|
|
|
2023-05-14 00:40:21 +00:00
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
2023-05-13 14:50:18 +00:00
|
|
|
pub struct NonMetricQuantity {
|
|
|
|
pub amount: f64,
|
|
|
|
pub unit: NonMetric,
|
|
|
|
}
|