2023-05-13 14:50:18 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
|
|
pub enum Metric {
|
|
|
|
Metre,
|
|
|
|
Gram,
|
2023-05-28 17:32:31 +00:00
|
|
|
Celcius,
|
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-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,
|
|
|
|
}
|